Downloads · 30 days
5
4% of all-time downloads
KookiesXy/llm1b-1.5b-toolchat
llm1b-1.5b-toolchat is a machine learning model from KookiesXy. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
Train a coherent, tool-calling LLM (warm-started from Qwen2.5-1.5B-Instruct, 1.54B params) from scratch on public SFT data in 61 minutes on a single Modal B300 — well under the 3-hour budget.
Downloads · 30 days
5
4% of all-time downloads
All-time downloads
114
Public
Parameters
1.5B
3.1 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors3.1 GB · 100%
From the Hugging Face model README
Train a coherent, tool-calling LLM (warm-started from Qwen2.5-1.5B-Instruct, 1.54B params) from scratch on public SFT data in 61 minutes on a single Modal B300 — well under the 3-hour budget.
Final model: https://huggingface.co/KookiesXy/llm1b-1.5b-toolchat (public)
| Metric | Value |
|---|---|
| Training wall time | 61.2 min (5,478 steps) |
| Tokens trained | 179.5M (43,820 packed blocks × 4,096) |
| Throughput | ~48.9k train tok/s (bf16, SDPA, grad checkpointing) |
| Final holdout loss | 0.855 |
| Chat coherence (7 tasks, avg) | 1.0 |
| Tool tasks passed | 12/12 in 3 consecutive eval runs; correct tool + args in every run (12/12) |
<tool_call>{"name": ..., "arguments": {...}}</tool_call> JSON, executes the tool
in an agent loop, and answers from the result.Example (from the eval transcript, weather_tokyo):
user: What's the weather in Tokyo?
model: <tool_call>{"name": "get_weather", "arguments": {"city": "Tokyo"}}</tool_call>
tool: {"city": "Tokyo", "temperature": 27, "condition": "rainy"}
model: The current temperature in Tokyo is 27 degrees Celsius and it's currently raining.
Please bring an umbrella if you go outside.
The whole training run is a single tightly-packed SFT pass over a small, high-quality dataset. No RL, no alignment loop, no data scaling.
mlabonne/orpo-dpo-mix-40k (40k), databricks/databricks-dolly-15k (15k),
HuggingFaceH4/ultrachat_200k (60k subsample)glaiveai/glaive-function-calling-v2 (~11k), converted from the raw
USER/ASSISTANT/FUNCTION RESPONSE format into native Qwen messages +
tools (OpenAI-style schemas) via glaive_to_messages; plus handcrafted
"golden" multi-round tool examples. Tool examples are repeated ×2 so roughly
55% of training tokens are tool-use.label[i] = ids[i+1] if assistant_mask[i+1] else -100
— predicting the next token (not the current one) is what prevents the
copy-collapse bug (loss → 0.001, newline-only generations).ckpt/last.pt.<tools> format: training on Qwen's native tool-call rendering
(schemas in the system message, <tool_call> XML output) makes the model emit
clean JSON tool calls.{"\n{"\n{... loop (the 1.5B model can't route among 6 similar schemas yet).
In production this is standard "tool routing": pick the 1–2 likely tools first.<tool_call> and returns its result, like a real function-calling agent. The
model sometimes emits extra speculative calls; executing only the first keeps
the loop grounded.web_search returned NYC-pizza results for any query. The final
harness parses only <tool_call> blocks and the mock echoes the query.{"\n{ loop. Both are typical
for a 1.5B model trained on only 180M tokens.Prereqs: Modal account, hf-token secret, HF token in
C:\Users\User\.cache\huggingface\token (or HF_TOKEN).
$env:PYTHONUTF8 = "1" # Windows only
# 1. build the packed dataset (~9 min, CPU container)
modal run .\modal_train.py --step data --tag v2
# 2. train on a B300 (~61 min)
modal run .\modal_train.py --step train --run-id run-3
# 3. final eval on the exported model (~3 min, B300)
modal run .\modal_train.py --step eval --run-id run-3
The train step auto-exports hf_export/ (HF format) and pushes to
KookiesXy/llm1b-1.5b-toolchat. If the push ever fails (the pinned image's
push_to_hub rejects safe_serialization=), run:
modal run .\push_hf.py --run-id run-3
Inspect live checkpoints:
modal run .\diag.py --run-id run-3 --temperature 0.6 --one-tool
data_build.py — dataset download, glaive→Qwen conversion, packing, holdout.train_core.py — packed SFT loop, eval, checkpointing, export, HF push.eval_core.py — functional eval: chat coherence + full tool loop with execution.modal_train.py — Modal app (data/train/eval steps).diag.py — raw generation diagnostics against a live checkpoint.push_hf.py — manual HF push of an exported run.smoke_b300.py — B300 throughput benchmark.iso.py / iso2.py — isolated syntax checks.