Skip to main content
Start with a shipped configuration that fits your hardware. Each entry in the model catalog gives the launch key, default YAML and GPU count. Use a copy of that YAML to change placement or memory limits.

Start a server

For Qwen3-Omni’s default two-GPU configuration, run:
In another terminal, wait for curl -fsS http://127.0.0.1:8000/health to return {"status":"healthy"}. The launcher prints its banner before loading weights. See cold start for typical timings and startup errors. To run a second deployment, give it its own GPUs and port. The launcher derives a separate socket directory from the port. Launch from a YAML file with mstar-serve.

Use a custom YAML

Copy the default for your model from configs/ in a checkout. For a wheel install, copy it from the installed package. For example, with Qwen3.5 9B installed:
The model: field in your YAML selects the model. Keep the positional launch key consistent with it so the startup examples match. To launch a YAML directly on one machine, use mstar-serve --config my_qwen.yaml --tensor-comm-protocol SHM. This lower-level command defaults to RDMA. CLI reference

Read a deployment config

model selects the implementation, node_groups assigns the model’s named components to workers, and max_seq_len is a required top-level key. Each KV cache has its own sequence limit. This single-GPU BAGEL config places all four components on rank 0:

Size a resource

Use the resource name the model declares. For example, Qwen3-Omni calls its Thinker cache thinker_kv. The following override sets its device and host page pools. An unknown resource name or field fails deployment validation. Qwen3-Omni config
A single-rank replica can reuse prefixes cached on that replica. To share prefix decisions across ranks in a TP group, set prefix_cache_tp: true and cpu_offload_pages: 0. All nodes and walks that use that pool must run in that one group. Replica routing Set prefix_cache: false on a cache to disable reuse, or send it in an individual request’s model_kwargs. Sliding-window caches cannot reuse prefixes. A model without a checkpoint identity needs a prefix_cache_salt to enable reuse. Resource declarations dtype, for example dtype: bfloat16, sets the dtype a resource stores in, or the dtype an attention plans its kernel in. Paged and ring KV caches, attention, cross-attention, ragged attention and lora accept it. The value is a torch dtype name such as bfloat16 or torch.bfloat16, and must be a float of 16 bits or more. fp8 and fp4 fail at load, since a quantized cache needs scales rather than a cast. FlashInfer and dense attention take float16 and bfloat16 only, so a float32 paged cache read through them fails at load. Without dtype, a resource takes the dtype the model declares for it, then, for an attention, its KV cache’s dtype, then the dtype its nodes compute in. A recurrent pool sets its state’s dtype with state_dtype instead. Resource dtypes

Set a node’s precision

The model gives each node a precision policy: the dtype its parameters are cast to, the modules kept in fp32, and whether its forward runs under autocast. Autocast is off unless the model turns it on. A nodes: block tightens the policy for one deployment:
The block can turn autocast off but not on, and add fp32 modules but not remove the model’s. It cannot set param_dtype on a node that keeps its build dtypes. Widening a tensor that the model allocates in a narrower dtype fails at load, because its weights would already be rounded. For example, param_dtype: float32 or an added fp32 module fails on a node whose model builds it in bfloat16 regardless of the policy. An unplaced node or an unknown key also fails at startup. The top-level autocast_dtype key is no longer read, and setting it fails at startup. Node precision

Bound concurrency and KV pressure

max_concurrent_requests limits admitted requests. At capacity, ordinary requests queue and an incoming live-input call receives 503. Set a positive cap appropriate to your prompt and output lengths. Separately, MSTAR_MAX_CONCURRENT_REQUESTS limits HTTP requests at the Rust frontend. Configuration · HTTP limits While a request is running, its KV pool may need pages that other requests hold. cpu_offload_pages gives the pool host space for preempted requests. Rebuildable requests can also release pages and recompute from saved input. Streaming output modalities listed in unpausable_outputs (default [audio]) reserve their footprint before starting. Watch queue time, page use and preemptions together. Metrics

Set the prefill token budget

max_batch_tokens limits the prompt tokens processed in one step on a node that supports chunking. This Qwen3.5 example applies one budget to all budgeted walks on LLM:
For a mixed prefill/decode walk, the combined walk’s budget caps the step. For example, Qwen3-Omni accepts Thinker: {thinker_mixed: 512} under max_batch_tokens. Sequence-parallel nodes with sp_size above one run whole prefills. Scheduling keys

Place workers

