This guide covers the native SGLang/SGLang-Omni deployment of Invoker-Render, the causal four-step streaming model of Code World Model 2.0: environment preparation, model assets, streaming sessions, file inference, and browser access. It runs the released checkpoint with one fixed recipe and topology, and the service reports the model as invoker-render.
中文概述:本文说明 Invoker-Render(Code World Model 2.0 的因果四步流式模型)的环境、模型资产、流式服务、文件推理与浏览器部署。推理使用发布 checkpoint 的唯一 recipe 与部署拓扑。运行时保留 H3 架构名及 cwm_* 字段,以兼容 checkpoint 与协议;项目介绍见中文首页。
Use a compatible Linux NVIDIA CUDA environment and Python 3.11 or 3.12. The production topology requires eight GPUs on one node. Measured GPU memory with the released FP32→BF16 weights is ~81–84 GiB/GPU after load and ~86–93 GiB/GPU during inference, so plan for eight ≥96 GiB GPUs (e.g. H200 / B200). The state reservation is a deployment budget, not a minimum GPU-memory specification.
Provision the serving environment against the vendored SGLang package manifest and Omni package manifest. These describe a multi-model runtime, not a minimal Invoker-Render-only installation. Preserve Omni's resolver overrides. In particular, do not combine incompatible cache-dit requirements from SGLang's optional diffusion extras and Omni, or bypass resolution with --no-deps.
There is no standalone minimal lockfile for this application. SGLang and Omni share dependencies with a broader multi-model runtime, so installing their extras independently can produce conflicting requirements. Resolve the target environment before deployment and verify the installed packages with the checks below. Editable builds must use the SGLang version required by Omni's manifest; this repository's Git revision is not an upstream package version.
Run the tools through invoker_render.py at the repository root so the vendored sources take precedence over unrelated installations (including in spawned workers) and the interpreter's bin/ directory is added to PATH. SGLang JIT kernels (such as custom_all_reduce) also require ninja, a C++ compiler (g++), and nvcc (CUDA_HOME). Each command forwards its options to a module under src/sglang/projects/minimax_h3/tools/:
| Command | Tool module |
|---|---|
prepare |
prepare_omni_h3 |
serve |
serve_omni_h3 |
infer |
infer_omni_h3 |
web-adapter |
serve_omni_h3_web |
web |
serve_web |
check-env |
check_omni_installed_requirements.py |
PY=/path/to/serving-env/bin/python
"$PY" -m pip check
"$PY" invoker_render.py check-envThe checker reports dependency and platform conflicts, including explicitly handled compatibility exceptions. Resolve missing packages and unexpected conflicts in the serving environment; do not edit installed package metadata to hide them. Dependency checks do not establish CUDA-kernel or driver compatibility.
For CUDA 13 wheels, make the installed runtime/JIT libraries discoverable before worker startup:
NVIDIA_LIB=$("$PY" -c 'import sysconfig; print(sysconfig.get_paths()["purelib"] + "/nvidia")')
export LD_LIBRARY_PATH="${CUDA_COMPAT_LIB_DIR:+$CUDA_COMPAT_LIB_DIR:}$NVIDIA_LIB/cu13/lib:$NVIDIA_LIB/cudnn/lib:$NVIDIA_LIB/cusparselt/lib:$NVIDIA_LIB/nccl/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"CUDA_COMPAT_LIB_DIR, if required, must point to a forward-compatibility library approved for the actual driver/GPU. Library paths do not make unsupported hardware compatible. The production decoder uses the vendored FA3 kernel (SM90+); pass --decoder-spatial-attention fa2 to prepare to select the FA2 path, which instead requires a working flash_attn_varlen_func installation. CPU tests cannot establish CUDA-kernel compatibility.
Inference needs three model releases. The selected files total about 216 GB: 132 GB for the Invoker-Render DiT (FP32), 77 GB for the Ref2VA components (mostly the text encoder) and 6.5 GB from StreamRender-H3. Download them with hf (from huggingface_hub); the commands below fetch only the files the runtime reads.
| Release | Used for | Files |
|---|---|---|
| inclusionAI/invoker-render-1.0 | The causal streaming DiT | config.json, diffusion_pytorch_model*.safetensors* |
| MiniMaxAI/MiniMax-H3 | Ref2VA text encoder, processor and video VAE; the VAE encodes the first image and, by default, the proxy | Ref2VA/{text_encoder,processor,video_vae}/, Ref2VA/model_index.json |
| Efficient-Large-Model/StreamRender-H3 | Causal ViT decoder for streaming output, and the optional TAE proxy encoder | causal_decoder/, configs/runtime.json, tae/ |
MODELS=/assets
hf download inclusionAI/invoker-render-1.0 --local-dir "$MODELS/invoker-render-1.0" \
--include 'config.json' 'diffusion_pytorch_model*'
hf download MiniMaxAI/MiniMax-H3 --local-dir "$MODELS/MiniMax-H3" \
--include 'Ref2VA/model_index.json' 'Ref2VA/text_encoder/*' 'Ref2VA/processor/*' 'Ref2VA/video_vae/*'
hf download Efficient-Large-Model/StreamRender-H3 --local-dir "$MODELS/StreamRender-H3" \
--include 'causal_decoder/*' 'configs/runtime.json' 'tae/*' 'LICENSE*' 'NOTICE'MiniMax-H3 and StreamRender-H3 are distributed under the MiniMax H3 Community License Agreement. Accept its terms on each model page before downloading. The bidirectional_lora/ folder in the Invoker-Render release is not used for streaming inference.
The runtime ships the contract of the released checkpoint. prepare writes it into every bundle, and none of it is a command-line option:
- Recipe:
configs/recipes/omni-h3-cwm.json, protocolcwm_causal/v1, position policycwm_frame_aligned_v1. - Four deterministic Euler steps, shift 12, on the fixed-history H3 stream: a nine-latent bootstrap, then five-latent chunks, with segment boundaries at latents 45 and 70.
sink_latents=1andrecent_latents=12: the first latent's proxy and clean video stay pinned as the attention sink next to the twelve most recent latents; proxy and clean history share one cache.- A 47-latent RoPE reference controls long-stream static-position shifts. Proxy and target rows for the same frame share coordinates; the reference is not a proxy/target time offset. When the shift changes, the static prefix (text, first image, sink) is recomputed.
- System prompt:
configs/system_prompt.txt, the fixed instruction used in training. File inference and the browser client send it by default. Other prompts are accepted by file inference but fall outside the trained contract. - Canvas: 1344×768 first image and output; 448×256 proxy upload, resized once with nearest neighbour to 1344×768 before encoding. No crop is introduced.
- Encoding: the MiniMax-H3 Ref2VA video VAE in BF16, posterior mean, no sampled noise. The first image reaches Qwen as a single image.
- Decoding: the StreamRender-H3 causal ViT decoder, which emits frames as each latent chunk completes.
- Weights: the Diffusers-layout FP32 shards load as released. The loader converts Q/K/V and FFN layouts from the
_class_nameinconfig.json. AdaLN is evaluated offline because Diffusers exports do not carry the online AdaLN tables.
The production topology is fixed for eight GPUs on one node:
| Part | Placement |
|---|---|
| DiT | TP1 × Ulysses 8, FlashAttention, first-denoise/history fusion, lossless norm |
| Proxy encoder (E4) | Ranks 2/3/6/7, overlapped with decoding |
| Causal decoder (TP4) | Ranks 0/1/4/5, fast backend with FA3 spatial attention |
Decoder compilation and CUDA Graph capture stay off. They cut decoder latency but add minutes of cold start and depend on the exact toolchain, so the release does not enable them.
prepare checks that the three downloads are complete, then writes a small bundle directory: native-runtime.json (the contract above with absolute asset paths), the transformer config.json, and the decoder configuration extracted from StreamRender-H3. It does not copy or modify model weights. The output directory must not exist yet.
BUNDLE=/assets/invoker-render/bundle
"$PY" invoker_render.py prepare \
--weights "$MODELS/invoker-render-1.0" \
--h3 "$MODELS/MiniMax-H3/Ref2VA" \
--streamrender "$MODELS/StreamRender-H3" \
--output "$BUNDLE"--state-reservation-gib (default 48) is the GPU memory reserved for one streaming session; calibrate it for the workload. It is a deployment budget, not a minimum GPU-memory specification.
--proxy-encoder tae replaces only proxy encoding with the TAE from StreamRender-H3 (tae/taeh3_official.pth). The first image stays on the H3 VAE, and the recipe, DiT and decoder are unchanged. The encoder-group leader runs TAE and broadcasts its normalized 24-channel latents. Prepare a separate bundle when you compare the two encoders.
If the downloads move, run prepare again into a new directory. Bundles from earlier releases (schema h3_omni_native/v1) are rejected with a request to re-run prepare.
"$PY" invoker_render.py serve --model-path "$BUNDLE" --port 18860The service binds loopback. /v1/models reports the prepared model name. /v1/session provides the streaming session protocol. The bundle selects realtime execution, codec overlap and independent CPU RGB delivery. --no-codec-overlap turns overlap off for debugging, which also turns CPU delivery off.
Place the downloaded weights on fast local storage (NVMe) when possible: all eight ranks read from the checkpoints during startup (~4–5 minutes on local NVMe). On slower network storage, raise SGLANG_OMNI_STARTUP_TIMEOUT (default 600 seconds) before launching serve.
File inputs are a 1344×768 RGB first image (not RGBA) and a 448×256, 24 FPS proxy video. The prompt defaults to the frozen system prompt; --prompt-file overrides it. Input length is 17*N+5, with at least 39 frames. Preserve EOS and frame provenance rather than padding or cropping the source arbitrarily. To convert an existing image/clip to a valid 39-frame test input:
ffmpeg -i raw_first.png -vf scale=1344:768 -pix_fmt rgb24 /inputs/first.png
ffmpeg -i raw_proxy.mp4 -vf scale=448:256 -r 24 -frames:v 39 -c:v libx264 -pix_fmt yuv420p /inputs/proxy.mkv"$PY" invoker_render.py infer \
--model-path "$BUNDLE" \
--uri ws://127.0.0.1:18860/v1/session \
--first-image /inputs/first.png --proxy-video /inputs/proxy.mkv \
--seed 42 --output-dir /outputs/invoker-render-001The first chunks after a service start include warm-up; later chunks run at streaming speed. --timeout (default 900 seconds) bounds each session step rather than the whole run.
A completed run writes video.mp4 and inference.json. Check output-frame count, native EOS and close acknowledgement. Media FPS is not generation throughput. Matching seeds do not imply bitwise equality between live packet encoding and offline whole-video encoding; a local client receipt alone does not prove server-side checkpoint identity.
The native service is reused; the web adapter does not launch another DiT. Start the CPU media adapter first and wait until http://127.0.0.1:18861/health is listening, then start the browser gateway in another terminal (the gateway checks /health immediately on startup):
"$PY" invoker_render.py web-adapter \
--model-path "$BUNDLE" \
--native-uri ws://127.0.0.1:18860/v1/session --port 18861
"$PY" invoker_render.py web \
--backend http://127.0.0.1:18861 --port 18862 --incremental-proxyOpen http://127.0.0.1:18862/. Select a matching first image before generation. Stop and drain a session before changing scene. Browser recording and source-specific options are documented in the client guide. External games and their assets are opt-in and are not bundled.
For remote access, configure --public-url and a private --access-key-file together, and terminate HTTPS at a trusted proxy. Do not expose unauthenticated loopback services directly. A running native endpoint does not by itself validate browser playback or source/game alignment.
Native completion metadata uses the native_worker_monotonic clock and proxy_prepare, render, and codec stages, each with dispatch/completion timestamps and wall time. These are completion boundaries, not separately synchronized GPU-kernel profiles. Worker, server and browser clocks cannot be directly subtracted. Missing trace metadata remains valid for older producers, and splitting output packets does not create new compute samples.
For each deployment, check the returned model identity, accepted and delivered frame counts, native EOS, and session close acknowledgement. Review the resulting video as well: valid transport and timestamps do not establish perceptual quality. Benchmark generation speed separately from the 24 FPS media timeline, especially after changing parallelism or decoder settings.