hemlang/Inkling-Small-Hemlock-SFT-LoRA
Inkling-Small — Hemlock SFT LoRA
A rank-32 LoRA teaching Hemlock — a systems scripting language with manual memory management and structured async concurrency — to `thinkingmachines/Inkling-Small` (~266B total / ~10B active MoE).
Trained on Tinker. Shipped in Tinker's raw adapter format, not the PEFT conversion — see Serving.
Datasets
Three hemlang corpora, merged to 4,059 conversations:
Why only three of the nine hemlang datasets
The rest are redundant or not SFT data:
hemlock-codex-SFT(552) is a strict subset ofhemlock-codex2-SFT— every row is contained in it.hemlock-codex3-SFTis a verified rebuild ofcodex2+hemlock-formulary-SFT: itssourcecolumn names both, instruction overlap withcodex2is 1114/1114, and it addsexpected_stdout,sandbox_ok, andbench_overlap. Outputs are also fenced as ```hemlock.Hemlock2-DPO,Hembot-DPO,Poison-DPOare preference data, not SFT.
So docs + codex3 + transmutation covers the corpus with no duplicated supervision.
Benchmark decontamination
150 rows flagged `bench_overlap: True` were excluded, along with 11 with sandbox_ok: False. Those 150 overlap hembench, so training on them would make any hembench score partly memorisation with no way to tell. This adapter has not seen them.
Transmutation rows were rendered as translation prompts with three rotating phrasings ("Translate this C program to Hemlock", etc.), assistant responses fenced as ``hemlock. All examples carry the system prompt You are a Hemlock programming expert.`
Corpus length: median ~217 tokens, p90 ~690, max ~2,517 — so max_length 4096 truncates nothing.
Training
Results
Eval NLL fell monotonically for 230 steps, bottomed at 0.1772, and ticked up slightly on the final eval — so two epochs landed close to the natural stopping point and a third would likely have begun overfitting. The train/eval gap is small (0.146 vs 0.177), which argues the model learned the language rather than memorising 3,904 examples.
Serving
sabrewing (raw Tinker format — what this repo ships)
sabrewing applies Tinker adapters directly and wants the raw checkpoint, not the PEFT conversion (which materialises Tinker's shared factors per-expert at 3x the size for no gain):
hf download hemlang/Inkling-Small-Hemlock-SFT-LoRA --local-dir ~/Models/hemlock_lora
hf download sabrewing-engine/Inkling-Small-colibri-int4 --local-dir ~/Models/inkling_small_i4
SNAP=~/Models/inkling_small_i4 ./c/inkling -l ~/Models/hemlock_lora \
-p "Write a Hemlock program that reverses a string." -n 256Residents (attention, dense MLP, shared experts, lm_head) are merged at load; routed experts keep A/B factors resident with a low-rank correction wrapping the int4 matmul, because a rank-32 delta is smaller than the int4 quantization step and baking it in would destroy the adapter signal.
Tinker
Sample directly from the training checkpoint with a SamplingClient.
Evaluation
Not yet benchmarked. Eval NLL measures next-token prediction on held-out Hemlock text — it does not establish that generated programs compile or run. hembench is the harness that would: 38 scenarios across syntax, stdlib, algorithms, systems/concurrency, cross-language translation, and debugging, executing each program in a Docker-isolated verifier against expected output. Because the bench_overlap rows were excluded, that would be a clean read.
Related: `nbeerbower/Schierling-Qwen3.6-27B-LoRA` teaches Hemlock to a 27B dense base from the same three corpora.
License
Apache 2.0, matching the base model.