Each rank identifies a worker process. Unless rank_devices maps it elsewhere, rank n uses visible device n. Use the default topology first. Choose a different shipped config according to the resource you need to distribute.

Separate prefill and decode

Use graph_walks to assign a node’s prefill and decode work to different ranks. BAGEL’s disaggregated config places its prefill walks on rank 0 and its decoding and image generation on rank 1.

Split weights across GPUs

For a tensor-parallel node, list the distinct ranks in ascending order and set tp_size. The model must support TP for that node. In Qwen3.5 9B TP2, only the language model is sharded:

Split tokens or guidance branches

sp_size distributes tokens for a compatible node. cfg_size distributes classifier-free guidance branches. Each instance needs cfg_size × sp_size × tp_size ranks, with adjacent TP ranks. Wan2.2’s four-GPU config uses two sequence shards per guidance branch.

Replicate for concurrent requests

Supply enough ranks for several complete instances. In Qwen3.5 9B DP2, each GPU holds the entire model. The conductor chooses a replica using its current load and expected prefix-cache hit. Set routing_weights.prefix: 0 to route by load alone.

Distribute experts

On an EP-enabled node, ep_config: {parallel: ep} assigns whole experts to TP ranks while attention and dense layers stay tensor-parallel. The number of experts must be divisible by the group size. Qwen3-Omni Thinker EP2

Share a GPU between workers

Use rank_devices to place separate worker processes on one device. On NVIDIA, mps: true lets their kernels overlap and requires nvidia-cuda-mps-control on PATH. Give each worker a gpu_memory_fraction that leaves room for other workers, CUDA contexts and communication buffers. Qwen3-TTS split-worker config

Set model defaults

The YAML’s model_kwargs go to the model constructor. Use them for deployment-wide choices such as a checkpoint or camera count. Sampling options, output length and voice usually belong to the individual request. Model guides · Generation parameters

Authenticate clients

Both launchers bind 0.0.0.0 by default. For local use, pass --host 127.0.0.1. For bearer authentication, provide MSTAR_API_KEY in the server’s environment and send the same key with the client. An explicit --api-key overrides the environment, including an empty value. A missing or incorrect credential returns 401 on protected HTTP routes. The server warns at startup if authentication is disabled. Passing an empty --api-key after shell expansion turns it off even if the environment contains a key. With authentication enabled, protected WebSocket handshakes also require the key. The health, metrics and openpi health probes are public. The openpi socket also accepts Authorization: Api-Key <key>. A Dynamo deployment handles authentication at the Dynamo frontend or its gateway. HTTP routes

Choose tensor transport

For TCP or RDMA, install mooncake-transfer-engine>=0.3.13.post1. Mooncake does not authenticate peers. Each worker chooses its handshake and data ports at startup, so restrict network access to the worker hosts themselves. Only hosts in the deployment should be able to reach them. Before 0.3.12.post1, a host that could reach the TCP data port could read or write worker memory (CVE-2026-103764). Two denial-of-service issues on the handshake port remain open at the minimum version, 0.3.13.post1 (CVE-2026-103760 and CVE-2026-103761).

Select the HTTP frontend

The launcher normally starts mstar-server after worker setup and warmup. If a source checkout reports a missing or stale binary, follow the build command in the error. The Linux wheel installs the binary into the environment’s scripts directory. --rust-frontend-bin selects an explicit build. --python-frontend selects the deprecated FastAPI frontend. CLI options Reuse compiled kernels.

Profile one request

Start with --log-stats for a per-request timeline or --log-stats-file stats.txt to save it. The timeline measures wall time from input to delivery. Graph timings measure CPU work and launch time. Postprocessing may overlap the next step. For GPU waits and batch-wide costs, use the worker phase harness. For continuous monitoring, enable metrics. Scrape serving metrics. For example, this excerpt from a --log-stats timeline shows when the first output arrived and how long streaming continued.
The first chunk arrived 198.6 ms after receipt (62.6 + 2.3 + 133.7). Another 683.3 ms elapsed before the last chunk. The transfer section reports time spent reading or registering tensors on each edge. Those intervals can overlap the graph timings.

Tune CPU wakeup latency

If a profile shows gaps between short decode steps on an otherwise idle host, measure a representative workload before changing CPU affinity. step_thread_core controls thread placement. idle_hold: qos asks Linux to limit deep idle states and requires access to /dev/cpu_dma_latency. Engine knobs