small-code-coder-1.5b-tools
A LoRA fine-tune of Qwen2.5-Coder-1.5B-Instruct that teaches the model to emit
native <tool_call> function calls, so a ≤2B coder model can drive an agentic
coding loop.
Built for small-code — an SLM-optimized agentic coding assistant — for the Hugging Face Build Small hackathon.
Why
Out of the box, small Qwen-Coder models describe tool calls as plain-text JSON
instead of emitting the native <tool_call> format that runtimes (Ollama,
llama.cpp) parse — which breaks agentic tool-use loops. This fine-tune closes
that gap on a tiny (≤2B, Tiny-Titan-class) model.
Training
- Base: Qwen/Qwen2.5-Coder-1.5B-Instruct
- Method: bf16 LoRA (r=16, α=32) on attention + MLP projections, via TRL SFT
- Data: NousResearch/hermes-function-calling-v1 (rendered to Qwen ChatML so the
target is native
<tools>/<tool_call>) - Hardware: NVIDIA DGX Spark (GB10)
Use
Standard Qwen2.5 chat template with tools=. The model responds with
<tool_call>{"name": ..., "arguments": ...}</tool_call> when a tool is warranted.
Status — experimental v1 ⚠️
This first pass (1 epoch, max_length=1024, ~3.7k examples) does not yet
reliably emit <tool_call> in free generation: teacher-forced token accuracy
was 0.92, but greedy decoding is degenerate and sensitive to the prompt template
(it was trained on the Hermes ChatML rendering, not Qwen's apply_chat_template
output — a train/inference mismatch). Treat as a proof-of-pipeline, not a
production tool-caller.
Known fixes for v2: align train and inference templates (use
apply_chat_template(tools=...) for both), more epochs, full sequence length,
and a held-out eval on tool-call emission.
License
Apache-2.0 (inherits from the base model).
- Downloads last month
- 21
Model tree for seanpoyner/small-code-coder-1.5b-tools
Base model
Qwen/Qwen2.5-1.5B