Right-size your model
Many workloads run on a model far larger than they need. A model a quarter of the size, trained on your current model’s answers to your own prompts, may serve the same workload on fewer GPUs and answer faster. This design moves a workload to that smaller model only when a check on your own traffic says quality holds, and always with the large model kept as the fallback until you retire it.The question it answers
“Can a smaller model do this workload at the quality you need, and what does it save?” The answer is one of three, as in a migration Proof:Two ways in, one proof
The smaller model can come from two places, and the proof treats them the same:- Right-sizing in your account: InferCrane’s fine-tune on your current model’s answers to your prompts, with open tools (steps 3 to 5 below).
- A model trained anywhere else: a training service, a partner, or your own team trains a model or LoRA adapter and brings it through today’s model import. A provenance file that names its base, teacher, data, and licence is planned.
What it builds on
The flow
1. Pick the current model
The current model is a binding on an endpoint: an open model you serve (the usual case), or a closed API. Its traffic shape is already recorded per binding (request_records.binding_id).
When the current model is a closed API, right-sizing does not train on its answers by default:
most closed-API terms restrict using outputs to build another model, and InferCrane cannot read
your contract. Move to an open model first with a migration Proof, then
right-size from that model. Training on a closed API’s answers is a decision for you and your
counsel, recorded on the dataset (see Data).
2. Pick smaller candidates
Candidates are listed in this order and filtered:- The current model’s own family, same tokenizer. The student starts from the same chat template, and the KL reading is possible only when both models read text into the same tokens.
- Popular families next: Qwen, then DeepSeek, then GLM, by downloads in the last 30 days.
- Filters: a licence the checkpoint catalog approves for serving (Apache-2.0, MIT, or
BSD-3-Clause today,
checkpointcatalog/policy.json); an architecture the runtime registry serves; at most half the current model’s active parameters (otherwise it is not right-sizing); fits the target GPU with room for the KV cache.
Tokenizer groups were read by comparing the files’ hashes:
tokenizer.json, vocab.json, and
merges.txt are identical across Qwen3 0.6B to 32B, and so is tokenizer_config.json (which
holds the chat template). Qwen3.5 4B and 9B and Qwen3.6 share another tokenizer.json, but Qwen3.6’s
chat template differs from Qwen3.5’s. Qwen3.8-27B has a tokenizer.json of its own.
The current DeepSeek and GLM releases are large (DeepSeek-V4-Flash 291B, GLM-5.3-Flash 321B, both
MIT). They are teachers more often than students. A student for them usually comes from the Qwen
family, with a different tokenizer, so the proof relies on graded and task sets and the KL reading
stays unknown.
3. Choose a data source
Every set is described by a dataset manifest: counts,
digests, licence, retention, and location. Its text never reaches InferCrane. Open datasets fill
gaps (a guard set, or a warm start); the student learns your workload from your traffic.
4. Generate teacher answers
The current model answers every training prompt inside your account: a batch Job sends the prompts to your current deployment (or a replica started for the job), with greedy decoding and the production system prompt, thinking mode, and answer limit. Running at a quiet hour keeps it from competing with live traffic. The answers stay in the job’s working volume and are deleted when the job ends, unless the operator keeps them as a pairs set with its own expiry. Prompts are captured, answers are not. Capture keeps one retention promise for both drafts and right-sizing, and the answers always come from the exact model and revision being replaced.5. Fine-tune
The student trains in your cluster in a bounded Job, the same shape asspeculator.TrainingJob:
a trainer image pinned by digest that the operator allows, the data mounted read-only, no service
account token, a non-root user, backoffLimit: 0, a deadline, and deletion after it ends.
Tools, all open source: Hugging Face Transformers, TRL (
SFTTrainer, and its GKD
trainer for on-policy distillation), PEFT for LoRA, and Accelerate (all Apache-2.0); PyTorch FSDP for
multi-GPU full SFT (BSD-3-Clause). Exact versions are pinned in the trainer image and read from
the package index on the day the image is built.
The Job writes a numbers-only report (schema decoded with unknown fields refused, as the draft
report is): base model and revision, method, LoRA rank, epochs, examples and tokens, the dataset
fingerprint, training and held-out loss, the files and their sha256, and the artifact digest. The
student is kept where you keep the data: a LoRA adapter or merged weights in your bucket, pinned by
manifest digest, or a private repository of your organisation, pinned by commit. Both serve today.
The Job will also record its provenance beside the files (who trained it, the teacher, the training
sets by digest), so the student is imported exactly as a model trained elsewhere would be.
A student trained on your prompts can reproduce phrases it saw often. Keep it under the same
access as the prompts and delete it when you delete them (see
Data).
6. Prove on your traffic
See The proof. Nothing switches without a signed PASS.7. Roll out in stages
Savings begin at retire, when the large model’s GPUs are released. Until then you pay for
both. After retire, a scheduled check re-runs the graded set on new traffic; a BLOCK there raises a
rollback alert, never a silent switch.
The proof
The student is compared with the current model, which is the reference, on the same prompts with greedy decoding.
Rules that keep the proof honest:
- Time split. The proof set comes from traffic captured after the training window ended.
- Overlap. The task-set build compares every request before the split with the held-out items on what the user sees (system prompts left out): the same words (exact), a shared run of 13 words (near), or a whole item of 4 to 12 words inside the request. It removes them from the training side and reports counts only (built). It does not find an item asked again in other words, an item of 3 words or fewer inside a longer request, a short request that is only part of a longer item, or an item’s text inside another request’s system prompt, so those may still be trained on. For a model trained on other data, its training sets are compared the same way before the proof (planned): any exact overlap, or near overlap above 1% of the proof set, makes the verdict UNKNOWN.
- Same tokenizer for KL. The divergence check compares token IDs, so it reads KL only when both servers’ tokenizer files are known to be the same (built). Otherwise KL is unknown, with that reason. KL between a large and a small model is expected to be far above a precision change’s, so no threshold is set.
- Binding. The verdict binds the student’s artifact digest, the training and proof sets’ fingerprints, the reference’s revision, and both sides’ evidence digests.
Where each step runs and who holds the data
Right-sizing on your traffic needs an InferCrane agent in your cluster serving the endpoint (customer-cloud). The hosted gateway never captures, and training on traffic of hosted or
dedicated endpoints is out of scope until there is a written data-processing promise for it.
The invariant “prompts, completions, and request content never leave an agent’s machine or
cluster” holds as written. Every new field the control plane receives is a count, a digest, a
licence identifier, or a time.
What it costs, per model size
A run has three parts. All figures are estimates from the formulas below, not measurements.- Teacher answers: answer tokens ÷ your deployment’s output tokens per second at load. The optimization run already measures that figure for your deployment.
- Training: about 4 × parameters × tokens processed for LoRA, 6 × for full SFT (active parameters for a mixture of experts), divided by the GPU’s dense BF16 peak times the share of it training reaches. The share is assumed: 35% on an H100, 30% on an L40S or L4. It is unmeasured.
- Proof: the same as a migration run: each candidate’s GPU time for the replay windows and the checks. A run’s spend cap bounds it; it is unknown until a right-size run is measured.
A mixture of experts trains well below the dense share, so its row is a floor. LoRA fits one GPU up
to about 14B on an L40S (48 GB) and about 32B on an H100 (80 GB) with activation checkpointing.
Teacher answers for 10 million answer tokens, from the bandwidth roofline at 64 requests at once
and half its rate (estimates, unmeasured):
So training a small student costs a few GPU-hours. The decision rests on the proof and on serving
cost after retire, which is measured, not estimated.
What has to be built
- The rest of the open-model baseline for the Migration Proof. A deployment you serve on the
endpoint can be the baseline when the control plane reaches it (built). Still to build: a
baseline served through the agent in your own cloud, its price from its GPU hours (its cost is
unknown today), and scaling the current model down after
migrate finish(today you do that yourself). - Capture in the agent’s data plane, shared with trained drafts, and the Data area.
- Two Job specs and a trainer image: teacher answers and fine-tuning, bounded like
speculator.TrainingJob, with numbers-only reports. - An artifact kind for a distilled checkpoint (
optimizedartifact, tooltrl). The store’s kind check needs a new forward-only migration. - The overlap check for imported models, whose training sets come from elsewhere (the build already does it for sets cut from your traffic).
- A provenance file for model imports: the base, teacher, training data, and licence of a trained model, read by the model import that exists, so there is one import path.
- Dashboard: one screen per step (pick, data, train or bring a model, prove, switch); depth such as KL and fingerprints under Advanced.
What is unknown
- Whether a smaller model holds quality on any given workload. That is what the proof answers.
- Savings: they depend on the GPUs before and after and on your traffic, and exist only after retire.
- How many examples a workload needs. 10,000 conversations is a starting assumption.
- Training and teacher throughput on each GPU; the shares in the cost formulas are assumed.
- How much of the gap LoRA closes compared with full SFT, per size, and whether training on teacher answers is enough or on-policy distillation is needed. Qwen3’s own small models were already distilled from larger ones by their publisher, so gains on general chat may be small; a narrow workload is where right-sizing is expected to matter, unmeasured.
- Thinking models: answers with reasoning are long, so teacher and training cost scale with them.
- Requests with tools: a graded set cannot hold tool cases today, so tool-calling workloads need a graded tool check first. Requests with images, audio, or tool results are not captured.
- How fast a right-sized model’s quality falls as traffic changes.
- Legal: whether a closed API’s terms allow training on its answers (default: not used); whether a share-alike licence reaches model weights (not decided; no such set is registered today); your own data-processing obligations for captured prompts.
First proof: the ladder
Each rung’s rules, pass bar, and spend cap are written before any server runs, and a result is published only with its receipt.
Each rung climbs only when the one below passed its bar.