hunch distill turns it into a small model that runs on your machine in about 10 milliseconds, with no API call.
A small model on its own is worse than the engine that taught it. It doesn’t have to be good at everything, though. It only has to know when it is sure. Put the engine behind it, and the student answers the rows it is sure of while the engine answers the rest. hunch measures both, so you choose how much to keep local with numbers.
Distill
The BANKING77 spec sorts bank customers’ messages into 77 intents. Jev had answered 3,000 unlabelled messages, kept in the store. Distilling asks nothing:distill extra: uv add "hunch-ai[distill]", which brings fastembed and its runtime (onnxruntime, tokenizers and about 20 other packages). The encoder downloads once, about 90 MB, to ~/.cache/hunch/encoders (or FASTEMBED_CACHE_PATH).
Measure it like any engine
A distilled model is an engine,distilled:<folder>, so every command measures it. On the 385 held-out messages, which it never saw:
distill holds back a fifth of any gold rows it could have learned from and records what it trained on, so test and diff grade a distilled model only on rows it never saw. (Never saw means never saw that exact text: 3 of these 385 messages differ from a training message only in case or punctuation.)
Put the engine behind it
intent_distilled.yml is intent.yml with the student in front and Jev behind it:
intent_distilled.yml
act from the dial, which counts mistakes, not from the stated confidence.
The share that stays local grows with the answers you keep. Students trained on more of Jev’s answers, measured on the same holdout with a script of the same design (scikit-learn in place of hunch’s own linear layer, which matches it; see the design notes, round 17), kept more:
Every run and every review adds to the store, so distilling again later keeps more of the work local.
When not to use it
A student learns an answer from examples of it. When one answer is rare and missing it is costly, a few thousand rows aren’t enough. The command guard is that case: 2% of shell commands need a person, so its student saw only 9 destructive commands. Measured by a script on commands the panel had labelled and the student never saw, the student with Jev behind it (act 0.9) let through 4 of 8 destructive commands and 6 of 29 that send data out, where Jev alone let through none and one.distill flags the rare answers; hunch test --model distilled:… shows the misses on the dial’s “act on no” side. For a guard like that, keep the engine until the store holds many more of the rare answer.
A distilled model answers only the questions it was trained on, word for word. Change a question and it refuses until you distill again, and hunch diff against the old engine shows what the new student changed.