the aha moment
Same LoRA from 07-A, higher rank (r=16), two target projections (q_proj + v_proj), and training examples formatted with Qwen3's native tool-calling template. Teach the model to emit valid JSON for a 6-function kitchen-assistant API. Evaluate deterministically: does the JSON parse? Does the function name match? Does it generalise to held-out prompts?
the facts
- Time
- 60–90 min
- Hardware
- GPU · Mac · Colab · CPU
- Act
- VI · Making It Yours
- Status
- Live
- Artifact
- A LoRA adapter that produces valid tool-call JSON + a pass/fail eval harness.
run it locally
Clone the labs repo and run this lab as a script or open it as a notebook:
git clone https://github.com/iqbal-sk/Microscale-labs.git cd Microscale just setup-auto # auto-detects CPU / CUDA / Mac just run 07-b # or: jupyter lab labs/07-b-lora-tool-calling/lab.py
Full install options (uv, pip, or the platform-specific CUDA paths) are in the labs README.
read alongside
Lesson · 11 min · 55 xp
LoRA, visualized
How LoRA freezes pretrained weights and trains low-rank matrices BA — interactive rank slider shows how adapter capacity reshapes the model
Lesson · 12 min · 60 xp
Three recipes
Three end-to-end fine-tuning recipes — an xLAM-style tool-calling SLM, a domain specialist, and a personal assistant with your voice