Downloads · 30 days
270
4% of all-time downloads
Luminia/MiniCPM5-1B-Agent-GGUF
MiniCPM5-1B-Agent-GGUF is a text generation model from Luminia. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
A tiny agentic coding agent for CPU: a full fine-tune (large dataset capacity) of openbmb/MiniCPM5-1B (RL+OPD checkpoint, 4 iteration or ~6d of training) specialized to reason in <think, call a small tool set (bash/re…
Downloads · 30 days
270
4% of all-time downloads
All-time downloads
6.6K
Public
Repo size
9.7 GB
Likes
17
Public
Click a slice to open those files.
.gguf3.3 GB · 63%
From the Hugging Face model README
A tiny agentic coding agent for CPU: a full fine-tune (large dataset capacity) of openbmb/MiniCPM5-1B (RL+OPD checkpoint, 4 iteration or ~6d of training) specialized to reason in <think>, call a small tool set (bash/read/write/edit/glob/grep), and run -> read output -> debug -> patch -> verify. Runs the whole loop on a free CPU.
The training scripts are in code/ (see code/README.md). This is the recipe +
code, not a one-command runner: it also needs the 26 source HF datasets (listed below), the abliterated
openbmb/MiniCPM5-1B base, a CUDA PyTorch env (torch cu128 + liger-kernel), and llama.cpp for the GGUF
step. The final v4 data this produces is already bundled at dataset/. Full fine-tunes fit under
~18 GB VRAM. The pipeline:
# 1) BUILD DATA -> train_v4.jsonl (45,762 rows). Keeps the proven v2 backbone WHOLE (42,224 rows) + ~3,538
# CURATED rows: served-vocab gate, drop non-terminating / explore-only / over-long traces, solution-aware
# MinHash dedup. Converters: code/data/converters/*.py; canonical render + assistant-span mask: code/data/schema.py
python code/data/build_v4.py
# 2) SFT - full fine-tune the abliterated base on the v4 mix (1 epoch; Liger fused CE + mem-efficient SDPA)
python code/train/sft.py --model <abliterated-base> \
--train_file dataset/train_v4.jsonl --out outputs/sft_v4 \
--epochs 1 --bsz 1 --accum 24 --lr 1e-5 --max_len 24576 --train_cap 24576
# 3) BUILD DPO PAIRS - ON-POLICY: run the SFT model over the training prompts, capture its OWN behaviour.
# chosen = a VALID <function> tool call (the model's own correct format, else the gold call);
# rejected = its real miss (rambles in <think> / answers in prose with no tool call). ~649 pairs.
python code/data/build_prefs_onpolicy_gpu.py --model outputs/sft_v4 \
--src dataset/train_v4.jsonl --out dataset/dpo_onpolicy_v4.jsonl
# 4) DPO - full fine-tune (custom completion-only loop; fits 32 GB), reference = the SFT-v4 model
python code/train/dpo.py --model outputs/sft_v4 \
--data dataset/dpo_onpolicy_v4.jsonl --out outputs/dpo_v4 \
--beta 0.1 --lr 1e-6 --epochs 3 --accum 8
# 5) GGUF for CPU serving (f16 + Q8_0) - using llama.cpp (github.com/ggerganov/llama.cpp)
python llama.cpp/convert_hf_to_gguf.py outputs/dpo_v4 --outfile dpo_v4-f16.gguf --outtype f16
llama-quantize dpo_v4-f16.gguf dpo_v4-Q8_0.gguf Q8_0
Non-obvious config behind the numbered Reproduce steps.
Per-source CONTRIBUTED rows (pre-dedup):
| HF dataset | contributed | role / cluster |
|---|---|---|
nvidia/Nemotron-SFT-OpenCode-v1 | 11,995 | backbone, strong Qwen3-Coder teacher |
nvidia/Nemotron-SFT-SWE-v2 | 6,995 | real-repo SWE patches |
nvidia/Nemotron-Terminal-Corpus | 5,995 | terminal/bash agent |
lambda/hermes-agent-reasoning-traces | 4,995 | gold <think> + tool format |
nvidia/Nemotron-SFT-Competitive-Programming-v2 | 4,995 | reasoning to runnable code |
ricdomolm/mini-coder-trajs-400k | 4,000 | curated KEEP addition |
nvidia/OpenCodeReasoning | 3,995 | reasoning to code |
nlile/misc-merged-claude-code-traces-v1 | 3,954 | census-recovered (real Claude-Code, Anthropic content-blocks) |
nvidia/SWE-Zero-openhands-trajectories | 3,000 | curated KEEP addition |
openbmb/UltraData-SFT-2605 | 2,995 | anti-forget anchor |
TeichAI/DeepSeek-v4-Pro-Agent | 2,284 | pi-harness / Kimi session |
zake7749/deepseek-v4-pro-agent-tool-calling-trajectory | 1,813 | curated KEEP addition |
Emperorizzis/ASTRA-SFT-1k | 1,000 | curated KEEP addition |
TeichAI/MiniMax-M2.1-Code-SFT | 916 | census-recovered (structured tool-use) |
armand0e/minimax-m3-claude-code-traces | 30 | real MiniMax-M3 Claude-Code agentic traces |
TeichAI/Hunter-Alpha-Coding-Agent-SFT | 780 | curated KEEP addition |
woctordho/dataclaw | 465 | real Claude-Code / DataClaw usage |
peteromallet/my-dataclaw-data | 445 | real Claude-Code / DataClaw usage |
peteromallet/my-personal-codex-data | 289 | real Claude-Code / DataClaw usage |
nvidia/SWE-Hero-openhands-trajectories | 264 | curated KEEP addition |
nvidia/Nemotron-SFT-Agentic-v2 | 259 | agentic tool-use |
zhiyaowang/dataclaw-zhiyaowang | 158 | real Claude-Code / DataClaw usage |
WhitzardAgent/ClaudeCode-OpenHands | 118 | real Claude-Code / DataClaw usage |
lelouch0110/claudeset-community | 69 | real Claude-Code / DataClaw usage |
armand0e/qwen3.7-max-pi-traces | 24 | pi-harness / Kimi session |
armand0e/kimi-k2.6-claude-code-traces | 6 | pi-harness / Kimi session |
26 sources, each converted to one canonical schema ({messages, tools} -> MiniCPM ChatML + <think> + XML <function> tool-calls), tool names normalized to the served vocab. The final v4 mix = 45,762 rows = the proven v2 backbone (42,224, kept whole) + ~3,538 curated additions (served-vocab gate + solution-aware dedup; the counts above are pre-dedup CONTRIBUTED). Zero truncation: ~36% of examples are >=12k tokens (~65% of all training tokens). Bundled under dataset/.
code/train/sft.py)Memory tricks (full-FT a 1B in under 16 GB):
LigerFusedLinearCrossEntropyLoss called directly in compute_loss = saves ~10 GiB (never materializes the [B,L,130560] logits).use_gqa_in_sdpa -> False (repeat_kv); bsz=1 + attention_mask=None for the O(L) causal path (so grad-accum, not batching).garbage_collection_threshold:0.8, pin_memory=False.Result: full-FT of a 1B at 24,576 ctx fits in ~15-18 GB VRAM.
code/train/dpo.py)On-policy preference data (code/data/build_prefs_onpolicy_gpu.py): run the SFT model over the training prompts and capture its OWN behaviour - chosen = a valid <function> tool call (the model's own correct format, else the gold call), rejected = its real miss (rambles in <think> / answers in prose with no tool call). ~649 pairs. This rewards ACTING over stalling. Custom DPO loop (TRL DPOTrainer blocked by a mergekit dep cascade; TRL KTO needs bsz>1 -> OOM at 13k): frozen bf16 reference, prompt span masked (loss on completion only). Extra memory trick over SFT = lm_head applied to only the completion span, so the [L, 130560] logit tensor is never materialized (fits 32 GB).
Try it live on the demo Space - the agent runs the full write -> run -> verify loop on a free CPU and shows the trajectory + produced files inline:
web_search -> web_fetch -> compute.opencode and claw-code (open coding-agent frameworks), smallcode (small-LLM agent patterns); DataClaw (agent traces Claude Code); TeichAI (distilled agent-trace datasets + their Datagen tool), Unsloth.