/vibe:distil-mini-model-expertfrom vibe
Guides creation of small distilled models for edge deployment: selecting teacher/student pairs, choosing distillation recipes (response/logit/feature), building synthetic datasets, evaluating, and quantizing to GGUF/MLX/ONNX.
Ships in vibe. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
You are an expert at authoring small / distilled models for on-device or edge deployment. You pick a teacher (frontier model or specialised in-house), choose the distillation recipe (response distillation vs logit / KL distillation vs feature distillation), evaluate on real-world prompts before push, and quantize the student to GGUF / MLX / ONNX for footprint.
Distillation transfers behavior from a large teacher to a smaller student. Three variants:
| Type | What's matched | Needs teacher logits? |
|---|---|---|
| Response (text) distillation | Final tokens / responses | No — just outputs |
| Logit / KL distillation | Soft probability dist over vocab | Yes — full logits at every position |
| Feature / hidden-state distillation | Intermediate activations | Yes — full hidden states |
Modern open-model practice is dominated by response distillation because it works with closed-API teachers (GPT-4o, Claude, o3) and avoids licensing issues with logits. DeepSeek-R1-Distill-Qwen-7B was built this way: take Qwen2.5-7B, fine-tune on R1 outputs, ship.
[teacher] → [synthetic dataset] → [student SFT] → [optional DPO/RLAIF] → [eval] → [quantize] → [publish]
| Goal | Teacher candidate | Student candidate |
|---|---|---|
| General chat for laptop | Claude Sonnet / GPT-4o | Llama 3.2 3B, Phi-3.5 mini, Qwen 2.5 3B |
| Reasoning on edge | o3-mini, R1, Sonnet thinking | Qwen 2.5 7B, Mistral 7B |
| Coding on phone | GPT-4o, Claude, Codestral | Qwen 2.5 Coder 1.5B, Phi-3.5-mini |
| Tool use / agents | Claude / GPT-4 with tools | Mistral 7B, Llama 3.1 8B |
Match the student's architecture family to expected deployment runtime — Llama-arch is GGUF-mature, Phi-3 is MLX/ONNX-friendly, Gemma is mobile-friendly via MediaPipe.
import anthropic
client = anthropic.Anthropic()
def generate_pair(prompt, model="claude-opus-4-7"):
msg = client.messages.create(
model=model, max_tokens=1024,
messages=[{"role":"user","content":prompt}],
)
return {"prompt": prompt, "completion": msg.content[0].text}
# Iterate over a curated prompt set covering target distribution
prompts = json.load(open("prompts.json"))
dataset = [generate_pair(p) for p in prompts]
Tips:
# axolotl distill.yml
base_model: Qwen/Qwen2.5-3B
sequence_len: 4096
adapter: lora
lora_r: 32
lora_alpha: 64
lora_target_modules: [q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj]
datasets:
- path: ./distill_data.jsonl
type: chat_template
chat_template: chatml
num_epochs: 3
optimizer: adamw_bnb_8bit
learning_rate: 0.0002
warmup_steps: 100
gradient_accumulation_steps: 4
micro_batch_size: 4
accelerate launch -m axolotl.cli.train distill.yml
python -m axolotl.cli.merge_lora distill.yml --lora_model_dir ./out
import torch.nn.functional as F
# Teacher and student forward
with torch.no_grad():
t_logits = teacher(input_ids).logits
s_logits = student(input_ids).logits
T = 2.0 # temperature
loss_kd = F.kl_div(
F.log_softmax(s_logits / T, dim=-1),
F.softmax(t_logits / T, dim=-1),
reduction="batchmean") * (T * T)
loss = 0.5 * loss_ce + 0.5 * loss_kd
Used when both teacher and student are open weights with same tokenizer.
# Sanity baseline vs teacher
promptfoo eval --providers openai:gpt-4o anthropic:claude-opus-4-7 \
ollama:my-distil-3b --prompts ./real_prompts.yaml \
--tests ./assertions.yaml
# Domain accuracy
lm_eval --model hf --model_args pretrained=./out \
--tasks mmlu,gsm8k,arc_challenge --batch_size 8
# Latency on target hardware
llama-bench -m ./out-q4_K_M.gguf -p 512 -n 128
Eval before quantization to know what the model actually learned, then after to see the quant cost.
# Convert to GGUF F16
python convert_hf_to_gguf.py ./merged --outfile distil-3b-f16.gguf --outtype f16
# Generate imatrix for sub-Q5
./llama-imatrix -m distil-3b-f16.gguf -f calibration.txt -o distil-3b.imatrix
# Quantize at multiple targets
for q in Q4_K_M Q5_K_M Q8_0; do
./llama-quantize distil-3b-f16.gguf distil-3b-$q.gguf $q
done
./llama-quantize --imatrix distil-3b.imatrix distil-3b-f16.gguf distil-3b-iq3_m.gguf IQ3_M
For Apple Silicon: mlx_lm.convert --hf-path ./merged --mlx-path ./distil-3b-mlx -q --q-bits 4.
# HF Hub
huggingface-cli upload yourname/distil-3b-q4 ./distil-3b-q4_K_M.gguf
# Ollama
ollama create yourname/distil:3b-q4_K_M -f Modelfile
ollama push yourname/distil:3b-q4_K_M
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub anubhavg-icpl/vibe --plugin vibe5,304 skills in this plugin
/3d-pipelineChoose a 3D generation or reconstruction pipeline given input type, output format, and use case. Use when you need help with 3d pipeline./8-bit-orbit-video-templateHyperframes Video TemplateShip a premium template-mode Hyperframes composition with a ready default showcase and deterministic timeline behavior./a2a-agent-specProduce the Agent Card and skills schema for an agent that should be callable over A2A. Use when you need help with a2a agent spec.Other plugins' skills for the same job