Sglang model day0 support

From BBuf/AI-Infra-Auto-Driven-SKILLS · View interactive version

Sglang model day0 support is an AI agent skill from the GitHub repository BBuf/AI-Infra-Auto-Driven-SKILLS. 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 de

How to use this skill

Skill file

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.

Use the maintained source contracts

when applying historical evidence to a current branch. The review/history

corpora retain their own capture dates; they do not certify today's dispatch

or numerical defaults. For kernel replacements, verify that the real model

executes the candidate before treating end-to-end tests as coverage.

Start Here

  1. Read day0-contract.md completely.
  2. Copy assets/day0-bundle/ into the active model-support workspace.
  3. Lock immutable model, weight, tokenizer/processor, SGLang, dependency, and

image revisions before describing support.

  1. Read evidence-audit.md before citing PRs.
  2. If any input is non-public, read

sanitization.md before writing public output.

  1. Read only the relevant case study:

image-first release locks, linear extraction stacks and equivalence proofs.

KDA/MLA, VLM, DSpark, ReplaySSM, DCP, or dense internal-to-public delivery.

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.

unpinned object-store paths as release evidence.

performance lanes.

image layer, or documented external prerequisite.

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:

Use public model-family PR history when available. Do not infer support from a

shared architecture name alone. Map runtime ownership as well as model files:

current V4.1 separates mHC state/dispatch

from boundary wiring.

A Day-0 kernel replacement must preserve residual rewrites, row selection,

quantized-scale layout, graph-stream initialization and target/draft pool

ownership. Include fallback/guard-negative cases in the validation matrix;

a loaded model alone does not exercise the optimized path.

Check quantization formulas independently of the optimized writer's reference,

and test overlap-sensitive accuracy under actual concurrent execution. An

experiment's flags and results do not validate a port with different dispatch

conditions or numerical behavior.

3. Classify the work

Assign exactly one class:

satisfy an announced release lane.

previously claimed behavior.

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:

  1. shared public infrastructure;
  2. model config, loader, and eager correctness spine;
  3. state/cache and required parallel composition;
  4. protocol, speculative, and multimodal surfaces;
  5. platform-specific kernels or backends;
  6. images, cookbook, tests, and release wiring;
  7. 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:

behavior required by the model;

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:

  1. source;
  2. load;
  3. protocol;
  4. state;
  5. topology;
  6. quality/performance;
  7. 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.

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.

experiments/reverts separate.

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

evidence or refreshing a case study.

unreleased artifacts, or non-public environments are present.

Kimi K3 example and its hybrid/VLM failure boundaries.

public DeepSeek V4 example and its staged merge/backfill/repair pattern.

Completion Contract

Finish only when:

For image-first spines, lock the image digest/source commit while the branch is

unstable. Companion upstream skills: .agents/skills/cookbook-add-model/ and

.agents/skills/mechanical-refactor-verify/.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.