> ## Documentation Index
> Fetch the complete documentation index at: https://docs.infercrane.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Qwen3 8b to 4b migration l4 2026 11 29

# Qwen3-8B to Qwen3-4B on 500 GSM8K items: the migration Proof's PASS, and what it does not show

On 29 November 2026, InferCrane's migration Proof compared `Qwen/Qwen3-4B` with `Qwen/Qwen3-8B`, the
model an endpoint served, on 500 GSM8K test items. The 4B answered 456 right (91.2%) and the 8B 461
(92.2%). The 4B's drop was 1.08% of the 8B's score, with a 95% interval of −1.53% to +3.65% (paired
bootstrap, 10,000 resamples). The interval's upper end is inside the product's default 5% margin, so
the signed verdict is PASS. The switch was then tried: a weighted plan adding the 4B as a canary and
citing that verdict was admitted, and rollback returned the endpoint to the 8B alone. The run did
not read the canary's share of the traffic, and sent no traffic through it. The run compared answer
quality only: it did not compare the two models' speed or cost.

This page is the receipt. The run's rules were committed before any server started, at commit
`d1e6c65e`. The harness that ran it (`tools/poc-modal`, command `migrate`), the rules and the run's
inputs with their record are in this repository. Unlike the other receipts here, the run went
through the product itself: a control plane at core `0d489d12`, its migration Proof, its graded
check, and its staged switch. Commit `d1e6c65e` is core `0d489d12` plus the harness files under
`tools/poc-modal`; it changes no product code.

## What ran

