CoolFace
Modelpublic

seanpoyner/smolcode-coder-cpp-1.5b-tools

sourceHugging Faceapache-2.0updated 3mo agoView on Hugging Face
0likes65downloads
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 [**smolcode**](https://gitea.poyner.ai/sean/smolcode) — 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, **assistant-only35  loss** (loss on tool calls + final answers only).36- **Data:** NousResearch/hermes-function-calling-v1 (breadth) + synthetic smolcode37  tool-use trajectories (sharpness on the actual 5 tools), all rendered through the38  *same* `apply_chat_template(tools=...)` used at inference — so the training target39  is byte-identical to the served prompt.40- **Schedule:** 3 epochs, full 2048 sequence length.41- **Hardware:** trained on Modal (x86/CUDA); served on NVIDIA DGX Spark (GB10).42 43## Use44Standard Qwen2.5 chat template with `tools=`. The model responds with45`<tool_call>{"name": ..., "arguments": ...}</tool_call>` when a tool is warranted.46 47## Status — v248v2 fixes the v1 train/inference template mismatch (v1 hit 0.92 teacher-forced token49accuracy but decoded degenerately because it was trained on a hand-rendered Hermes50ChatML format, not Qwen's `apply_chat_template` output). v2 trains and serves through51one shared template and is gated on a *free-generation* tool-call parse-rate eval52(≥90% on held-out smolcode prompts) before release — see `eval_toolcall.py` in the53smolcode repo.54 55## License56Apache-2.0 (inherits from the base model).57