/tt-model-bringup:vllm-integrationfrom Tenstorrent Model Bring-up
Adds vLLM serving integration for an existing TTNN full model by creating tt/generator_vllm.py, registering with the TT vLLM plugin, running readiness checks, and reporting serving-path correctness and performance.
Ships in Tenstorrent Model Bring-up. 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.
Read when SKILL.md points to them.
Before using this workflow, follow the dependency and environment setup in the model-bringup entrypoint. Resolve its package root from this installed skill's location; do not assume this plugin is copied into the target tt-metal checkout.
If this skill is used as part of $model-bringup, follow that skill's mission, workspace, and reporting contract. This stage starts from a working TTNN full model and generator, then makes it usable through the shared vLLM serving path. The full model itself belongs to $full-model; vLLM integration owns the adapter, plugin registration, serving checks, and serving-path performance evidence.
Starting from models/autoports/<model>/, add:
tt/generator_vllm.py
Expect these files to already exist and pass generator-level readiness:
tt/model.py
tt/generator.py
If they do not, use $full-model first. During vLLM integration you may make small, evidence-backed changes to model.py or generator.py when the serving adapter exposes a real contract gap, but avoid turning this stage back into full-model bringup. Fix a serving gap that the model owns in the model or generator, even when a plugin change would be a smaller diff. Changes to the TT vLLM plugin or to vLLM follow plugin changes.
Before writing adapter code, load the datatype-sweep selection and confirm the generator constructs that exact policy: weight groups, activation/residual dtype, CCL dtype, KV-cache dtype, compute fidelities, and layer exceptions. Serving uses the selected full-model policy. Serving a reduced-speed model does not satisfy completion.
Load models/autoports/<model>/doc/context_contract.json and serve the recorded supported context. The default target is the HF-advertised context. Do not lower --max-model-len, model config context, benchmark context, API context, or any other advertised serving capability to work around a model bug. A smaller value is valid only when the context contract records evidence that a hard physical device limit prevents the advertised capability from fitting or running and that the selected value is the largest feasible one.
Serving requests may have any valid prompt length up to that supported context. The adapter must not require prompt length to be divisible by an internal prefill chunk, tile, block, page, or trace size. If the model path pads or chunks internally, the adapter passes the logical prompt length through to masks, positions, cache fill, and output slicing. Include a direct OpenAI-compatible request or targeted runner check with a valid non-aligned prompt length, not only the default 128-token benchmark.
The plugin also reads the adapter's tt_supported_decode_batch_sizes (the captured decode buckets); without it every decode step is padded to max_num_seqs. Declare the prepared buckets there and document the key in the serving contract.
Preserve larger-batch serving capability. The headline performance target is still batch-1 single-user latency, but the adapter must not assume max_num_seqs=1 or batch size 1 in cache allocation, page tables, scheduler inputs, sampling, async decode, or output formatting. Test serving up to 32 concurrent sequences when the target hardware, memory, and harness allow it. If 32 cannot run, record the largest tested value and the hard physical limit.
Before serving, follow serving stack setup: use the standalone
TT plugin and the upstream vLLM version its current instructions recommend. Reuse the pair that
$full-model recorded for its serving contract check. Keep the selected pair and its source
provenance in the run record.
Before writing adapter code, read the pinned plugin's model interface guide (currently
docs/MODEL_INTERFACE.md) and the documents it links, and load
doc/full_model/serving_contract.json. If that file is missing, write it first as
$full-model describes; the stage gate requires it. Declare only model_capabilities keys
that the pinned plugin documents, and declare each value only with evidence that the model
meets it.
tt/generator_vllm.py should delegate to the existing generator's low-level methods. Keep adapter-only code limited to vLLM interface translation.
Read:
tech_reports/LLMs/vLLM_integration.md;models/tt_transformers/tt/generator_vllm.py;tt/generator.py low-level prefill_forward and decode_forward methods.vLLM owns KV-cache allocation in serving mode. Preserve the generator's two cache ownership modes:
allocate_vllm_kv_cache creates the cache and the adapter passes that exact cache through the low-level API.Not every cache must be vLLM-owned. vLLM owns the attention KV cache, but recurrent / linear-attention state of constant size (for example conv windows or SSM / gated-delta recurrent state) can live inside the model and be carried across decode steps there, rather than being modeled as a vLLM KV cache. For attention itself, route sliding-window and full-attention layers through vLLM's hybrid attention infrastructure (per-layer KV-cache specs and block tables) instead of forcing a single uniform attention type across all layers.
Make prompt lengths, page tables, decode positions, batch dimensions, trace-side state, and on-device sampling explicit. The serving decode pass must drive the generator's traced decode path, not an eager-only fallback. When adding or debugging trace capture/replay, trace-safe inputs, or replay correctness for this adapter, use $tt-enable-tracing. Before accepting the adapter, run representative repeated serving replay with TT_METAL_TRACE_ALLOC_TRACKING=1 set in the server/worker environment before TTNN is imported. Alternate the trace keys and request patterns that share persistent inputs/outputs, and resolve every unsafe allocation under the target tt-metal checkout's tech_reports/AdvancedPerformanceOptimizationsForModels/TraceCorrectness.md. The adapter should not duplicate model logic that already lives in tt/model.py or tt/generator.py.
Use the generator-owned two-phase warmup and trace lifetime rule from $tt-enable-tracing. vLLM callbacks must not be the only entrypoint that enforces warmup. Paged-attention program keys include the KV-cache tensor shape, so in vLLM mode warmup and capture run over the served cache allocation, not over a generator-owned or test-sized pool; a generator that warms on its own pool and captures on the vLLM cache compiles inside the first capture. Run the mixed-shape trace reuse check on the same server.
For decode performance, implement the vLLM async split before advertising it: decode_forward(..., read_from_device=False) should return device tensors, read_decode_output(..., async_read=True) should perform the minimal deferred read, and process_decode_output_host(...) should do host formatting. Only set supports_async_decode=True after this path passes the vLLM plugin's expectations with decode trace enabled and stale-token/current-position tests passing.
When async decode, on-device sampling and tracing are enabled, vLLM may submit step
N+1 before sampled token N reaches host scheduler state. Reuse the device token and
position state for steady decode; advance it exactly once per emitted token. Account
for transitions between the model's traces. On a steady step the plugin's start_pos
argument can lag the device position by one, so any adapter state derived from position
(page-table redirects, position-dependent tables) comes from device-owned or
generator-mirrored positions; treat the argument as advisory. The plugin overlaps decode
only when vLLM runs with --async-scheduling; the packaged runner does not pass it, so
add it through --additional-server-args and record it, or the declared async split is
never exercised. Prove the overlapped path with a served greedy-determinism check: the
same prompt repeated under concurrent load returns identical tokens on every run.
reset_batch=False does not prove the page table is unchanged. Inspect the pinned
standalone plugin's state updates and decode-reload contract; behavior depends on that
revision. Do not retain a workaround solely because an old fork needed it.
Before enabling overlap, verify that the selected vLLM revision invalidates or refreshes device page tables when active requests gain blocks. A reset that reloads host tokens or positions must first drain pending decode results. A page-only refresh is acceptable only with evidence that it preserves token and position state. Empty new-block lists must not force a refresh on every token. If the pinned revision lacks this behavior, compare it with the plugin's documented decode-reload contract. When the adapter does not meet that contract, fix the adapter. When the plugin violates its own contract, fix the plugin only with a complete plugin changes record. Until then, keep overlap disabled and do not report the async path as complete.
Validate automatic allocator-driven page growth across multiple page boundaries, with
several distinct concurrent requests and a trustworthy non-overlapped control. Check
request reordering, pending-token handling and unchanged-table steady decode. A test that
manually forces reset_batch=True, changes only an unused page, or checks only for
degenerate text does not establish page-table correctness.
Prefix caching is required unless one of the two documented exclusions in prefill features applies (block_output, or recurrent_state for models whose linear-attention or recurrent state cannot be rebuilt from KV blocks); an excluded model records the exclusion in its serving contract row and skips the resume check and the prefix_cache stage. Otherwise declare model_capabilities["supports_prefix_caching"] = True and serve with --enable-prefix-caching once the generator meets the continuation contract in that document: a cache hit arrives as start_pos equal to the cached length over the request's own page table, the same path chunked prefill and preemption resume use. Prove it twice: the generator-level resume check (run_prefill_resume_check, with its negative controls failing) and the served prefix_cache readiness stage (hit counters from /metrics, warm/cold TTFT, first-token agreement, shared-prefix hit rate), with the sampling and qualitative stages run against the same caching-enabled server. The only accepted reasons to declare False are the two exclusions in that document, named in the serving contract row. A pinned plugin that vetoes or breaks caching for a model that meets the contract is a plugin_owned row, not a reason to declare False. Do not add a capability key, environment variable, or --additional-config option to gate it.
The plugin submits every admitted request in one prefill_forward call. Run the dense work once for all short rows instead of looping the full decoder per row; prefill features gives the equal-padded and packed-row designs, the warmup rule, and the gates. Prove batched equals solo at the generator level, then run the prefill_burst readiness stage with batched prefill off and on and record the TTFT ratio. Stage 9 reports the burst ratio as advisory; Stage 10 requires it, with single-user latency unchanged.
The existing supports_async_decode declaration gates overlap. Declare it True only with the evidence above. Leaving overlap disabled may cost a few tokens/sec/user; enabling it without proof can silently corrupt generation. Do not add a plugin capability, environment variable, or --additional-config option to gate overlap.
The traced serving decode path reuses the full-model generator's canonical split-sampling path and replays via ttnn.execute_trace(..., blocking=False). For sample_on_device_mode=all, serving has no new sampling strategy, host greedy/top-1 argmax, full-logits readback, generic top-k fallback for greedy, or Python readback/writeback token-feedback loop. If the full-model generator lacks split sampling, stop and fix $full-model; do not complete vLLM by patching sampling in the adapter. Do not copy a full page table every token when it is unchanged. Reduce token/current-position/page-table refresh to actual scheduler state changes, then prove both changed and unchanged cases with stale-input tests.
The packaged serving runner uses --additional-config with a {"tt": ...} JSON
object. Verify this against the selected upstream CLI and plugin config reader. It accepts P300x2 for a Blackhole
QuietBox 2 (1 x 4 chips). Do not patch vLLM to accept the obsolete --plugin-config
flag or wrap the runner to modify its mesh choices. When changing the vLLM revision,
check its argument parser and TT config reader before serving.
Do not debug vLLM by repeatedly launching the complete all-layer model. First make the adapter work on the smallest representative serving target: the same generator, same generator_vllm.py, same plugin registration, same cache/page-table shapes, same terminal norm/LM head/sampling path, same trace behavior, and one real layer of each unique layer kind. Use that reduced target to make server launch, trace capture/replay, async split, vLLM cache ownership, on-device sampling, token/current-position/page-table refresh, and stale-input tests pass. Include a multi-request smoke test after the batch-1 path works, so batch/cache/page-table bugs are caught before the all-layer run.
The reduced target is only an inner-loop tool. It is not final serving evidence, and it must not be reported as the model's accuracy or performance. After the reduced target passes, run the complete all-layer model for the final accuracy, qualitative, sampling, and benchmark evidence.
Run checks from smallest to largest. If a vLLM pytest, prompt, request, or benchmark shape fails, rerun that failing item directly against a live server while debugging; do not rerun the whole suite after every edit. If a check suite is slow, run --sampling-profile smoke or a single targeted request first, then rerun the full profile once the issue is fixed.
Extend the existing serving smoke run with a short sequence derived from the affected shape and memory paths. Reuse the live server: complete prefill and decode to warm traces and collectives, submit a previously unseen valid shape, then repeat known shapes. Include the boundary/tail cases selected for changed paths; a fresh-process single request cannot establish behavior after decode allocations or across requests.
Record request completion and available device-memory/cache counters before and after the sequence. Distinguish bounded compilation/cache warmup from retained request-local allocations: repeats should stabilize, and per-shape growth needs an ownership and capacity explanation consistent with the advertised input range. If counters are not available, inspect allocation/cache ownership and record the limit of the evidence; successful requests alone do not prove stable memory use.
Keep this within the existing smoke run, aiming for minutes of additional requests, not a separate all-layer startup or default soak. Expand only for unexplained growth, errors, or uncovered affected paths; use an isolated op/layer repro to investigate. A time budget ending before required checks complete is incomplete evidence, not a pass. Preserve final all-layer serving evidence and the existing acceptance gates.
Include this check in Stage 9 serving evidence. Repeat it after Stage 10 optimization changes the trace or scheduler path. Use the existing live server and the request-lifecycle check above.
Apply the trace lifetime rule: at most one capture per prepared execution signature and zero invalidations, retirements, evictions, or recaptures throughout the workload. Preserve traces captured before the workload as well as deferred first captures made during it. Do not restart the generator or reset counters between requests. Record shutdown releases separately. Apply the allocation-safety gate from $tt-enable-tracing and measure performance separately with tracking disabled.
Keep commands, workload details, trace events, and results under readiness_vllm/. Check for stale inputs and request contamination as well as recapture. The packaged serving runner does not yet automate this workload or validate its trace events. Use a targeted integration test until it does. Fixed-shape benchmark results or successful HTTP responses alone do not satisfy this check.
Register the model through the pinned standalone plugin's documented extension mechanism; see serving stack setup. Verify the resolved class is this experiment's adapter, including in engine subprocesses. An existing built-in architecture must not silently select a reference model instead. Do not add a built-in registration for the adapter to the plugin source when a runtime mechanism can select it; see plugin changes.
Use the shared runner:
python -m readiness_check.run_vllm_server \
--model-dir models/autoports/<model_name> \
--hf-model <hf-model-id-or-local-path> \
--mesh-device <N150|N300|P300x2|T3K|TG> \
--max-num-seqs <int> \
--max-model-len <int> \
--sampling-profile <full|smoke> \
--tt-config '{"trace_region_size": <bytes>, "fabric_config": <fabric mode>}'
The runner owns server launch, health polling, check execution, and shutdown. It writes server.log, sampling_tests.log, vllm_qualitative_outputs.json, primary single-user raw vllm_result.json, primary normalized vllm_benchmark.json, vllm_benchmark.log, and by default the secondary CI serving-burst files vllm_ci_serving_result.json, vllm_ci_serving_benchmark.json, and vllm_ci_serving_benchmark.log under <model_dir>/readiness_vllm/.
--stages accepts serve, sampling, qualitative, benchmark, prefix_cache, and prefill_burst. The default runs serve,sampling,qualitative,benchmark; add the last two for the required prefix-cache and batched-prefill evidence. Pass --enable-prefix-caching on launch, or --server-log when attaching to a hand-launched server, so the run summary records the prefix-caching state. Set VLLM_SERVER_DEV_MODE=1 in the server environment so /reset_prefix_cache exists; the prefix_cache stage needs it for cold references and the long-resume comparison. To hold a server open while iterating:
python -m readiness_check.run_vllm_server \
--stages serve \
--model-dir ... --hf-model ... --mesh-device ... [--max-model-len ...] [--tt-config ...]
To attach checks to an existing server from another shell:
python -m readiness_check.run_vllm_server \
--stages sampling \
--max-num-seqs <int> \
--sampling-profile <full|smoke> \
--server-url http://localhost:8000 \
--model-dir ... --hf-model ...
The sampling stage, like serve, rejects a plugin source layout the runner does not accept (a bundled or nested plugin checkout), even against an external server. On such a layout, run the plugin's sampling suite by hand with the runner's exact pytest command, record that command in the work log, and place the result file where the gate expects it; attach the other stages with --server-url and --server-log.
The runner enforces on-device sampling (sample_on_device_mode: all in the TT plugin config). The full-model stage must already provide traced token-out split sampling. If it does not, return to $full-model; this stage should only adapt that contract to vLLM.
If shared tests require host-side sampling, expose it as an explicit compatibility mode and label metrics from that mode separately. The optimized serving path still uses on-device traced sampling and sample_on_device_mode=all.
The served default recipe must stay on the device sampler. vLLM applies the checkpoint's generation_config.json sampling defaults to every request that does not override them; compare those defaults (top_k, top_p, temperature) against the declared max_device_top_k and the device sampler's real candidate width. The shared ttnn.sampling path draws from one 32-candidate tile per user whatever k says, so a declared ceiling above 32 can emit token ids outside the candidates. If the default recipe would route to the host sampler, either raise the device ceiling with a probe that proves the wider draw or serve with --override-generation-config and record that as an operator decision in the work log. During the sampling and burst stages, scan sampled token ids for out-of-vocabulary values and count host-sampled steps. Neither the plugin nor the packaged runner logs those counts, and vLLM kills the engine on shutdown before adapter teardown prints, so log a per-step sampling-mode line from the adapter during the run and summarize the server log afterwards; a measured path that silently fell back to host sampling is not the optimized path.
Runner notes: --additional-server-args is split with shlex, so a JSON value inside it needs its own quoting; the packaged runner writes to readiness_vllm/ by default and the gates read only that root; --output-dir sends an attached or tracked run elsewhere so it does not overwrite the gate's artifacts.
Do not collect Tracy, tt-perf-report, or TT_METAL_DEVICE_PROFILER metrics from vLLM integration or optimized-vLLM serving runs. Do not set profiler env vars for the live server, do not run python -m tracy around run_vllm_server, do not run a serving-adapter profile just to produce a profiler table, and do not call ttnn.ReadDeviceProfiler(mesh) as part of vLLM-stage closure.
The vLLM stages have repeatedly wedged T3K machines during profiler/device-health closure. The useful vLLM evidence is the serving-path evidence produced by run_vllm_server: sampling results, qualitative outputs, degenerate-output checks, server logs, primary single-user vllm bench serve JSON with TTFT, TPOT, ITL, aggregate output throughput, and the secondary CI serving-burst vllm bench serve JSON for vLLM-nightly parity and serving-capacity context. Use existing full-model or reduced non-serving profiles from earlier stages for device-op/root-cause context. If those profiles are missing, record that evidence gap; do not recreate them inside the vLLM stage.
For optimized-vLLM, optimize with same-harness primary single-user and secondary CI serving-burst before/after metrics plus contract checks: async split, nonblocking trace replay, stale input coverage, on-device sampling, no host greedy argmax, no full-logits readback, and no unnecessary page-table/token/current-position refresh. Do not require Tracy, tt-perf-report, or live-serving device-profiler artifacts for vLLM-stage completion.
Check stages:
sampling: runs the canonical TT plugin pytest suite against the live server. --sampling-profile full runs the whole suite; --sampling-profile smoke runs a small integration sanity subset for slow bring-up loops.qualitative: saves greedy and sampled completions for prompts from ${TT_MODEL_BRINGUP_ROOT}/runtime/readiness_check/vllm_prompts.txt; use $qualitative-check to ensure the prompts are sent in the HF-declared model format, compare against controls, and judge coherence, topic, repetition, gibberish, and wrong-language drift.benchmark: runs the primary single-user decode profile by default: 128-token input, 128-token output, one prompt, --max-concurrency 1, ignore_eos, percentile metrics ttft,tpot,itl,e2el, and a completed-prompt gate. Use vllm_benchmark.json for headline decode t/s/u and comparisons to full-model or older agentic/custom-benchmark reports. This is the primary optimization target.prefix_cache: sends one ~2300-token prompt cold, warm, warm, resets the prefix cache, and repeats; reads prefix-cache counters from /metrics around each request, records TTFT, first-token logprob and greedy output, runs the shared-prefix vllm bench serve workload, and writes prefix_cache_check.json with the verdict defined in prefill features. Every run also writes vllm_run_summary.json.prefill_burst: runs 32 x 128-token prompts at concurrency 32 so the scheduler forms multi-row prefill steps and writes vllm_prefill_burst_benchmark.json; pass --prefill-burst-serial-result with the same workload measured with batched prefill disabled to record the TTFT ratios the gate reads.benchmark: also runs the vLLM-nightly-shaped CI serving-burst profile by default: 100-token inputs, 100-token outputs, 32 prompts, no explicit --max-concurrency, ignore_eos, and the same metric set. Use vllm_ci_serving_benchmark.json for vLLM-nightly parity, serving-capacity context, and larger-batch/concurrency coverage. Do not use it as the headline decode t/s/u because burst admission and chunked prefill can affect TPOT. The readiness runner passes --temperature 0.0 by default so both benchmark profiles are greedy. Use --benchmark-use-server-generation-config only when intentionally reproducing exact nightly/server-generation-config behavior, and label those numbers as sampled/default-generation-config rather than greedy single-user t/s/u.When optimizing decode serving overhead, benchmark with the exact same runner, prompt/output lengths, max_num_seqs, model length, mesh, TT config, and sampling mode as the primary or previous comparison. Report raw vLLM median_ttft_ms/p99_ttft_ms, mean_tpot_ms/p99_tpot_ms, median_itl_ms/p99_itl_ms, output_throughput, and TPOT-derived decode t/s/u (1000 / mean_tpot_ms) before/after. Compare primary single-user 128/128/1 against primary single-user 128/128/1, and compare CI serving-burst 100/100/32 against CI serving-burst 100/100/32; do not treat those two workload shapes as direct perf verdicts against each other.
Keep teacher-forcing and serving performance separate. A readiness/PERF teacher-forcing number is useful as a decoder/generator lower bound; vLLM throughput includes serving orchestration, sampling, token feedback, request handling, and readback. If serving is much slower than teacher forcing, remove avoidable serving-specific overhead before retuning the decoder stack: fallback sampling, stale-input refreshes, per-token page-table copies, blocking trace replay, synchronizations, readbacks, and adapter-side reconstruction.
--max-num-seqs is passed to both server launch and sampling pytest (--tt-max-num-seqs). Do not leave it at 1 except for the primary single-user benchmark or a focused debugging run. Final serving evidence should include a larger value, normally up to 32, unless hardware or memory capacity prevents it.
For final vLLM-integration evidence, use --sampling-profile full. The normal debugging order is smoke first, then full: use --sampling-profile smoke for faster inner-loop iteration, rerun only failing pytest node ids or targeted requests while fixing failures, and run --sampling-profile full after the smoke and targeted checks pass. For MoE bring-up loops where the full profile is impractical, record the final status as smoke-gated; do not present it as equivalent to the full sampling gate unless the project owner explicitly accepts that coverage.
When determinism tests fail in vLLM, validate that logits output by the model for a given prompt are reproducible across runs and batch positions. Check both standalone model and running through vllm.
Classify reproducibility-only sampling failures separately when they are the only failures. Typical names include test_top1_is_greedy, test_topk, test_uniform_seed_deterministic, test_specific_seed_reproducible, test_same_seeds_reproduce_across_batches, test_*_mixed_batch, and test_mixed_params_batch. They do not require more serving-correctness work only when correctness, logprobs, crash-free serving, and qualitative output all pass. Correctness failures, missing logprobs, crashes, gibberish output, or wrong logprob values remain required work. A seeded request must not change sampler mid-request; the plugin routes per step, so a host-only parameter joining the batch (a top_k above max_device_top_k) moves every later step of that batch to the host and offsets the seeded streams. Record such failures as routing defects with the admission pattern as evidence, not as model defects.
When a plugin test fails because the device sampler lacks a request feature, such as logprobs, penalties, or a top-k range, fix the generator sampling path that $full-model owns. A documented model_capabilities declaration that routes such requests to host sampling is acceptable only when it states a real support boundary of this model and doc/full_model/serving_contract.json records that boundary. Do not add a routing capability or weaken a plugin test to make the suite pass. The common sampler's precompile skips the output-count update, so a warmup through its API leaves the penalty scatter path uncompiled and the first penalties-on capture fails; run one counted sampling pass before capture.
If vLLM crashes mid-run, kill leftover EngineCore or vllm.entrypoints processes before retrying; they can hold chip locks after tt-smi -r.
If a profiler run is accidentally started and fails, do not escalate it into repeated watcher/profiler/reset attempts. Kill leftover server processes. If tt-smi -ls --local or reset hangs, or if logs show remote Ethernet/ARC/ERISC failures such as Timeout waiting for Ethernet core service remote IO request, ETH core heartbeat check failed, Unexpected ERISC Response Flags, Read 0xffffffff from ARC scratch, or ARC lock/readback waits, stop profiler work, preserve the logs, mark the profiler evidence hardware-profiler-limited, and follow $tt-device-usage reset recovery before treating the stage as stopped. Request monitor/operator reboot only after bounded reset/list and mesh-smoke recovery fail or require authority this agent does not have.
Transient CCL/fabric link errors immediately after a failed multi-device run still need a device reset and one retry before being treated as hardware evidence, as long as tt-smi remains responsive and the failure is not part of the profiler/watcher pattern above.
Failed serving gates, missing serving artifacts, sampling failures, qualitative-output failures, and $stage-review more-work-needed findings are vLLM-stage work, not terminal stop reasons. If logs make the cause obvious, fix it directly and rerun the failing gate. If the first direct fix does not close the gate, or if the failure crosses the adapter, generator, cache ownership, scheduler inputs, trace inputs, sampling, or plugin registration path, use $autofix; it will run $autodebug if needed, then verify or refute each proposed bug before keeping any fix. Plugin fixes that $autofix proposes follow plugin changes. Do not terminal-stop the vLLM stage until $autofix has tried and failed, an external dependency is genuinely unavailable, or a required plugin change needs human authorization and its proposal is recorded.
Record the working server invocation in the work log, including --max-model-len, --tt-config, workload config, and any env vars that mattered. Use typed runner flags for --max-model-len and --tt-config; keep --additional-server-args for uncommon flags only.
Before classifying any serving-output problem as a model-quality limitation, use $qualitative-check to produce matching prompt-correct evidence from HF, or at minimum from the full-model stage on comparable prompts. If serving output is materially worse than the prompt-correct control, that is a serving regression and in scope for this stage - stale trace inputs, sampler state, and cache/position handling are the usual causes, not the checkpoint. If the shared readiness runner cannot send the correct prompt format, fix it or add a targeted prompt-correct request before judging output quality.
After qualitative collection, run:
python "${TT_MODEL_BRINGUP_ROOT}/runtime/readiness_check/check_degenerate_output.py" \
--hf-model <hf-model-id> --missing-artifacts critical --scope vllm
Mechanical degeneracy - doubled tokens, single-token collapse - is never a model property. The runner-side stage gate runs the same check.
If the tokenizer has no chat template, say so explicitly, treat the checkpoint as a base model, and judge the qualitative outputs against continuation-style expectations; do not let chat-style prompts produce poor text that masks serving bugs.
Done means all of these are true and recorded:
run_vllm_server invocation.doc/context_contract.json, with any hard-physical-limit reduction evidence.max_num_seqs up to 32 and any hard-physical-limit reduction evidence.supports_async_decode=True, and on-device sampling verified for the measured mode. Every declared model_capabilities key is documented by the pinned plugin.supports_prefix_caching=True with readiness/prefill_resume_check.json (controls failed), readiness_vllm/prefix_cache_check.json (status pass), readiness_vllm/vllm_run_summary.json showing the server enabled it, and sampling and qualitative verdicts from the caching-enabled server; or a serving-contract row naming a documented exclusion; or a plugin_owned row with its justification record when the pinned plugin blocks it.readiness_vllm/vllm_prefill_burst_benchmark.json with its serial_reference ratios.doc/vllm_integration/plugin_changes.md entry for each local change, as plugin changes requires.tt_out_tok feedback into the persistent decode token input, greedy benchmarks using the fastest correct on-device sampling strategy measured for this mesh, and stale-token/current-position smoke coverage.$qualitative-check artifacts: qualitative greedy and sampled serving-output verdict, prompt-format metadata, rendered prompts or token ids, and matching HF/full-model controls.vllm_benchmark.json.vllm_ci_serving_benchmark.json when comparing to vLLM nightly or serving-capacity evidence.Produce:
models/autoports/<model>/tt/generator_vllm.py
models/autoports/<model>/doc/vllm_integration/work_log.md
models/autoports/<model>/doc/vllm_integration/README.md
The README should lead with vLLM sampling status, qualitative verdict, primary single-user 128/128/1 TTFT median, TPOT mean, ITL median, aggregate output throughput, and TPOT-derived decode t/s/u. Put CI serving-burst 100/100/32 metrics in a secondary section for vLLM-nightly parity and serving-capacity context. Include the workload config next to every number.
| Topic | Path |
|---|---|
| vLLM integration guide | tech_reports/LLMs/vLLM_integration.md |
| vLLM server integration runner | ${TT_MODEL_BRINGUP_ROOT}/runtime/readiness_check/run_vllm_server.py |
| vLLM qualitative prompts | ${TT_MODEL_BRINGUP_ROOT}/runtime/readiness_check/vllm_prompts.txt |
| Generator contract | ${TT_MODEL_BRINGUP_ROOT}/runtime/readiness_check/contract.py |
| tt_transformers generator | models/tt_transformers/tt/generator.py |
| Thin vLLM adapter | models/tt_transformers/tt/generator_vllm.py |
| vLLM model registration | Standalone plugin registration; see stack setup |
| Plugin model interface and capabilities | Pinned plugin checkout, currently docs/MODEL_INTERFACE.md and the documents it links |
| Plugin and vLLM changes | plugin changes |
| Prefix caching and batched prefill | prefill features |
| Resumed-prefill check | ${TT_MODEL_BRINGUP_ROOT}/runtime/readiness_check/run_prefill_resume_check.py |
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub tenstorrent/skills --plugin tt-model-bringup14 skills in this plugin
/benchmark-modelReport a text model's accuracy on fixed lm-eval subsets and 4K-input vLLM serving performance at concurrency 1 and 32. Use after optimized-vLLM for the final model-bringup report or to benchmark a supported model./datatype-sweepSweep and select TTNN model weight, activation, KV-cache, CCL datatype, and compute-fidelity policies for the fastest configuration that satisfies minimum full-model top-1 and top-5 accuracy. Use after optimized-full-model and before vLLM, or whenever a runnable TTNN full model needs evidence-backed precision selection./full-modelBuild a complete TTNN autoregressive model and generator from a HuggingFace model plus one or more working TTNN block or decoder implementations. Use when assembling embeddings, block stack, final norm, logits, KV-cache handling, and generation into a full model, validating end-to-end behavior, and reporting full-model accuracy plus generator-level performance. Repo-specific file contracts belong in a project orchestration skill such as model-bringup.Other plugins' skills for the same job