SGLang Model Day-0 Support
Turn a model release into a reviewable SGLang support program. Produce evidence,
implementation boundaries, validation gates, and public release artifacts—not
only a launch command.
Start Here
- Read day0-contract.md completely.
- Copy
assets/day0-bundle/ into the active model-support workspace.
- Lock immutable model, weight, tokenizer/processor, SGLang, dependency, and
image revisions before describing support.
- Read evidence-audit.md before citing PRs.
- If any input is non-public, read
sanitization.md before writing public output.
- Read only the relevant case study:
- kimi-k3-case-study.md for hybrid
KDA/MLA, VLM, DSpark, ReplaySSM, DCP, or dense internal-to-public delivery.
- deepseek-v4-case-study.md for
compressed/sparse attention, SWA, mHC, MTP, large rebases, or staged
cookbook/image/mainline delivery.
Do not implement model code until the scope contract, architecture gap map, PR
DAG, and minimum validation matrix agree.
Workflow
1. Lock the release cut
Fill scope-contract.md and release-lock.md.
- Record full immutable revisions. Reject floating branches, mutable tags, and
unpinned object-store paths as release evidence.
- Name required hardware, precision, modality, serving topology, protocol, and
performance lanes.
- Separate Day-0 commitments from explicitly deferred work.
- Record dependency ownership: upstream package, SGLang patch, bundled wheel,
image layer, or documented external prerequisite.
- Treat unavailable weights or hardware as an explicit blocked lane, not an
implicit pass.
2. Build the architecture gap map
Compare the public model configuration/reference implementation with the locked
SGLang source. Inspect each capability family in the Day-0 contract.
For each gap, record:
- checkpoint/config field and expected tensor or protocol contract;
- closest SGLang implementation and why reuse is safe or unsafe;
- files/classes/functions expected to change;
- required fallback before any specialized kernel;
- evidence class and validation owner;
- interaction risks with state, graph capture, parallel layout, or protocol.
Use public model-family PR history when available. Do not infer support from a
shared architecture name alone.
3. Classify the work
Assign exactly one class:
day0-required: needed to load, serve, produce correct public API output, or
satisfy an announced release lane.
post-day0-fix: discovered after the release cut and required to restore a
previously claimed behavior.
performance-only: improves a supported path without defining correctness.
experiment-or-revert: unmerged, reverted, unreachable, or retained only as
a negative result.
If one patch mixes classes, split it or explain why atomic review is impossible.
Never promote an experiment merely because it exists on a development branch.
4. Design the PR DAG
Fill pr-dag.md. Prefer reviewable PRs with explicit dependencies:
- shared public infrastructure;
- model config, loader, and eager correctness spine;
- state/cache and required parallel composition;
- protocol, speculative, and multimodal surfaces;
- platform-specific kernels or backends;
- images, cookbook, tests, and release wiring;
- one umbrella integration PR only when the release branch requires it.
Require each node to name its merge gate, fallback, tests, and public evidence.
Avoid copying an entire development branch when a smaller auditable diff is
possible.
5. Build the validation matrix
Fill validation-matrix.md. Do not construct the full Cartesian product.
Always include:
- one eager load and deterministic short generation;
- weight mapping and quantization post-processing;
- chat, reasoning, tool, structured-output, streaming-split, and stop-marker
behavior required by the model;
- state allocation, prefix reuse, eviction, graph padding, and dtype/layout;
- required TP/DP/EP/CP/DCP/PP/PD/EPD roles;
- accuracy, memory capacity, and representative performance;
- one fallback-path test for each specialized backend.
Add risk pairs where two features rewrite the same state, tokens, graph,
collective, or transfer layout. Typical examples are speculative decoding ×
recurrent state, DCP × cache ownership, VLM × PD/EPD, DP attention × MoE
collectives, and CUDA Graphs × alternative streams.
6. Execute the seven gates
Execute the gates from the Day-0 contract in order:
- source;
- load;
- protocol;
- state;
- topology;
- quality/performance;
- release.
For every pass, retain the command, revision, hardware, result, and limitation.
For every failure, record whether it blocks Day-0, narrows the claim, or moves
to the follow-up ledger.
Do not use server startup as evidence for output correctness, state correctness,
topology composition, or performance.
7. Synthesize the public PR
Fill pr-body.md from reviewed evidence.
- Lead with the support contract and exact public status.
- Explain architecture deltas and implementation boundaries.
- Link public PRs and public source paths.
- Separate required support from optional fast paths.
- State tested hardware, topology, precision, modality, workload, and revision.
- Preserve known limitations and open work.
- For large rebases, include a conflict-decision ledger: upstream behavior,
model-branch behavior, chosen resolution, owner, and validation.
Run the public evidence collector only for mechanical metadata. Write
motivation, implementation, and limitations manually after reading the diff.
8. Track post-Day-0 work
Fill follow-up-ledger.md.
- Keep correctness repairs, performance work, platform extensions, and
experiments/reverts separate.
- Record which original claim each fix changes.
- Reopen a release gate when a fix invalidates its evidence.
- Mark default flips and reverts explicitly; do not rewrite history as if the
final default was always known.
9. Validate and sanitize
Run:
python3 scripts/validate_day0_bundle.py /path/to/day0-bundle
When private inputs exist, create an uncommitted denylist with one forbidden
literal per line:
python3 scripts/validate_day0_bundle.py \
/path/to/day0-bundle \
--denylist /path/to/uncommitted-denylist.txt
Collect public PR metadata when needed:
python3 scripts/collect_public_pr_evidence.py \
https://github.com/sgl-project/sglang/pull/23882 \
--output /path/to/public-pr-evidence.json
Inspect the generated JSON, then manually read the complete diff and final
mainline code. The JSON is an inventory, not a PR summary.
Reference Routing
- Read day0-contract.md for every invocation.
- Read evidence-audit.md before using PR
evidence or refreshing a case study.
- Read sanitization.md whenever private inputs,
unreleased artifacts, or non-public environments are present.
- Read kimi-k3-case-study.md for the public
Kimi K3 example and its hybrid/VLM failure boundaries.
- Read deepseek-v4-case-study.md for the
public DeepSeek V4 example and its staged merge/backfill/repair pattern.
Completion Contract
Finish only when:
- all eight bundle files validate without unresolved markers;
- every required capability has a pass, explicit limitation, or Day-0 blocker;
- every cited PR has a manual diff-reviewed card or a link to one;
- open, closed-unmerged, reverted, and experimental work is labeled correctly;
- public performance claims retain their public source and measurement scope;
- the release lock uses immutable artifacts;
- the sanitization report records the public-evidence and denylist results;
- the public PR body matches the actual release cut.
1---2name: sglang-model-day0-support3description: Build or audit an evidence-driven SGLang Day-0 support program for a new LLM, VLM, MoE, hybrid-attention, or speculative-decoding model. Use when Codex needs to map a model architecture into SGLang runtime work, design a public support PR DAG, create validation and release gates, sanitize private development evidence, distinguish Day-0 requirements from later fixes or optimizations, or review whether an existing model-support PR is release-ready.4---56# SGLang Model Day-0 Support78Turn a model release into a reviewable SGLang support program. Produce evidence,9implementation boundaries, validation gates, and public release artifacts—not10only a launch command.1112## Start Here13141. Read [day0-contract.md](references/day0-contract.md) completely.152. Copy `assets/day0-bundle/` into the active model-support workspace.163. Lock immutable model, weight, tokenizer/processor, SGLang, dependency, and17 image revisions before describing support.184. Read [evidence-audit.md](references/evidence-audit.md) before citing PRs.195. If any input is non-public, read20 [sanitization.md](references/sanitization.md) before writing public output.216. Read only the relevant case study:22 - [kimi-k3-case-study.md](references/kimi-k3-case-study.md) for hybrid23 KDA/MLA, VLM, DSpark, ReplaySSM, DCP, or dense internal-to-public delivery.24 - [deepseek-v4-case-study.md](references/deepseek-v4-case-study.md) for25 compressed/sparse attention, SWA, mHC, MTP, large rebases, or staged26 cookbook/image/mainline delivery.2728Do not implement model code until the scope contract, architecture gap map, PR29DAG, and minimum validation matrix agree.3031## Workflow3233### 1. Lock the release cut3435Fill `scope-contract.md` and `release-lock.md`.3637- Record full immutable revisions. Reject floating branches, mutable tags, and38 unpinned object-store paths as release evidence.39- Name required hardware, precision, modality, serving topology, protocol, and40 performance lanes.41- Separate Day-0 commitments from explicitly deferred work.42- Record dependency ownership: upstream package, SGLang patch, bundled wheel,43 image layer, or documented external prerequisite.44- Treat unavailable weights or hardware as an explicit blocked lane, not an45 implicit pass.4647### 2. Build the architecture gap map4849Compare the public model configuration/reference implementation with the locked50SGLang source. Inspect each capability family in the Day-0 contract.5152For each gap, record:5354- checkpoint/config field and expected tensor or protocol contract;55- closest SGLang implementation and why reuse is safe or unsafe;56- files/classes/functions expected to change;57- required fallback before any specialized kernel;58- evidence class and validation owner;59- interaction risks with state, graph capture, parallel layout, or protocol.6061Use public model-family PR history when available. Do not infer support from a62shared architecture name alone.6364### 3. Classify the work6566Assign exactly one class:6768- `day0-required`: needed to load, serve, produce correct public API output, or69 satisfy an announced release lane.70- `post-day0-fix`: discovered after the release cut and required to restore a71 previously claimed behavior.72- `performance-only`: improves a supported path without defining correctness.73- `experiment-or-revert`: unmerged, reverted, unreachable, or retained only as74 a negative result.7576If one patch mixes classes, split it or explain why atomic review is impossible.77Never promote an experiment merely because it exists on a development branch.7879### 4. Design the PR DAG8081Fill `pr-dag.md`. Prefer reviewable PRs with explicit dependencies:82831. shared public infrastructure;842. model config, loader, and eager correctness spine;853. state/cache and required parallel composition;864. protocol, speculative, and multimodal surfaces;875. platform-specific kernels or backends;886. images, cookbook, tests, and release wiring;897. one umbrella integration PR only when the release branch requires it.9091Require each node to name its merge gate, fallback, tests, and public evidence.92Avoid copying an entire development branch when a smaller auditable diff is93possible.9495### 5. Build the validation matrix9697Fill `validation-matrix.md`. Do not construct the full Cartesian product.9899Always include:100101- one eager load and deterministic short generation;102- weight mapping and quantization post-processing;103- chat, reasoning, tool, structured-output, streaming-split, and stop-marker104 behavior required by the model;105- state allocation, prefix reuse, eviction, graph padding, and dtype/layout;106- required TP/DP/EP/CP/DCP/PP/PD/EPD roles;107- accuracy, memory capacity, and representative performance;108- one fallback-path test for each specialized backend.109110Add risk pairs where two features rewrite the same state, tokens, graph,111collective, or transfer layout. Typical examples are speculative decoding ×112recurrent state, DCP × cache ownership, VLM × PD/EPD, DP attention × MoE113collectives, and CUDA Graphs × alternative streams.114115### 6. Execute the seven gates116117Execute the gates from the Day-0 contract in order:1181191. source;1202. load;1213. protocol;1224. state;1235. topology;1246. quality/performance;1257. release.126127For every pass, retain the command, revision, hardware, result, and limitation.128For every failure, record whether it blocks Day-0, narrows the claim, or moves129to the follow-up ledger.130131Do not use server startup as evidence for output correctness, state correctness,132topology composition, or performance.133134### 7. Synthesize the public PR135136Fill `pr-body.md` from reviewed evidence.137138- Lead with the support contract and exact public status.139- Explain architecture deltas and implementation boundaries.140- Link public PRs and public source paths.141- Separate required support from optional fast paths.142- State tested hardware, topology, precision, modality, workload, and revision.143- Preserve known limitations and open work.144- For large rebases, include a conflict-decision ledger: upstream behavior,145 model-branch behavior, chosen resolution, owner, and validation.146147Run the public evidence collector only for mechanical metadata. Write148motivation, implementation, and limitations manually after reading the diff.149150### 8. Track post-Day-0 work151152Fill `follow-up-ledger.md`.153154- Keep correctness repairs, performance work, platform extensions, and155 experiments/reverts separate.156- Record which original claim each fix changes.157- Reopen a release gate when a fix invalidates its evidence.158- Mark default flips and reverts explicitly; do not rewrite history as if the159 final default was always known.160161### 9. Validate and sanitize162163Run:164165```bash166python3 scripts/validate_day0_bundle.py /path/to/day0-bundle167```168169When private inputs exist, create an uncommitted denylist with one forbidden170literal per line:171172```bash173python3 scripts/validate_day0_bundle.py \174 /path/to/day0-bundle \175 --denylist /path/to/uncommitted-denylist.txt176```177178Collect public PR metadata when needed:179180```bash181python3 scripts/collect_public_pr_evidence.py \182 https://github.com/sgl-project/sglang/pull/23882 \183 --output /path/to/public-pr-evidence.json184```185186Inspect the generated JSON, then manually read the complete diff and final187mainline code. The JSON is an inventory, not a PR summary.188189## Reference Routing190191- Read [day0-contract.md](references/day0-contract.md) for every invocation.192- Read [evidence-audit.md](references/evidence-audit.md) before using PR193 evidence or refreshing a case study.194- Read [sanitization.md](references/sanitization.md) whenever private inputs,195 unreleased artifacts, or non-public environments are present.196- Read [kimi-k3-case-study.md](references/kimi-k3-case-study.md) for the public197 Kimi K3 example and its hybrid/VLM failure boundaries.198- Read [deepseek-v4-case-study.md](references/deepseek-v4-case-study.md) for the199 public DeepSeek V4 example and its staged merge/backfill/repair pattern.200201## Completion Contract202203Finish only when:204205- all eight bundle files validate without unresolved markers;206- every required capability has a pass, explicit limitation, or Day-0 blocker;207- every cited PR has a manual diff-reviewed card or a link to one;208- open, closed-unmerged, reverted, and experimental work is labeled correctly;209- public performance claims retain their public source and measurement scope;210- the release lock uses immutable artifacts;211- the sanitization report records the public-evidence and denylist results;212- the public PR body matches the actual release cut.