hotdogs/Agents-A1-4B-kimi-Preview
<h1 align="center">๐ค Agents-A1-4B-kimi-Preview</h1>
<p align="center"> <b>4B Coding Agent Model โ SFT Fine-tuned ยท Kimi K3 Traces ยท Tool-Calling</b> </p>
<p align="center"> <img src="https://img.shields.io/badge/license-AGPL--3.0-red"> <img src="https://img.shields.io/badge/Agents--A1-4B-blue"> <img src="https://img.shields.io/badge/SFT-LoRA-brightgreen"> <img src="https://img.shields.io/badge/Kimi--K3-Traces-orange"> <img src="https://img.shields.io/badge/Preview-v0.1-yellow"> </p>
<br>
Preview release โ Fine-tuned from InternScience/Agents-A1-4B on Kimi K3 coding and debugging traces. Specializes in coding agent behavior, debugging, and step-by-step tool-use.
โจ Key Features
๐ Usage
Python (Transformers)
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained(
"hotdogs/Agents-A1-4B-kimi-Preview",
torch_dtype="auto",
device_map="auto",
trust_remote_code=True
)
tokenizer = AutoTokenizer.from_pretrained("hotdogs/Agents-A1-4B-kimi-Preview")
messages = [{"role": "user", "content": "Write a Python function to sort a list"}]
inputs = tokenizer.apply_chat_template(messages, tokenize=True, return_tensors="pt")
outputs = model.generate(inputs, max_new_tokens=256, temperature=0.6)
print(tokenizer.decode(outputs[0]))GGUF (llama.cpp)
GGUF quantized version coming soon.
๐ฆ Downloads
๐งฌ Architecture
๐๏ธ Training Details
Base Model
**InternScience/Agents-A1-4B** โ A 4B VLM based on Qwen3.5 architecture with hybrid linear/full attention. Fine-tuned on the text decoder only.
Dataset
**greghavens/kimi-k3-coding-and-debugging-traces** โ 4,928 high-quality coding agent traces from Kimi K3, featuring:
- Real coding and debugging trajectories
- Multi-step tool-use patterns
- 156 task categories (build-game, dependency-planning, debug-concurrency, etc.)
- Languages: Python, C, C++, Go, Java, Rust, Bash, etc.
- Auto-generated coding agent reasoning
Preprocessed: 3,389 clean rows after deduplication and filtering (3,219 train / 170 val).
Training Pipeline
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Training Pipeline โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โ
โ Base Model LoRA Adapter โ
โ (Agents-A1-4B) (r=64, ฮฑ=128) โ
โ โ โ โ
โ โโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโ โ
โ โ โ
โ Unsloth FastLanguageModel โ
โ device_map="auto" ยท 4ร RTX 3060 12GB โ
โ โ โ
โ โผ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ Custom SFTDataset โ โ
โ โ โข apply_chat_template() โ โ
โ โ โข Tokenize (4096 max) โ โ
โ โ โข Mask prompt tokens โ โ
โ โโโโโโโโโโโโฌโโโโโโโโโโโโโโโโ โ
โ โ โ
โ โผ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ HF Trainer (no SFTTr.) โ โ
โ โ โข BF16 ยท LR=1e-4 โ โ
โ โ โข max_grad_norm=1.0 โ โ
โ โ โข 3 epochs ยท batch=1 โ โ
โ โ โข ~8.5 hours on 4ร3060 โ โ
โ โโโโโโโโโโโโฌโโโโโโโโโโโโโโโโ โ
โ โ โ
โ โผ โ
โ Final Model (scale=0.4) โ
โ (LoRA merged into text decoder) โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโMerge Quality
The LoRA was tested at multiple merge scales to find the optimal balance between preserving base knowledge and applying the fine-tuned behavior:
Max weight diff measures the largest change in any single weight tensor compared to the base model. Values below 0.02 are considered safe โ the model retains base knowledge while incorporating new behaviors. The final merge uses scale=0.4 for a good balance.
Hardware
Hyperparameters
โ What This Model Excels At
- Coding agent tasks โ Planning, debugging, building real projects
- Step-by-step reasoning โ Autonomous agent trace style
- Tool calling โ File operations, shell commands, testing
- Multi-language โ Python, C, C++, Go, Java, Rust, Bash, etc.
- Multi-turn โ Full trajectory conversations
- Thai + English โ Native bilingual capability
๐ Dataset Statistics
โ ๏ธ Limitations
- 4B model โ Smaller than 27B/72B models
- Preview โ Early release
- Text-only โ Text decoder only (no vision encoder)
- Coding-focused โ Excels at coding/debugging, general knowledge may vary
๐ Support / เนเธเธฃเธเธชเธเธฑเธเธชเธเธธเธ
If you find this model useful, please consider supporting my work! เธซเธฒเธเธเธธเธเธเธดเธเธงเนเธฒเนเธกเนเธเธฅเธเธตเนเธกเธตเธเธฃเธฐเนเธขเธเธเน เธเธฃเธธเธเธฒเธชเธเธฑเธเธชเธเธธเธเธเธฅเธเธฒเธเธเธญเธเธเธฑเธเธเนเธงเธขเธเธฐเธเธฐ! ๐
<p align="center"> <img src="https://huggingface.co/hotdogs/Qwen35B-Agent-R2/raw/main/donate.webp" alt="Bitcoin QR โ Donate" width="256"> </p>
โฟ Bitcoin โ BTC:
bc1qf27cyk3vmugcdyv9xdtuv5jwz37863crpj5c9vThank you for your support! ๐โจ เธเธญเธเธเธธเธเธกเธฒเธเน เธชเธณเธซเธฃเธฑเธเธเธฒเธฃเธชเธเธฑเธเธชเธเธธเธเธเนเธฒ! ๐๐ค
๐ Acknowledgements / เธเธญเธเธเธธเธ
- [InternScience](https://huggingface.co/InternScience) โ For the Agents-A1-4B base model
- [greghavens](https://huggingface.co/greghavens) โ For the Kimi K3 coding traces dataset
- [Qwen Team (Alibaba)](https://qwenlm.github.io) โ For the Qwen3.5 architecture
- [Unsloth AI](https://unsloth.ai) โ For the training optimizations
- All dataset contributors and the open-source AI community โค๏ธ
Built with โค๏ธ by UKA โ 18-year-old coder & cybersecurity expert
