Skip to main content
Fine-tuning is the next step when prompt changes, template fixes, constrained decoding, and better tool descriptions are not enough. Use it when the base model misses your task’s semantic boundary or needs to learn a production-specific output style.

Before you fine-tune

Exhaust the cheaper levers first: If the model still misses the task, fine-tune. LEAP Finetune is Liquid’s open-source training stack for the full customization loop:
  • SFT, LoRA, DPO, and GRPO
  • Text, vision, and MoE model support
  • Distributed training on local GPUs, SLURM, Kubernetes, or Modal
  • Dataset formatting and validation
  • GGUF export and quantization for deployment
You can also use TRL or Unsloth directly if those already fit your workflow.

Typical workflow

  1. Load a base model from Hugging Face. Start from the current LFM2.5 checkpoint for your target size.
  2. Prepare 500 to 5,000 task examples. Quality and distribution matter more than volume; match production inputs.
  3. Train with LoRA for the first pass. A 1.2B LoRA run can take minutes to tens of minutes on a single modern GPU.
  4. Evaluate on a held-out set that you froze before training.
  5. Iterate on data, prompts, and hyperparameters before scaling to larger runs.

Two rules that save the most pain

Train with the model’s own chat template. Use apply_chat_template and keep training formatting character-for-character identical to production. For tool calling, train on the native Pythonic tool-call format. The migration guide explains how LFMs differ from OpenAI-style JSON tool calls and how to adapt parsers safely.

Fine-tuning docs