| Field | Value |
| - | - |
| Date | 2026-11-29, 14:38 to 16:06 CET. The verdict was signed at 15:51:13 CET. |
| Current model (baseline) | `Qwen/Qwen3-8B` at revision `b968826d9c46dd6066d109eabc6255188de91218`, BF16 (Apache-2.0). Served as the endpoint's one deployment binding. |
| Candidate | `Qwen/Qwen3-4B` at revision `1cfa9a7208912126459214e8b04321603b3df60c`, BF16 (Apache-2.0). One setup: the publisher's vLLM command. |
| Engine | vLLM 0.34.0, `vllm/vllm-openai@sha256:20fdb089454afbb324efa4110a2c025ff7b27cc1a086e07aa580b18df8ad1ce1`. Both models use `--max-model-len 8192`. |
| Hardware | One NVIDIA L4 (23,034 MiB) per model server on Modal; the serving check's server ran on driver 620.70.06. The control plane ran on a local Kubernetes cluster (kind); each model server was a proxy pod to its Modal GPU. |
| Product | Core `0d489d12`: the migration Proof, the graded check (evaluator `infercrane-graded`, version 2) and the staged switch, unchanged for the run. |
| Traffic | The first 200 rows of the public Mooncake trace (`kvcache-ai/Mooncake`, FAST '25, Apache-2.0), sent through the gateway to the 8B at their recorded arrival times. The trace holds token lengths, not text, so the prompts are generated words. Inputs were halved and capped at 6,000 tokens; outputs were capped at 512 tokens. That differs from the rules' text: see [Deviation from the rules](#deviation-from-the-rules). The control plane captured the traffic's shape (lengths, order, shared prefixes and session history; no content) as `sha256:e3b3464a7238776894b29184114c805016c6105e2bf9df267785a1e28eebfdb0`. |
| Task set | 500 GSM8K test items (MIT), drawn with seed 20261126. This run trained nothing and chose its items by seed. The set has two digests. `infercrane evaluation set build` turns the committed inputs into a file whose digest is `sha256:1e933c5c26c9f78499194b8ff81c528153f6237aee306746fe440bb4d1ac17fa`, the one the rules name. The harness converts that file into the task eval set the control plane reads and uploads it; the control plane's digest of the uploaded set is `sha256:7d703425ad11a8f304ea80ceec1f87f1b081b399f6207d572cb958271f4a2029`, the one the run, the campaign and the verdict name. Both can be recomputed from the committed inputs with the builder on `main`. |
| Graded check | Each model answered every item through the product's graded check: greedy (temperature 0), reasoning off, at most 1,024 answer tokens (the set's `max_tokens`), 32 items at a time. An answer is right when its `Answer:` line gives the gold number. |
| Rules | [`tools/poc-modal/rules-right-size-demo-2026-11-28.md`](https://github.com/infercrane/infercrane/blob/d1e6c65e366f4d7fabc5521371eb86ef04a56d1a/tools/poc-modal/rules-right-size-demo-2026-11-28.md), sha256 `3f97cd42c142f8ec3cd3d62b964721e5dc3eae2dcd90a31830fc69df480e268f`, as committed at `d1e6c65e366f4d7fabc5521371eb86ef04a56d1a`. Written on 28 November before any server ran. Changes after launch: none during the run. Entries added after it record that publication was cleared, the three points under [Deviation from the rules](#deviation-from-the-rules) and [What the harness got wrong](#what-the-harness-got-wrong), and that the rules' cost table gave the wrong rate (the one used is under [Spend](#spend)); the text above them is unchanged. The hash is of the file as committed at `d1e6c65e`, before those entries. |
| Inputs | [`tools/poc-modal/right-size-demo-2026-11-28/`](https://github.com/infercrane/infercrane/tree/d1e6c65e366f4d7fabc5521371eb86ef04a56d1a/tools/poc-modal/right-size-demo-2026-11-28): the run's inputs and `inputs.json`, the record of each input file's sha256 that the driver checks before it starts. |

## The verdict

| | Right of 500 | Share right |
| - | - | - |
| Qwen3-8B (baseline) | 461 | 92.2% |
| Qwen3-4B (candidate) | 456 | 91.2% |

| Field | Value |
| - | - |
| Drop | 1.08% of the 8B's share right, relative: (0.922 − 0.912) / 0.922 |
| 95% interval of the drop | −1.53% to +3.65% |
| Method | Paired bootstrap over the 500 item pairs, 10,000 resamples, seed 20261119, 2.5th and 97.5th percentiles (`releaseguard.PairedBootstrap`) |
| Margin | 5%, the product default (`optimizer.DefaultMigrationQualityMargin`); not chosen for this run |
| Rule | PASS when the interval's upper end is at most the margin; BLOCK when its lower end is above it; UNKNOWN when it straddles it |
| Verdict | PASS, code `quality_within_policy` |
| Signed verdict | ID `8261bac6f83c8488a63d6a2f87d859bc`, payload digest `sha256:2382f539ab6854330ad6f4171515024c5a65845370e0fabc95d9088a1a2a0f1f`, key `sha256:e999002c7ef06e97` |

The verdict concerns these 500 items. On them, the 4B's interval allows a drop of up to 3.65%,
which is within the margin. It does not say that the 4B answers as well in general.

## The run's own gates

The rules set four gates before the run. They ask whether the product did its job, whatever the
verdict.

| Gate | Rule | Result |
| - | - | - |
| Completed | The measured setup has a signed verdict | Passed: 1 of 1 |
| Bound | The verdict names the 8B's binding as the baseline and the 4B setup's revision, and the run's eval set is the uploaded set | Passed |
| Consistent | The 8B's share right is within 2 points of an earlier reading of the same model, commit, engine, prompts and decoding | Passed: 0.922 against 0.914. The earlier reading came from an experiment (training a smaller model from the 8B's answers) that did not pass its own bar and is not claimed here. |
| Switch behaves | On a PASS, the canary is admitted at 5% at most, and rollback returns all traffic to the 8B alone | Passed as the harness checked it: after activation the endpoint's plan was weighted and cited the verdict, and after rollback it was on the 8B alone. The canary's share was not read. |

## Deviation from the rules

* **The traffic's shaping.** The rules' "Traffic" row says the replayed trace's inputs are capped at
  6,000 tokens and its answers at 1,024. The run used the harness's Mooncake shape, which the rules
  name: it halved every input before the 6,000-token cap and capped answers at 512. The 1,024 is
  the graded check's answer limit, which the rules set in their own row and the run kept. The
  traffic shaped only the captured workload the 4B's speed was measured on; the graded check, and
  so the verdict, did not use it.

## The 4B on one L4 under the replayed trace

The campaign measured the 4B's one setup on its own server as its control. These numbers were
reported, and the rules never gated on them. Nothing was measured against them: the 8B served the
traffic and the graded check, but the campaign did not measure it. The campaign replays the
captured shape (lengths, order, shared prefixes and session history) at 32 requests at a time, not
at the trace's arrival times.

| Field | Value |
| - | - |
| Requests | 800 (four passes over the 200 captured requests, after 64 warm-up requests), 0 failed |
| Output tokens per second | 183.8: the mean of the four passes (182.9 to 184.5) |
| Time to first token, p95 | 10.25 s: the mean of the four passes' p95s (9.0 to 11.1 s) |
| Time per output token, p95 | 446 ms: the mean of the four passes' p95s (413 to 463 ms) |
| Request latency, p95 | 84.8 s: the mean of the four passes' p95s (84.6 to 85.1 s) |

At this load on one L4, the 4B answered slowly: in every pass, about one request in twenty waited
9 seconds or more for its first token.

## What it does not show

* **Speed or cost against the 8B.** The run compared answer quality only. It holds no "less
  compute" number: neither model's throughput, latency nor cost was measured against the other's.
* **Quality beyond one task set.** 500 grade-school maths items, public, with one gold number each.
  Not the customer's traffic, not other tasks, and not a general claim about 4B against 8B.
* **Maths the models have not seen.** GSM8K is a public benchmark that either model may have seen
  in training, so these scores say little about maths problems new to them. It was equally public
  to both models.
* **The canary's share of traffic, or how the 4B served behind the gateway.** The run checked that
  the canary plan was weighted and cited the verdict. It did not read the plan's weights, and no
  traffic was sent through the canary before rollback.
* **Interactive service on this hardware.** The 4B's latency on one L4 under this trace is above.
* **Other pairs, families, precisions or GPUs.** One pair, BF16, one L4 per server, an 8,192-token
  context.
* **Fine-tuned models, or endpoints served through an InferCrane agent in a customer's cloud.**

## What the harness got wrong

* **"activation unread".** After a PASS, the harness waited up to 15 minutes for the activation
  operation's status on the campaign read, which does not return it; only the activation call does.
  It then read the endpoint's plan directly, so the gate's check stands. The wait kept two L4
  servers up, idle, for about 15 minutes. The harness now reads the operation by the ID the
  activation call returns.
* **The canary's share.** The rules' Switch gate asks for a canary of at most 5%. The harness
  checked only that the endpoint's plan was weighted and cited the verdict; it read no weight. It
  reads the plan's weights since.
* **A stopped driver did not stop the servers.** The rules say a server stops when its lease is not
  renewed for 180 seconds, naming "a stopped driver". That was not true. The pods renew their
  leases through the broker, which runs in its own session, and the driver had no handler for TERM
  or HUP. So a driver killed outright would have left two L4s up until the broker's \$8.00 cap or the
  180-minute Modal timeout stopped them. This run's driver was not stopped. The driver now stops
  every server on TERM, HUP and INT, and the broker stops every server and exits when its driver is
  gone.
* **Teardown asked for one more GPU.** After the broker stopped every server, the 4B's pod
  restarted and was granted a new lease. Its Modal call was started; the lease lasted 2.5 seconds,
  until the broker exited, and no container reported a start for it. The broker grants no lease
  after it has stopped every server since.
* **Labels.** The run's log and record call the 4B's setup "Your current setup", the harness's name
  for a campaign's control. In a migration, the current setup is the 8B. The progress line
  "measuring against your current setup, taking turns" was also inaccurate. Both are fixed in the
  harness since; neither changed a number.

## Spend

The harness's broker estimated $2.44 from three leases: the 8B's server for 4,738.8 seconds ($1.55),
the 4B's for 2,715.8 seconds ($0.89), and the 2.5-second teardown lease above, for which no
container reported a start. It prices each second at Modal's list rates for an L4 container with the 4 cores and
24 GiB of memory it requests: $0.00032768 a second, the GPU's \$0.000222 (read 25 November) plus CPU
and memory (read 20 November). It counts each lease from 120 seconds before its container's reported
start, for image loading, to its end.

The estimate leaves out the Qwen3-4B serving check before the run (164.5 container-seconds, outside
the broker) and the CPU containers that staged the weights. Modal's bill was not read when this page
was written, so the run's billed cost is not stated here. The $2.44 includes the about 15 minutes in
which two L4 servers stood idle while the harness waited on the activation: at that rate, about
$0.59 of it. The run's hard cap was \$8.00.

## How to reproduce

From `main`, with a Modal account, Docker, kind and Python 3. These are the run's own steps, in
order; each stops the run if it fails:

```bash theme={"theme":"css-variables"}
export INFERCRANE_POC_ENGINE=vllm-0.34.0 INFERCRANE_POC_GPU=L4
python3 -m unittest discover -s tools/poc-modal -p 'test_right_size_demo.py'
python3 tools/poc-modal/poc_modal.py download --model Qwen/Qwen3-8B
python3 tools/poc-modal/poc_modal.py download --model Qwen/Qwen3-4B
modal run tools/poc-modal/modal_gpu.py::main --action check --model Qwen/Qwen3-4B --setup current
python3 tools/poc-modal/poc_modal.py down
python3 tools/poc-modal/poc_modal.py up
python3 tools/poc-modal/poc_modal.py migrate --engine vllm-0.34.0 --gpu L4 \
  --model Qwen/Qwen3-4B --current-model Qwen/Qwen3-8B --budget-usd 8 --gpu-timeout-minutes 180
python3 tools/poc-modal/poc_modal.py down
```

The `migrate` driver first checks its inputs against their committed record and refuses a folder
that differs. It then deploys the 8B, replays and captures the traffic, builds and uploads the task
set, plans and runs the 4B's migration Proof, tries the switch, and writes
`right-size-demo-result.json`.

The harness and the control plane are built from the same checkout. On `main` the product is newer
than the run's (core `0d489d12`; the graded check is at evaluator version 3 there), and the harness
has the fixes above, so a run from `main` is a new run under the same rules, not a replay of this
one. To run what ran, check out `d1e6c65e`. Either way, the task set and its gold answers are fixed;
answers at temperature 0 can still differ between GPU hosts and engine builds, and another run's
speed numbers will differ.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.