Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

qubes-genie-train

MLX training & LoRA fine-tuning for the qubes-genie intent model — exports to GGUF.

Part of Qubes Genie. This repo is the training half, and it runs on your Mac, not in a qube:

[Mac · M3 Max]  dataset → mlx-lm LoRA → fuse → convert to GGUF
                                                     │
                                                     ▼
[qube · CPU]    llama.cpp loads the .gguf   ← qubes-genie

Training and inference are deliberately split: training eats Metal + unified memory, inference eats pure CPU. Their only interface is the exported .gguf file. Keeping MLX's heavy dependencies here means they never touch the inference qube.

Why MLX on Apple Silicon

An M3 Max with 128 GB unified memory uses that memory as VRAM — fine-tuning a 3B model is comfortable, and LoRA on a 7B is well within reach. No external GPU needed.

Intent schema & datasets (the system's contract)

This repo also owns the thing everything else depends on: the intent schema and the training data. You can't collect data without first pinning down what an intent is — so the schema is the natural starting point of the whole system, and it lives here next to the data that must conform to it.

schema/intent.schema.json   ← the contract: actions, valid templates, features
data/seed.jsonl             ← natural-language → intent pairs (validated against it)
scripts/validate_dataset.py ← gate: every sample's intent must match the schema

The template enum (dev, media, im, tools, gpg, vault, mcp, vpn, gentoo-dev) is exactly the set from qubes-salt-config/salt/templates/* — the model can only ask for environments that actually exist. qubes-genie constrains its decode to this schema (GBNF); qubes-mcp consumes intents that match it. Validate before committing data:

python scripts/validate_dataset.py data/*.jsonl

Pipeline

  1. Dataset — pairs of natural-language request → intent JSON (can start synthetic)
  2. Fine-tunemlx_lm.lora (LoRA) on the base 3B
  3. Fusemlx_lm.fuse merges the adapter into the weights
  4. Convert — llama.cpp's converter → GGUF, then quantize to Q4
  5. Hand off — drop the .gguf into qubes-genie

Stack

MLX · mlx-lm · LoRA · llama.cpp conversion tools. Runs on macOS / Apple Silicon.

Status

🚧 Skeleton. Training is an optimization, not a prerequisite — the system runs on a stock model + few-shot first; fine-tune here only when intent accuracy needs it.

License

MIT

About

MLX training & LoRA fine-tuning for the qubes-genie intent model, exporting to GGUF

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages