> ## 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.

# World models and robot policies

> Choose a video rollout, embedding model or robot policy by the output your application consumes.

Choose by what the next stage consumes. These keys use the native M\* API and have single-GPU defaults.

| Input and result | Key |
| - | - |
| First image and actions → video frames | `waypoint` |
| Scene description, image and camera poses → video frames | `lingbot_world_1_3b` |
| Camera images, task and robot state → action chunk | `pi05` |
| Video → embeddings | `vjepa2` |
| Video and actions → predicted embeddings | `vjepa2_ac` |

## Install and start

The [Waypoint](#waypoint-install) and [LingBot](#lingbot-install) setup notes cover their external kernels and weights.

### `waypoint`

Image, actions → video frames. The default `waypoint.yaml` uses 1 GPU. The [weights](https://huggingface.co/Overworld/Waypoint-1.5-1B) use Apache-2.0.

Use pip 24.3 or newer (or uv 0.4.0 or newer) for the pinned TAEHV archive. Older installers can report success with an empty `UNKNOWN` wheel. See [Waypoint attention setup](#waypoint-install) for flash-attn-4.

```bash theme={null}
uv pip install --torch-backend=auto "mstar-ai[waypoint]"
uv pip install --torch-backend=auto --no-deps "taehv @ https://github.com/madebyollin/taehv/archive/7dc60ec6601af2e668e31bc70acc4cb3665e4c22.zip"
mstar serve waypoint
```

[Send the request](#waypoint-frames).

### `lingbot_world_1_3b`

Text, image, camera poses → video frames. The default `lingbot_world_1_3b.yaml` uses 1 GPU. The [weights](https://huggingface.co/robbyant/lingbot-world-v2-1.3b-causal-fast) use CC-BY-NC-SA-4.0.

```bash theme={null}
uv pip install --torch-backend=auto "mstar-ai[lingbot_world]"
mstar serve lingbot_world_1_3b
```

Before the server binds, both shipped configs run a two-chunk warm-up rollout at 464×832 on the model repo's teaser image, so the first client doesn't pay the DiT's compiles at that size. The GPU holds one rollout at the largest size, 720×1280: an 11.9 GB K/V pool reserved at startup, and 9.5 GB the engine keeps free for the rollout's VAE caches. A deployment that serves only 464×832 can shrink both ([settings](#options)). The VAE decode runs in bf16 on cuDNN 9.16 or later, and in fp32 before it.

[Send the request](#lingbot-frames).

### `pi05`

Text, image, robot state → action. The default `pi05.yaml` uses 1 GPU. The weight license for [`lerobot/pi05_base`](https://huggingface.co/lerobot/pi05_base) is unverified.

The loader first tries the tokenizer at the configured policy checkpoint, then falls back to `google/paligemma-3b-pt-224`. To download the gated fallback, accept its license and authenticate with the Hub. Cached tokenizer files work offline. For the DROID fine-tune, choose `pi05_droid.yaml`, which also serves the [openpi policy protocol](https://docs.m-star.org/clients.md#openpi-websocket).

```bash theme={null}
uv pip install --torch-backend=auto "mstar-ai[pi05]"
mstar serve pi05
```

[Send the request](#pi05-action).

### `vjepa2`

Video → embeddings. The default `vjepa2.yaml` uses 1 GPU. The [weights](https://huggingface.co/facebook/vjepa2-vitl-fpc64-256) use MIT.

```bash theme={null}
uv pip install --torch-backend=auto "mstar-ai[vjepa2]"
mstar serve vjepa2
```

[Send the request](#video-embeddings).

### `vjepa2_ac`

Video, actions → embeddings. The default `vjepa2_ac.yaml` uses 1 GPU. The license for the separately hosted AC weights is unverified.

```bash theme={null}
uv pip install --torch-backend=auto "mstar-ai[vjepa2_ac]"
mstar serve vjepa2_ac
```

[Send the request](#action-embeddings).

### Waypoint attention

Install [Waypoint and its pinned TAEHV decoder](#run-waypoint) before adding the attention kernel.

The DiT's attention runs torch flex-attention on the `FLASH` backend, which needs flash-attn-4 (`flash_attn.cute`) and torch 2.11 or newer. Install it after flash-attn, whose package ships an older `flash_attn/cute`:

```bash theme={null}
git clone https://github.com/Dao-AILab/flash-attention
git -C flash-attention checkout 1bda8f9290cd48d030f1516f0e680cd464ef3554
uv pip install --torch-backend=auto ./flash-attention/flash_attn/cute
```

Its kernels compile on first use, which slows the first startup. If the FLASH backend is unavailable, the server warns and uses the Triton flex kernel. At 720p, a Waypoint attention call took about 1.8× as long on Triton as on FLASH. `MSTAR_FLEX_BACKEND=TRITON` picks Triton; `MSTAR_FLEX_BACKEND=FLASH` fails at startup instead of falling back.

### LingBot-World: flash-attn

flash-attn is needed only for `model_kwargs: {reference_numerics: true}`, which runs the reference's FlashAttention-2 numerics. No extra installs it. A prebuilt wheel must match the installed torch and its CUDA build. The wheels stop at torch 2.10, and for 2.10 only CUDA 13 builds exist:

```bash theme={null}
python -c "import torch; print(torch.__version__, torch.version.cuda)"
uv pip install \
  "https://github.com/Dao-AILab/flash-attention/releases/download/v2.8.3/flash_attn-2.8.3+cu13torch2.10cxx11abiTRUE-cp312-cp312-linux_x86_64.whl"
```

On any other torch or CUDA build, build it against the installed torch, limited to your GPU's compute capability (`90` for H100):

```bash theme={null}
uv pip install psutil
FLASH_ATTN_CUDA_ARCHS="90" uv pip install flash-attn==2.8.3.post1 --no-build-isolation
python -c "import flash_attn; print(flash_attn.__version__)"
```

## Send a request

Run either client example in a second terminal after `/health` returns 200.

### Stream Waypoint frames

Supply a 16:9 seed image as `scene.png` and 1 to 512 controller actions. Each action returns one chunk of four RGB24 frames. The SDK writes the frames to disk. curl saves NDJSON with the frame dimensions. To append actions during a rollout, open `/generate/ws` with a `request_id` and `"end_input": false`, then send `{"request_id": ..., "append": {"model_kwargs": {"actions": [...]}}}`.

**Python SDK**

```python theme={null}
from mstar import MStarClient, VideoFrameChunk

client = MStarClient("http://localhost:8000")
frames = client.generate(
    images='scene.png',
    input_modalities=('image',),
    output_modalities=('video_frame',),
    stream=True,
    actions=[{'mouse': [1, 0], 'buttons': [], 'scroll': 0}],
)
with open("frames.rgb", "wb") as file:
    for frame in frames:
        if isinstance(frame, VideoFrameChunk):
            file.write(frame.data)
```

**curl**

```bash theme={null}
curl -fsS http://localhost:8000/generate \
  -F files=@scene.png \
  --form-string input_modalities=image \
  --form-string output_modalities=video_frame \
  --form-string streaming=true \
  --form-string 'model_kwargs={"actions":[{"mouse":[1,0],"buttons":[],"scroll":0}]}' > frames.ndjson
```

### Roll out a camera trajectory

Use `scene.png` as the first frame. This stationary-camera example repeats the identity camera-to-world transform for 13 frames. Supply at least 13 OpenCV camera-to-world poses as 4×4 or 3×4 matrices, and intrinsics `[fx, fy, cx, cy]` at 832×480. The server caps `model_kwargs` at 1 MiB. curl saves the per-chunk NDJSON.

**Python SDK**

```python theme={null}
from mstar import MStarClient, VideoFrameChunk

client = MStarClient("http://localhost:8000")
pose = [[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]
frames = client.generate(
    text='A quiet street in daylight.',
    images='scene.png',
    input_modalities=('image', 'text'),
    output_modalities=('video_frame',),
    stream=True,
    camera_poses=[pose] * 13,
    intrinsics=[500, 500, 416, 240],
    num_frames=13,
)
with open("frames.rgb", "wb") as file:
    for frame in frames:
        if isinstance(frame, VideoFrameChunk):
            file.write(frame.data)
```

**curl**

```bash theme={null}
python3 - <<'PY'
import json
pose = [[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]
with open("settings.json", "w") as file:
    json.dump({'camera_poses': [pose] * 13, 'intrinsics': [500, 500, 416, 240], 'num_frames': 13}, file)
PY
curl -fsS http://localhost:8000/generate \
  --form-string 'text=A quiet street in daylight.' \
  -F files=@scene.png \
  --form-string input_modalities=image,text \
  --form-string output_modalities=video_frame \
  --form-string streaming=true \
  -F 'model_kwargs=<settings.json' > frames.ndjson
```

### Get a pi0.5 action chunk

Use the base policy with a camera view in `scene.png` and the observed robot state. The base policy returns a 50×32 float32 action chunk. The DROID config uses its own normalization, takes up to two camera views and returns 15×32 values.

**Python SDK**

```python theme={null}
from pathlib import Path
from mstar import MStarClient

client = MStarClient("http://localhost:8000")
reply = client.generate(
    text='Pick up the cup.',
    images='scene.png',
    input_modalities=('image', 'text'),
    output_modalities=('action',),
    robot_state=[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
)
Path("actions.f32").write_bytes(next(part["bytes"] for part in reply.raw if part["modality"] == "action"))
```

**curl**

```bash theme={null}
curl -fsS http://localhost:8000/generate \
  --form-string 'text=Pick up the cup.' \
  -F files=@scene.png \
  --form-string input_modalities=image,text \
  --form-string output_modalities=action \
  --form-string streaming=false \
  --form-string 'model_kwargs={"robot_state":[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]}' \
  | python3 -c '
import base64, json, sys

outputs = json.load(sys.stdin)["outputs"]
with open("actions.f32", "wb") as file:
    for chunk in outputs["action"]:
        file.write(base64.b64decode(chunk["data"]))
'
```

### Encode a video

Supply `input.mp4`. The native API labels the float32 tensor as video. The example saves the encoder features. Omit `skip_predictor` for predicted features.

**Python SDK**

```python theme={null}
from pathlib import Path
from mstar import MStarClient

client = MStarClient("http://localhost:8000")
reply = client.generate(
    video='input.mp4',
    input_modalities=('video',),
    output_modalities=('video',),
    skip_predictor=True,
)
Path("features.f32").write_bytes(next(part["bytes"] for part in reply.raw if part["modality"] == "video"))
```

**curl**

```bash theme={null}
curl -fsS http://localhost:8000/generate \
  -F files=@input.mp4 \
  --form-string input_modalities=video \
  --form-string output_modalities=video \
  --form-string streaming=false \
  --form-string 'model_kwargs={"skip_predictor":true}' \
  | python3 -c '
import base64, json, sys

outputs = json.load(sys.stdin)["outputs"]
with open("features.f32", "wb") as file:
    for chunk in outputs["video"]:
        file.write(base64.b64decode(chunk["data"]))
'
```

### Predict future video features

Supply eight video frames in `input.mp4` and a trajectory with four rows of seven values. The zero-action example runs a four-step rollout. Both calls write the predicted float32 latents.

**Python SDK**

```python theme={null}
from pathlib import Path
from mstar import MStarClient

client = MStarClient("http://localhost:8000")
trajectory = [[0.0] * 7 for _ in range(4)]
reply = client.generate(
    video='input.mp4',
    input_modalities=('video',),
    output_modalities=('video',),
    rollout_horizon=4,
    actions=trajectory,
    states=trajectory,
)
Path("features.f32").write_bytes(next(part["bytes"] for part in reply.raw if part["modality"] == "video"))
```

**curl**

```bash theme={null}
python3 - <<'PY'
import json
trajectory = [[0.0] * 7 for _ in range(4)]
with open("settings.json", "w") as file:
    json.dump({'rollout_horizon': 4, 'actions': trajectory, 'states': trajectory}, file)
PY
curl -fsS http://localhost:8000/generate \
  -F files=@input.mp4 \
  --form-string input_modalities=video \
  --form-string output_modalities=video \
  --form-string streaming=false \
  -F 'model_kwargs=<settings.json' \
  | python3 -c '
import base64, json, sys

outputs = json.load(sys.stdin)["outputs"]
with open("features.f32", "wb") as file:
    for chunk in outputs["video"]:
        file.write(base64.b64decode(chunk["data"]))
'
```

## Deployment configs

| File | GPUs | When to use |
| - | - | - |
| `waypoint.yaml` | 1 | 720p, 2 worlds at once. |
| `waypoint_360p.yaml` | 1 | 360p checkpoint, 8 worlds at once. |
| `lingbot_world_1_3b.yaml` | 1 | Default: deterministic compile, and a warm-up rollout at 464×832. |
| `lingbot_world_1_3b_fast.yaml` | 1 | Autotuned DiT kernels; a seed's rollout differs between server processes. |
| `pi05.yaml` | 1 | `lerobot/pi05_base`. |
| `pi05_droid.yaml` | 1 | `lerobot/pi05_droid`, two cameras, openpi's DROID normalization and socket. |
| `vjepa2.yaml`, `vjepa2_ac.yaml` | 1 | Default. |

To use an alternative, pass `--config configs/<file>` after the launcher name. From a wheel installation, [copy the shipped YAML](https://docs.m-star.org/serving.md#custom-configs) and pass its local path.

## Settings and defaults

| Key | Knob | Effect |
| - | - | - |
| `waypoint` | `max_concurrent_requests` with `resources: kv: num_sessions` and `resources: decoder: max_slots` | Worlds resident at once. Raise all three together; the decoder's `max_slots` is one more, for the pool's sink slot. |
| `waypoint` | `step_batch_size` | Rows per rollout step, at most `max_concurrent_requests`. |
| `lingbot_world_1_3b` | `reference_numerics` | `true` runs the reference's numerics (needs flash-attn). |
| `lingbot_world_1_3b` | `resources: dit_kv: pool_tokens` | The DiT's K/V pool, reserved at startup. The default, 64,800 tokens a layer (11.9 GB), holds one rollout at 720×1280; 27144 (5.0 GB) holds one at 464×832. |
| `lingbot_world_1_3b` | `resources: vae_caches: max_bytes` | Memory the engine keeps free for the rollout's VAE caches between chunks: 9.5 GB by default, enough for 720×1280; 3994438656 (4.0 GB) at 464×832. |
| `pi05` | `num_cameras` | Images per request. The class default is 3; `pi05.yaml` leaves it, `pi05_droid.yaml` sets 2. |
| `pi05` | `norm_stats` | Normalize the raw `robot_state` as openpi does. |

## Limits

V-JEPA 2 returns embeddings for sampled video frames. V-JEPA 2-AC additionally needs action and state trajectories at least as long as its rollout horizon. Neither returns a playable video.

* LingBot-World runs one rollout at a time and refuses any other `max_concurrent_requests`.
* pi0.5 refuses more images than `num_cameras` with a 400; cameras left out are masked. `node_groups` must put `LLM` and `action_expert` in one entry.
* Waypoint ignores the prompt.
* The OpenAI generation routes return 404 for all five keys. Per-request LoRA is not served.


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