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

# LingBot-VLA-2.0

> Serve Robbyant's LingBot-VLA-2.0 Base and RoboTwin action policies on a single GPU.

## 1. Model Introduction

LingBot-VLA-2.0 uses a Qwen3-VL backbone and a flow-matching mixture-of-experts (MoE) action expert to predict 50 actions from a language instruction, RGB frames, and robot state. The Base checkpoint exposes the model's normalized action space. The RoboTwin checkpoint adds the camera mapping and joint normalization used by the simulator.

| Official checkpoint | RGB cameras | State and returned actions |
| - | - | - |
| [Base](https://huggingface.co/robbyant/lingbot-vla-v2-6b) | At least one of `camera_top`, `camera_wrist_left`, `camera_wrist_right` | 55 normalized state coordinates and a `50 × 55` normalized action chunk. The caller maps these coordinates to its robot. |
| [RoboTwin](https://huggingface.co/robbyant/lingbot-vla-v2-6b-robotwin) | All three of `cam_high`, `cam_left_wrist`, `cam_right_wrist` | 14 state coordinates in simulator units and a `50 × 14` action chunk in the same units. |

### RoboTwin joint order and normalization

For the official `robbyant/lingbot-vla-v2-6b-robotwin` checkpoint, send the 14 joint positions in simulator units. The input state and each returned action use the same zero-based order.

| Indices | 0–5 | 6 | 7–12 | 13 |
| - | - | - | - | - |
| Joints | Left arm | Left gripper | Right arm | Right gripper |

The server uses built-in statistics from the checkpoint's training configuration to normalize the state and convert predicted actions back to simulator units. The `bounds_99_woclip` transform uses the 1st and 99th percentiles without clipping. Other checkpoints or datasets may use different statistics or a different joint order. See the official [joint mapping](https://github.com/Robbyant/lingbot-vla-v2/blob/be969b8fd117fb70550c5d4bf4bc328211b5b1b6/configs/robot_configs/robotwin.yaml) and [statistics file](https://github.com/Robbyant/lingbot-vla-v2/blob/be969b8fd117fb70550c5d4bf4bc328211b5b1b6/assets/norm_stats/robotwin.json).

The JSON file stores a `q01` array and a `q99` array for each key under `norm_stats`.

| State key | Action key | Coordinate order in each array |
| - | - | - |
| `observation.state.arm.position` | `action.arm.position` | Six left-arm joints, then six right-arm joints |
| `observation.state.effector.position` | `action.effector.position` | Left gripper, then right gripper |

## 2. Start the policy server

Install the [SGLang Diffusion runtime](https://docs.sglang.io/docs/sglang-diffusion/installation.md). Use FP32 for RoboTwin task evaluation, as in [the official evaluation](https://github.com/Robbyant/lingbot-vla-v2/blob/be969b8fd117fb70550c5d4bf4bc328211b5b1b6/experiment/robotwin/README.md). Omitting the precision flag selects BF16, which uses less memory but can change task success.

```bash theme={null}
sglang serve robbyant/lingbot-vla-v2-6b-robotwin --host 127.0.0.1 --port 30000 --dit-precision fp32
```

For Base, pass `robbyant/lingbot-vla-v2-6b` to the same command. Base was not bit-exact against the unmodified release. It matched the two tested observations in BF16 and FP32 after the reference implementation used the same expert accumulation order. Pass `--revision <tag-or-commit>` to select a policy snapshot.

Both policies load all weights from the LingBot checkpoint. Transformers fetches only the config and preprocessing files from a [pinned Qwen revision](https://huggingface.co/Qwen/Qwen3-VL-4B-Instruct/tree/ebb281ec70b05090aa6165b016eac8ec08e71b17) and caches them. Use the same revision when recording reference actions.

RoboTwin uses a CUDA graph by default for the ten action denoising steps. Base uses the same graph runner on NVIDIA Ampere and newer GPUs with grouped expert projections. Base runs the denoising steps eagerly on its other expert path. For single requests, the runner caches one graph. Requests with the same input shapes replay it with the current state, noise, prefix keys, values, mask, and position offset. A new eligible input shape replaces the cached graph. Other step counts use eager execution. To run either checkpoint entirely in eager mode, pass `--pipeline-config-path eager.json` with the following file.

```json theme={null}
{"enable_action_cuda_graph": false}
```

For a single eager request, set `runtime.cuda_graph` to `false` in the HTTP request or `enable_cuda_graph` to `false` in the OpenPI observation.

Each API request carries one observation. For a single robot, keep the default batch size of one. For independent clients, set `--batching-max-size 4` to let compatible requests share one prefix forward and one batched denoising loop. Ten-step batches of two and four can capture their own action graphs on first use, consuming extra GPU memory only when used. Other grouped sizes run eagerly. Grouped calls do not replace the single-observation graph. Batch shape can affect floating-point results; validate action quality on your workload before enabling batching.

## 3. Request actions

Send RGB frames as integers in `[0, 255]` or floats in `[0, 1]`. SGLang uses the input dtype to preserve dark integer frames. Robbyant's reference server infers the range from the brightest pixel after resizing, which can brighten those frames.

Read the running checkpoint's input and output dimensions before building a request.

```bash theme={null}
curl --fail http://127.0.0.1:30000/v1/actions/metadata
```

Send the instruction, camera images, and state to `POST /v1/actions/generations`. Both checkpoints also accept OpenPI clients at `/openpi/policy`. RoboTwin additionally accepts the official simulator client's MessagePack WebSocket protocol at `/`, including episode reset. See the [runnable HTTP request](https://github.com/sgl-project/sglang/blob/main/examples/runtime/multimodal/LingBot-VLA-2.0.md) for a complete example.

## 4. Benchmark action latency

With either checkpoint running, start the benchmark in a second terminal using the same SGLang environment.

```bash theme={null}
python -m sglang.multimodal_gen.benchmarks.bench_openpi_serving --url ws://127.0.0.1:30000
```

The client reads the camera names and tensor dimensions from the server. It sends one request at a time over an uncompressed OpenPI WebSocket, with a fixed instruction and a seeded sequence of RGB images, states, and noise tensors. By default, it warms up with 10 requests and measures the next 50. To compare BF16 and FP32, restart the same checkpoint with `--dit-precision fp32` and repeat the command with the same `--seed`, `--warmup`, and `--requests`.

The JSON output reports P50/P95/P99 for server inference (`infer_ms`), packed request through decoded reply (`round_trip_ms`), and ready observation through decoded action (`action_ready_ms`, including client scheduling and packing). For example, `--requests 100 --deadline-ms 250` counts how many chunks were ready within 250 ms; it does not measure camera capture or actuation. Choose a deadline from your controller's actual replanning interval, not the model's 50-action horizon.

For multi-client throughput, use `--concurrency 4` and compare servers with `--batching-max-size 1` and `4`. Each client issues one request per round. To replay recorded OpenPI observations, pass `--observation sample.msgpack` once per sample.

## 5. Validate actions

For a fixed-noise comparison against the upstream implementation, use `test/manual/multimodal_gen/check_lingbot_vla_reference.py` from the SGLang checkout. Run the recorder from the [pinned upstream checkout](https://github.com/Robbyant/lingbot-vla-v2/tree/be969b8fd117fb70550c5d4bf4bc328211b5b1b6) in its own environment. Set `QWEN3VL_PATH` to the local Qwen processor/config directory, and `WEIGHTS` to the released RoboTwin `checkpoints/global_step_50000/hf_ckpt`.

```bash theme={null}
# In the upstream environment; CHECK is the absolute path to the script above.
PYTHONPATH=. python "$CHECK" record robotwin "$WEIGHTS" /tmp/robotwin-ref --dtype fp32
# With the FP32 SGLang server running; these tolerances are in RoboTwin joint units.
python "$CHECK" check /tmp/robotwin-ref/*.npz --max-mae 0.005 --max-abs 0.05
```

Use `record base` with the Base snapshot root for its 55 normalized coordinates; RoboTwin joint-unit tolerances do not transfer to Base. The recorder uses upstream preprocessing and model code, explicit noise and two synthetic observations. This checks open-loop actions, not task success.

For closed-loop evaluation, start the FP32 server above and point the [upstream simulator client](https://github.com/Robbyant/lingbot-vla-v2/blob/be969b8fd117fb70550c5d4bf4bc328211b5b1b6/experiment/robotwin/eval_policy_client_lingbotvla.py) at port 30000. Use the RoboTwin checkout, assets, `script/deploy` helpers and simulation environment from the upstream instructions. Run just the evaluation client; the upstream combined launcher would start a second policy server. The simulator must execute the returned actions and render the next observation. A prerecorded trajectory or an HTTP repeatability check is not a closed-loop result.

```bash theme={null}
# Run from the simulator checkout (RoboTwin commit 13c3c47f).
python script/eval_policy_client_lingbotvla.py --config policy/ACT/deploy_policy.yml \
  --overrides --task_name stack_blocks_two --task_config demo_clean \
  --policy_name ACT --train_config_name 0 --seed 0 --robo_name robotwin \
  --port 30000 --eval_video_log False --output_dir ./eval_results
```

The upstream client runs 100 episodes per task. For a split deployment, forward the policy server's loopback port to the simulation host. The simulator needs working NVIDIA Vulkan graphics, not just CUDA for the policy.


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