File size: 7,152 Bytes
ed30b20
 
 
 
 
 
 
 
 
 
fd41802
 
 
 
 
 
 
 
 
fd02e4f
ed30b20
fd41802
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fd02e4f
 
 
 
 
 
ed30b20
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fd41802
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
---
language:
- en
library_name: transformers
pipeline_tag: text-generation
base_model: WithinUsAI/WIUAI.Mini.Coder.ToolCalling
datasets:
- greghavens/fable-5-coding-and-debugging-traces
- greghavens/gpt-5.6-sol-coding-and-debugging-traces
- greghavens/glm-5.2-coding-and-debugging-traces
- HuggingFaceFW/fineweb-edu
- nvidia/Nemotron-Pretraining-SFT-v1
- bigcode/starcoderdata
- nvidia/Nemotron-Pretraining-Code-v1
- HuggingFaceFW/finewiki
- open-web-math/open-web-math
- nvidia/Nemotron-CC-Math-v1
- nvidia/OpenCodeInstruct
- nvidia/OpenMathInstruct-2
- NousResearch/hermes-function-calling-v1
tags:
- WIUAI
- WIUAI.Mini.Coder
- code-llm
- code-generation
- code-completion
- programming
- algorithmic-reasoning
- small-language-model
- compact-llm
- from-scratch
- causal-language-model
- llama
- starcoder-tokenizer
- supervised-fine-tuning
- pretraining
- multi-stage-training
- tpu
- google-tpu-research-cloud
- TRC
- function-calling
- tool-use
- hermes
- chatml
- full-fine-tune
- withinusai
---

# WIUAI.Mini.Coder.Traces

