> ## Documentation Index
> Fetch the complete documentation index at: https://docs.m-star.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Launcher CLI

> Flags, defaults and exit codes for the model launcher, direct YAML launcher and Dynamo worker.

Use `mstar serve` for a shipped model key or an edited copy of its config. For an explicit YAML without a launch key, use `mstar-serve`. Their transport and upload-directory defaults differ. Run `--help` on the installed command to check the interface for your version. [Configure a deployment](https://docs.m-star.org/serving.md)

## mstar serve

```bash theme={null}
mstar serve <model> [options]
```

| Flag | Default | Meaning |
| - | - | - |
| `model` | required | Model key from [Supported models](https://docs.m-star.org/models.md). Required with `--config`. The YAML selects the model and the positional key selects startup examples. |
| `--host` | `0.0.0.0` | Address to bind. An exported `MSTAR_SERVER_HOST` wins over it on `mstar-server`. |
| `--port` | `8000` | HTTP port. |
| `--api-key` | `MSTAR_API_KEY`, else no check | Bearer credential. An empty value disables the check. [Public probes and auth](https://docs.m-star.org/serving.md#api-key) |
| `--gpus` | unchanged | Sets `CUDA_VISIBLE_DEVICES`, for example `0` or `0,1`. It sets no other variable. |
| `-O`, `--compile-level` | `MSTAR_COMPILE_LEVEL`, else `1` | Startup compile tuning, from `0` (shortest) through `2` (most tuning). [Compile levels](https://docs.m-star.org/cold-start.md#compile-levels) |
| `--config` | the model's default | Path to your own deployment YAML. The command exits if the path does not exist. |
| `--cache-dir` | Hugging Face default | Weight cache directory. |
| `--socket-path-prefix` | `/tmp/mstar_<user>_<port>/` | ZMQ IPC socket prefix. Use a distinct prefix per running server. A prefix already held by another deployment is refused. |
| `--upload-dir` | `/tmp/mstar_uploads_<user>/` | Temporary directory for uploaded media. |
| `--tensor-comm-protocol` | `SHM` | `SHM`, `TCP` or `RDMA`, in uppercase. `TCP` and `RDMA` need Mooncake ([Tensor transport](https://docs.m-star.org/serving.md#tensor-transport)). |
| `--tcp-transfer-device` | empty | Network device for the `TCP` transport, passed to Mooncake's transfer engine. Empty leaves the choice to Mooncake. |
| `--log-level` | `INFO` | `DEBUG`, `INFO`, `WARNING` or `ERROR`. |
| `--log-stats` | off | Print a profile of each request when it finishes ([Request profiling](https://docs.m-star.org/serving.md#request-profiling)). |
| `--log-stats-file` | none | Append the profiles to this file instead of stdout. Implies `--log-stats`. |
| `--enable-metrics` | off | Serve Prometheus metrics at `/metrics`. Needs `mstar-ai[metrics]` ([Metrics](https://docs.m-star.org/metrics.md)). |
| `--enable-nvtx` | off | Emit NVTX markers for CUDA profiling. Ignored on other devices. |
| `--timeout` | `600` | Per-request timeout in seconds. |
| `--python-frontend` | off | Serve HTTP from the deprecated uvicorn/FastAPI frontend instead of `mstar-server`. Cannot be combined with `--rust-frontend-bin`. |
| `--rust-frontend-bin` | lookup | Path to the `mstar-server` binary. Without it the launcher tries `MSTAR_SERVER_BIN`, the environment's scripts directory, `$PATH`, then `rust/server/target/release` ([Frontends](https://docs.m-star.org/serving.md#frontends)). |

Readiness begins with a successful `/health` response. [Startup sequence](https://docs.m-star.org/cold-start.md#startup-sequence)

## mstar-serve

```bash theme={null}
mstar-serve --config <yaml> [options]
```

The direct launcher reads the model from the YAML. Set `CUDA_VISIBLE_DEVICES` to select GPUs and `MSTAR_COMPILE_LEVEL` to set the compile level. It shares the other flags with `mstar serve`, with the differences below.

| Flag | Default | Meaning |
| - | - | - |
| `--config` | required | Path to the deployment YAML. |
| `--tensor-comm-protocol` | `RDMA` | `RDMA` needs Mooncake and an RDMA network. On one machine pass `SHM`. |
| `--upload-dir` | `/tmp/mstar_uploads` | Temporary directory for uploaded media, shared by every user on the host. |
| `--mooncake-port` | `8080` | Accepted and ignored. Mooncake picks its own ports. |

```bash theme={null}
mstar-serve --config configs/kokoro.yaml --tensor-comm-protocol SHM --port 8001
```

## Exit status

| Status | Meaning |
| - | - |
| `0` | Stopped with Ctrl-C. |
| `1` | A worker or the conductor died, or startup failed: an unknown model, a missing `--config` path, no usable `mstar-server` binary, `--python-frontend` with `--rust-frontend-bin` on `mstar serve`, or an uncaught error. |
| `2` | Bad arguments, such as a missing `model`, `--enable-metrics` without `mstar-ai[metrics]`, or `--python-frontend` with `--rust-frontend-bin` on `mstar-serve`. |
| `3` | `mstar-server` exited with an error, for example because it could not bind the port after the model loaded. Under `--python-frontend`, the uvicorn server never started. |

## Other entry points

| Command | What it does | Notes |
| - | - | - |
| `python -m mstar.cli.main serve <model>` | The same as `mstar serve`. | There is no `python -m mstar`. |
| `mstar-server` | The Rust HTTP frontend that the launcher starts. | Not meant to be run by hand: it takes positional arguments and reads its settings from environment variables the launcher sets. |
| `python -m mstar.integrations.dynamo --config <yaml> --model-path <dir>` | Serves a deployment as an NVIDIA Dynamo backend worker. | Needs `mstar-ai[dynamo]`. Flags in [Dynamo worker](#dynamo). |
| `python -m mstar.model.audio_watermark detect <files>` | Detect the AudioSeal watermark in audio. | Requires the `audioseal` extra and `soundfile`. Use `--help` for detection thresholds and device selection. |
| `python -m benchmark.eval <command>` | The evaluation and benchmark runner (`run`, `report`, `compare` and more). | Needs a source checkout, since `benchmark/` is not in the wheel. Install `mstar-ai[eval]` for it. See [Evaluation](https://docs.m-star.org/evaluation.md). |

## Dynamo worker

```bash theme={null}
python -m mstar.integrations.dynamo --config <yaml> --model-path <dir> [options]
```

The worker loads the deployment as `mstar-serve` does, runs its `warmup_requests`, and registers with the Dynamo runtime instead of serving HTTP. Dynamo's frontend then serves the OpenAI routes.

| Flag | Default | Meaning |
| - | - | - |
| `--config` | required | Path to the deployment YAML. |
| `--model-path` | required | Local Hugging Face snapshot directory that Dynamo's frontend builds the model card from. |
| `--served-model-name` | the config's `model` | Name the model registers under, which clients send as `model`. |
| `--namespace`, `--component`, `--endpoint` | `mstar`, `backend`, `generate` | The Dynamo endpoint, `<namespace>.<component>.<endpoint>`. Video, realtime and tensor surfaces register on the same name with `_videos`, `_realtime` or `_tensor` appended. |
| `--tensor-comm-protocol` | `RDMA` | As on `mstar-serve`. On one machine pass `SHM`. |
| `--socket-path-prefix` | a new `/tmp/mstar_<user>_*` directory | ZMQ IPC socket prefix. The default directory is removed at exit. |
| `--upload-dir` | `/tmp/mstar_uploads` | Temporary directory for uploaded media. |
| `--cache-dir` | Hugging Face default | Weight cache directory. |
| `--timeout` | `600` | Per-request timeout in seconds. |
| `--log-level` | `INFO` | `DEBUG`, `INFO`, `WARNING` or `ERROR`. |

Dynamo registers the routes declared by the model’s OpenAI adapter, or the tensor interface for `pi05` and `vjepa2_ac`. If neither is available, as with `command_a_plus`, the worker exits after loading. The Dynamo frontend owns authentication. The openpi policy socket requires the standalone launcher. [Adapter coverage](https://docs.m-star.org/reference/http-api.md#openai-coverage) · [Authentication](https://docs.m-star.org/serving.md#api-key)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.