config.yaml.
These keys were always accepted by Unsloth but never forwarded — set any of them today and the run does exactly what you asked. All are additive; existing configs keep working.
Quick Start
Train a gated Llama base with a token, pin the revision, and merge offline — no Hub account needed.1
Start from an Agent
Pick the model you want to fine-tune, then reach it from a config.
2
Reach a gated base and pin a revision
3
Merge into a folder, no Hub
Model access
hf_token, trust_remote_code, and revision decide which weights load and how they are reached.
1
Gated model (Llama / Gemma)
2
Custom-code model
3
Pin a revision for reproducibility
Config
hf_token is the config-level twin of the HF_TOKEN env var. Precedence: HF_TOKEN env var wins, then a cached huggingface-cli login, then config hf_token. See Hub Privacy & Upload Options.PEFT selectors
Choose exactly which layers and parameters LoRA touches — from the last N transformer blocks to a MoE model’s experts.1
Cheap run — last N layers
Tune only the last few transformer blocks to cut memory and time.
2
MoE expert LoRA
target_parameters is what lets LoRA reach a Mixture-of-Experts model’s experts.3
Explicit layers and init scheme
Each is forwarded to
FastLanguageModel.get_peft_model only when set, so they compose with the existing lora_r, lora_alpha, use_dora, and rank_pattern keys.
Offline merged export
merged_save_dir writes merged weights to a folder on this disk — no Hub account, no token, no network.
1
Merge into a folder
Every run calls the merge step; it does nothing unless
merged_save_dir is set. Contrast this with the Hub-push flow in Export a trained model, which needs a repo id, a write token, and a network.
vLLM fast rollouts (GRPO)
fast_inference swaps GRPO’s slow HF-generate loop for vLLM rollouts — one line.
1
Turn on fast rollouts
gpu_memory_utilization and max_lora_rank are ignored unless fast_inference is on. See Reward Functions & GRPO.Expanded quant list
Unsloth’s exporter accepts 35 quantization methods — 24 standard plus 11 importance-matrix (IQ) quants. The IQ family is what lets a 30B model fit on a laptop.Standard (24)
IMatrix — large-model / laptop-fit (11)
1
Imatrix quant — 30B on a laptop
Full quant reference lives in Export a trained model.
Best Practices
Prefer config hf_token inside CI
Prefer config hf_token inside CI
Config-level
hf_token keeps the token out of environment inspection in CI. Outside CI, export HF_TOKEN=hf_... is simpler — the env var wins over config.Pin revision for any run longer than a day
Pin revision for any run longer than a day
A branch moves. Set
revision to a tag or SHA so a run you resume tomorrow loads the same weights.Reach for finetune_last_n_layers on big models
Reach for finetune_last_n_layers on big models
Tuning the last 8 blocks of a 32B model is a fraction of the memory of full LoRA — start there, widen only if quality needs it.
Merge offline before you decide to publish
Merge offline before you decide to publish
merged_save_dir gives you the merged weights on disk with no Hub round-trip. Inspect them, then push separately only if you want to.Use an imatrix quant to fit a large model on a laptop
Use an imatrix quant to fit a large model on a laptop
iq4_xs / iq3_m pack a 30B model small enough to run locally. Unsloth fetches the matrix automatically; supply imatrix_file only if you built your own.Related
Train
Full fine-tuning flow and config.yaml reference.
Train CLI
Every
praisonai train subcommand and config key.Export a trained model
Publish to HF, GGUF, or Ollama — full 35-quant reference.
Hub Privacy & Upload Options
Private-by-default pushes and the
hf_token precedence ladder.Reward Functions & GRPO
Score completions with Python and turn on vLLM fast rollouts.

