> Canonical page: https://posttrainllm.com/build-small-language-model-specialist

[← research lab](https://posttrainllm.com/)

Mac-local specialist field guide

# How to build a small language model specialist

Build a routed small language model specialist with a frozen baseline, narrow training objective, regression gates, packaging, and an honest decision.

A small language model specialist is a model that earns a narrow job through measured behavior. It does not need to outperform a frontier model everywhere. It needs to beat the chosen baseline on a defined target, stay inside regression and runtime limits, and route away when the task is outside its competence.

## Pick the job

Good specialist targets have repeatable inputs, objective outcomes, enough representative data, and a runtime reason to stay local. Examples include tool selection, structured extraction, file operations, SQL generation, formatting, or a bounded intent router.

## Establish the baseline

Run the unmodified base model on the frozen evaluation set before training. Record accuracy by slice, invalid outputs, latency, memory, and abstention or routing behavior when available. A specialist without a baseline has no demonstrated gain.

## Choose the smallest intervention

Start with prompting or constrained decoding when it solves the problem. Use LoRA or QLoRA when behavior must be learned. Consider distillation when a stronger teacher can generate reviewed target behavior. Do not stack techniques until the failure requires them.

## Protect breadth with routing

A specialist can regress on general tasks even while its target score improves. Add an explicit router or confidence boundary and evaluate it. The runtime should choose the specialist only for tasks it earned. Report a routed ship as routed, not as a new general default.

## Package the whole result

A useful specialist package includes the base identity, adapter or fused artifact, tokenizer and prompt contract, routing rule, runtime requirements, license information, evaluation report, known regressions, and reproducible configuration. Missing latency or memory remains missing.

## Make a decision

Use one of four honest outcomes: ship within the declared route, retry training, retry data or evaluation, or reject. Preserve failed attempts because they explain the next experiment and prevent the same recipe from being repeated without evidence.

PostTrainLLM is organized around this target-to-report loop. Its public file-operations specialist is a concrete example of a strong target gain paired with a disclosed breadth regression and a routing constraint.

 CTA: Inspect the specialists and report cards, then follow the Mac fine-tuning workflow for your own target.

## Route a specialist only where the evidence holds

A specialist package needs an explicit boundary: supported tasks, out-of-domain behavior, refusal conditions and the unchanged fallback. Teacher-generated trajectories are training material, not an independent test set. Deduplicate and split before training; freeze both a target gate and a breadth gate.

The [published ReST package](https://huggingface.co/posttrainllm/qwen3-4b-rest-fused) makes the tradeoff concrete. Its paired file-operations result improved from 9/12 to 12/12, while broader tool calling regressed from 30/45 to 25/45. The general-successor decision was reject. The [tiny router](https://huggingface.co/posttrainllm/pace-intent-router-v8) also failed to generalize beyond its synthetic holdout.

These are inspectable learning artifacts, not a guarantee for your application. Start from the [distillation recipe](https://posttrainllm.com/docs/recipes/distill-specialist/), preserve the evaluation provenance, and qualify routing and fallback on your own frozen workload before promotion.

Continue through the factory

[fine tune llm on mac](https://posttrainllm.com/fine-tune-llm-on-mac)[agent trajectory dataset](https://posttrainllm.com/agent-trajectory-dataset)[evaluate local llm](https://posttrainllm.com/evaluate-local-llm)[artifacts](https://posttrainllm.com/artifacts)[recipes](https://posttrainllm.com/recipes)
