CoolFace
Modelpublic

seanpoyner/small-code-coder-1.5b-tools

sourceHugging Faceapache-2.0updated 4mo agoView on Hugging Face
0likes11downloads
README.md57 linesDownload Raw Back to root
1---2license: apache-2.03base_model: Qwen/Qwen2.5-Coder-1.5B-Instruct4tags:5- code6- function-calling7- tool-use8- small-language-model9- small-code10datasets:11- NousResearch/hermes-function-calling-v112language:13- en14pipeline_tag: text-generation15---16 17# small-code-coder-1.5b-tools18 19A LoRA fine-tune of **Qwen2.5-Coder-1.5B-Instruct** that teaches the model to emit20**native `<tool_call>` function calls**, so a ≤2B *coder* model can drive an agentic21coding loop.22 23Built for [**small-code**](https://github.com/seanpoyner/small-code) — an SLM-optimized24agentic coding assistant — for the Hugging Face **Build Small** hackathon.25 26## Why27Out of the box, small Qwen-Coder models describe tool calls as plain-text JSON28instead of emitting the native `<tool_call>` format that runtimes (Ollama,29llama.cpp) parse — which breaks agentic tool-use loops. This fine-tune closes30that gap on a tiny (≤2B, Tiny-Titan-class) model.31 32## Training33- **Base:** Qwen/Qwen2.5-Coder-1.5B-Instruct34- **Method:** bf16 LoRA (r=16, α=32) on attention + MLP projections, via TRL SFT35- **Data:** NousResearch/hermes-function-calling-v1 (rendered to Qwen ChatML so the36  target is native `<tools>`/`<tool_call>`)37- **Hardware:** NVIDIA DGX Spark (GB10)38 39## Use40Standard Qwen2.5 chat template with `tools=`. The model responds with41`<tool_call>{"name": ..., "arguments": ...}</tool_call>` when a tool is warranted.42 43## Status — experimental v1 ⚠️44This first pass (1 epoch, `max_length=1024`, ~3.7k examples) **does not yet45reliably emit `<tool_call>`** in free generation: teacher-forced token accuracy46was 0.92, but greedy decoding is degenerate and sensitive to the prompt template47(it was trained on the Hermes ChatML rendering, not Qwen's `apply_chat_template`48output — a train/inference mismatch). Treat as a proof-of-pipeline, not a49production tool-caller.50 51Known fixes for v2: align train and inference templates (use52`apply_chat_template(tools=...)` for both), more epochs, full sequence length,53and a held-out eval on tool-call emission.54 55## License56Apache-2.0 (inherits from the base model).57