Full fine-tune of [WithinUsAI/WIUAI.Mini.Coder.ToolCalling](https://huggingface.co/WithinUsAI/WIUAI.Mini.Coder.ToolCalling) on coding and debugging agent-trace datasets by
greghavens (listed below). Published by WithinUsAI.

> **Status:** checkpoint at **step 233 of 233** (epoch 1.00 of 1). This README and the weights are
> replaced automatically at every checkpoint, so the repo always holds one complete, latest model.
> Elapsed training time so far: 66 min. No task benchmark has been run.

## Prompt format

ChatML written as plain text: `<|im_start|>role\n...<|im_end|>\n` with roles system, user, assistant, tool. Tool calls are written as
`<tool_call>` JSON `</tool_call>` and tool results as `<tool_response>` blocks. In this tokenizer `<|im_start|>` and `<|im_end|>`
are ordinary text, not single tokens. Stop generation with a stop string and cut the output at the first `<|im_end|>`.

```python
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
repo = "WithinUsAI/WIUAI.Mini.Coder.Traces"
tok = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(repo, dtype=torch.float16, device_map="auto")
prompt = ("<|im_start|>system\nYou are a coding agent.<|im_end|>\n"
          "<|im_start|>user\n" + USER_MESSAGE + "<|im_end|>\n"
          "<|im_start|>assistant\n")
ids = tok(prompt, return_tensors="pt", add_special_tokens=False).to(model.device)
out = model.generate(**ids, max_new_tokens=300, do_sample=False, stop_strings=["<|im_end|>"], tokenizer=tok)
print(tok.decode(out[0][ids["input_ids"].shape[1]:]).split("<|im_end|>")[0])
```

Keep prompt plus output under 1024 tokens, the model's context length. For long sessions, feed only the most recent messages.

## Training data

Long rows: **rows over 1024 tokens keep only the most recent whole messages that fit, always including the full supervised message (the beginning of the session is cut)**

| Dataset | License | Rows | Rejected | Duplicates | Target too long | Context cut | Examples used | In training split | Supervised | Note |
|---|---|---|---|---|---|---|---|---|---|---|
| [fable-5-coding-and-debugging-traces](https://huggingface.co/datasets/greghavens/fable-5-coding-and-debugging-traces) | CC BY 4.0 | 15961 | 0 | 0 | 1607 | 9614 | 3000 | 2933 | last_assistant |  |
| [gpt-5.6-sol-coding-and-debugging-traces](https://huggingface.co/datasets/greghavens/gpt-5.6-sol-coding-and-debugging-traces) | CC BY 4.0 | 17939 | 0 | 0 | 1335 | 15607 | 3000 | 2908 | last_assistant |  |
| [glm-5.2-coding-and-debugging-traces](https://huggingface.co/datasets/greghavens/glm-5.2-coding-and-debugging-traces) | other (see dataset card) | 3642 | 0 | 1825 | 129 | 1273 | 1688 | 1610 | last_assistant |  |
| [kimi-k3-coding-and-debugging-traces](https://huggingface.co/datasets/greghavens/kimi-k3-coding-and-debugging-traces) | CC BY 4.0 | 3956 | 0 | 0 | 0 | 0 | 0 | 0 | last_assistant | excluded: 34% of supervised tool calls have empty arguments |

Attribution (CC BY 4.0 requires credit; check each dataset card for its license terms):

- fable-5-coding-and-debugging-traces: https://huggingface.co/datasets/greghavens/fable-5-coding-and-debugging-traces (CC BY 4.0)
- gpt-5.6-sol-coding-and-debugging-traces: https://huggingface.co/datasets/greghavens/gpt-5.6-sol-coding-and-debugging-traces (CC BY 4.0)
- glm-5.2-coding-and-debugging-traces: https://huggingface.co/datasets/greghavens/glm-5.2-coding-and-debugging-traces (other (see dataset card))

Rows are converted to ChatML (tool schemas and hidden reasoning blocks are not included). Duplicates are removed (SHA-256).
Loss is computed on assistant tokens only; the datasets use cumulative rows (each row a longer prefix of the same session), so only the
last assistant message of each row is supervised. At most 3000 examples are taken from each dataset. The split is by session, so one
session never appears in both train and validation. Split: 7451 train / 237 validation. Tokens per epoch: 4,136,424
(1,394,873 supervised). Seed 1147.

## Training

| Setting | Value |
|---|---|
| Starting weights | WithinUsAI/WIUAI.Mini.Coder.ToolCalling |
| Hardware | 2x Tesla T4 (Kaggle), DataParallel via Hugging Face Trainer |
| Precision | fp32 master weights, fp16 mixed precision, activation checkpointing |
| Context length | 1024 |
| Batch | 4 per GPU x 2 GPUs x 4 accumulation = 32 |
| Learning rate | 2e-05 peak, cosine, 3% warmup, weight decay 0.01, grad clip 1.0 |
| Epochs | 1 (233 steps) |

## Progress (validation loss is on assistant tokens of the held-out sessions)

Starting model before training: **3.3581**

| Step | Epoch | Train loss | Validation loss | Spot check |
|---|---|---|---|---|
| 50 | 0.21 | 2.5812 | 2.5347 | 0/2 |
| 100 | 0.43 | 2.1885 | 2.3185 | 0/2 |
| 150 | 0.64 | 2.0826 | 2.2330 | 0/2 |
| 200 | 0.86 | 2.0757 | 2.2083 | 0/2 |
| 233 | 1.00 | 1.9277 | 2.2065 | 0/2 |

## Spot check at this checkpoint

Two fixed coding prompts. Pass = the output contains an expected snippet. A tiny smoke test, not a benchmark.

| Prompt | Pass | Stopped | Output |
|---|---|---|---|
| Write a Python function is_prime(n) that returns True if n is prime. | no | no | `<tool_call> / {"name": "exec", "arguments": {"source": "const r = await tools.exec_command({cmd:\"git status --short && git status --short &...` |
| This code raises IndexError. Fix it: | no | no | `<tool_call> / {"name": "exec", "arguments": {"source": "const r = await tools.exec_command({\"cmd\":\"pwd && git status --short\",\"pwd\":\"...` |

## Limitations

- Context is 1024 tokens, far shorter than a typical agent session. Training rows keep only the most recent messages, so the model rarely sees the system prompt or task statement of a long session.
- Trained on traces produced by other AI models, so it can imitate their style without their reliability.
- Tool-calling behavior learned from Hermes Function-Calling V1 may have regressed. It was not re-tested after this run.
- The validation split is from the same datasets. No external benchmark was run.
- Can produce incorrect code or malformed tool calls. Review output before running it.