--- license: apache-2.0 base_model: Qwen/Qwen2.5-Coder-1.5B-Instruct tags: - code - function-calling - tool-use - small-language-model - small-code datasets: - NousResearch/hermes-function-calling-v1 language: - en pipeline_tag: text-generation --- # small-code-coder-1.5b-tools A LoRA fine-tune of **Qwen2.5-Coder-1.5B-Instruct** that teaches the model to emit **native `` function calls**, so a ≤2B *coder* model can drive an agentic coding loop. Built for [**small-code**](https://github.com/seanpoyner/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 `` 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 ``/``) - **Hardware:** NVIDIA DGX Spark (GB10) ## Use Standard Qwen2.5 chat template with `tools=`. The model responds with `{"name": ..., "arguments": ...}` when a tool is warranted. ## Status — experimental v1 ⚠️ This first pass (1 epoch, `max_length=1024`, ~3.7k examples) **does not yet reliably emit ``** 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).