Skip to content

Commit 8258b7e

Browse files
committed
doc clean
1 parent 5b55efd commit 8258b7e

11 files changed

Lines changed: 797 additions & 78 deletions

File tree

‎README.md‎

Lines changed: 40 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,39 @@
1-
<p align="right">
1+
<p align="center">
2+
<strong>Demo video placeholder</strong>
3+
<br>
4+
<sub>Replace this block with an animated GIF/WebP demo for GitHub autoplay.</sub>
5+
</p>
6+
7+
<h1 align="center">🤖 Robot.cpp</h1>
8+
9+
<h3 align="center">Run your robot model on any device.</h3>
10+
11+
<p align="center">
212
<strong>English</strong> | <a href="README_zh.md">简体中文</a>
313
</p>
414

5-
# 🤖 Robot.cpp
15+
<p align="center">
16+
<a href="https://huggingface.co/rrobottt">
17+
<img alt="Hugging Face" src="https://img.shields.io/badge/HuggingFace-Model%20Zoo-ffcc4d?style=for-the-badge&logo=huggingface&logoColor=black">
18+
</a>
19+
<img alt="WeChat" src="https://img.shields.io/badge/WeChat-Join%20Discussion%20Group-07C160?style=for-the-badge&logo=wechat&logoColor=white">
20+
</p>
621

7-
[Demo placeholder]
22+
<p align="center">
23+
<a href="https://github.com/Robot-cpp/robot.cpp/releases/latest">
24+
<img alt="macOS release" src="https://img.shields.io/badge/macOS-Release%20Package-000000?style=for-the-badge&logo=apple&logoColor=white">
25+
</a>
26+
<a href="https://github.com/Robot-cpp/robot.cpp/releases/latest">
27+
<img alt="Linux release" src="https://img.shields.io/badge/Linux-Release%20Package-FCC624?style=for-the-badge&logo=linux&logoColor=black">
28+
</a>
29+
<a href="https://github.com/Robot-cpp/robot.cpp/releases/latest">
30+
<img alt="Windows release" src="https://img.shields.io/badge/Windows-Release%20Package-0078D6?style=for-the-badge&logo=windows&logoColor=white">
31+
</a>
32+
</p>
833

9-
![1783392980125](image/README_zh/1783392980125.png)
34+
<p align="center">
35+
<img alt="Robot.cpp demo" src="image/README_zh/1783486646504.png" width="880">
36+
</p>
1037

1138
Robot.cpp is a lightweight on-device robot model inference framework built on top of llama.cpp. It inherits llama.cpp's zero-dependency and lightweight philosophy: robot model inference can run without complex Python dependency setup or PyTorch environment configuration. This makes Robot.cpp especially useful for cross-platform deployment and edge devices where environment setup is often painful.
1239

@@ -21,7 +48,7 @@ For robot-side usage, this repository provides examples for both simulation and
2148
We also provide two tools to support robot model development:
2249

2350
* [`hf2gguf`](tools/hf2gguf/README.md): converts safetensors checkpoints into the GGUF files used by this project.
24-
* [`quant`](tools/quant/README_zh.md): selectively quantizes arbitrary tensor groups in a model. Users only need to adjust a YAML plan to generate quantized GGUF files.
51+
* [`quant`](tools/quant/README.md): selectively quantizes arbitrary tensor groups in a model. Users only need to adjust a YAML plan to generate quantized GGUF files.
2552

2653
---
2754

@@ -99,13 +126,13 @@ python robot_client/examples/python/minimal_example.py
99126

100127
We provide a build-to-run example in `robot_client/shell/cpp_client_example.sh`. Adjust these environment variables as needed:
101128

102-
| Environment variable | Default | Purpose |
103-
| -------------------- | ---------------------------------------- | ----------------------------------------------------------------------- |
104-
| `ROBOT_CPP_ROOT` | unset; required | Repository root. |
105-
| `BUILD_DIR` | `${ROBOT_CPP_ROOT}/build_robot_client` | C++ client CMake build directory. |
106-
| `PORT` | `5555` | Server port used by the client. |
107-
| `BUILD_CLIENT` | `0` | Whether to force rebuild the client. Set to `1` to rebuild even if the binary already exists. |
108-
| `CMAKE_BIN` | `cmake` | CMake command path, useful for selecting a custom CMake binary. |
129+
| Environment variable | Default | Purpose |
130+
| -------------------- | ---------------------------------------- | ---------------------------------------------------------------------------------------------- |
131+
| `ROBOT_CPP_ROOT` | unset; required | Repository root. |
132+
| `BUILD_DIR` | `${ROBOT_CPP_ROOT}/build_robot_client` | C++ client CMake build directory. |
133+
| `PORT` | `5555` | Server port used by the client. |
134+
| `BUILD_CLIENT` | `0` | Whether to force rebuild the client. Set to`1` to rebuild even if the binary already exists. |
135+
| `CMAKE_BIN` | `cmake` | CMake command path, useful for selecting a custom CMake binary. |
109136

110137
Then run:
111138

@@ -207,7 +234,7 @@ Robot.cpp welcomes community contributions for new model runtimes, platform adap
207234

208235
If you want to extend this project, start with these documents:
209236

210-
* [How to add a new model](src/readme_zh.md)
237+
* [How to add a new model](src/readme.md)
211238
* How to add a new platform: [real robot](eval/README.md), [simulation](eval/HOW_TO_ADD_NEW_SIM.md).
212239

213240
Issues and PRs are welcome. For larger model-architecture changes, protocol changes, or platform abstraction changes, we recommend opening an issue first to align on the interface boundary.

‎README_zh.md‎

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,39 @@
1-
<p align="right">
1+
<p align="center">
2+
<strong>演示视频占位</strong>
3+
<br>
4+
<sub>后续可替换为 GIF/WebP 动图,以便在 GitHub README 顶部自动播放。</sub>
5+
</p>
6+
7+
<h1 align="center">🤖 Robot.cpp</h1>
8+
9+
<h3 align="center">让机器人模型运行在任意设备上。</h3>
10+
11+
<p align="center">
212
<a href="README.md">English</a> | <strong>简体中文</strong>
313
</p>
414

5-
# 🤖 Robot.cpp
15+
<p align="center">
16+
<a href="https://huggingface.co/rrobottt">
17+
<img alt="Hugging Face" src="https://img.shields.io/badge/HuggingFace-模型仓库-ffcc4d?style=for-the-badge&logo=huggingface&logoColor=black">
18+
</a>
19+
<img alt="WeChat" src="https://img.shields.io/badge/微信-加入交流群-07C160?style=for-the-badge&logo=wechat&logoColor=white">
20+
</p>
621

7-
【demo 位置】
22+
<p align="center">
23+
<a href="https://github.com/Robot-cpp/robot.cpp/releases/latest">
24+
<img alt="macOS release" src="https://img.shields.io/badge/macOS-发布包-000000?style=for-the-badge&logo=apple&logoColor=white">
25+
</a>
26+
<a href="https://github.com/Robot-cpp/robot.cpp/releases/latest">
27+
<img alt="Linux release" src="https://img.shields.io/badge/Linux-发布包-FCC624?style=for-the-badge&logo=linux&logoColor=black">
28+
</a>
29+
<a href="https://github.com/Robot-cpp/robot.cpp/releases/latest">
30+
<img alt="Windows release" src="https://img.shields.io/badge/Windows-发布包-0078D6?style=for-the-badge&logo=windows&logoColor=white">
31+
</a>
32+
</p>
833

9-
![1783392980125](image/README_zh/1783392980125.png)
34+
<p align="center">
35+
<img alt="Robot.cpp demo" src="image/README_zh/1783488032896.png" width="880">
36+
</p>
1037

1138
Robot.cpp是一个轻量化的on-device机器人模型推理框架,在llama.cpp的基础上进行开发,继承了其零依赖、轻量化的哲学,无需python相关的依赖配置,即可完成机器人模型推理,这使得其在跨平台尤其是环境配置复杂的边缘设备上具有优势。
1239

‎image/README/1783485262293.png‎

408 KB
Loading

‎image/README_zh/1783486646504.png‎

311 KB
Loading

‎image/README_zh/1783488032896.png‎

581 KB
Loading
File renamed without changes.

‎robot_server/README.md‎

Lines changed: 88 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,97 @@
11
# Robot Server
22

3+
[中文](README_zh.md)
4+
35
`robot_server` provides the lightweight TCP protocol used by `model-server` and
4-
the Python/C++ clients. The server keeps one robot policy loaded in-process and
5-
returns an action chunk for each prediction request.
6+
the Python/C++ clients. The server keeps one robot policy model loaded
7+
in-process and returns an action chunk for each prediction request. There are
8+
two main ways to use it.
9+
10+
## Method 1: One-Command Build and Run
11+
12+
We provide one-command build-and-run scripts for several mainstream platforms
13+
under `robot_server/shell`. After running a script, the corresponding
14+
`model-server` starts and begins listening.
15+
16+
| Backend | macOS | Linux | Windows |
17+
| ------- | ------------------------------------------------------- | -------------------------------------------------------- | ----------------------------------------------------------- |
18+
| CUDA | - | `robot_server/shell/launch_robot_server_linux_cuda.sh` | `robot_server/shell/launch_robot_server_windows_cuda.bat` |
19+
| CPU | `robot_server/shell/launch_robot_server_mac_cpu.sh` | `robot_server/shell/launch_robot_server_linux_cpu.sh` | `robot_server/shell/launch_robot_server_windows_cpu.bat` |
20+
| Metal | `robot_server/shell/launch_robot_server_mac_metal.sh` | - | - |
21+
22+
### Set Variables
23+
24+
Before running a script, configure the variables below as needed.
25+
26+
Common variables:
27+
28+
| Variable | Description | Default |
29+
| --- | --- | --- |
30+
| `ROBOT_CPP_ROOT` | Repository root. | Must be set explicitly |
31+
| `MODEL_TYPE` | Model type, `smolvla` or `pi0`. | `smolvla` |
32+
| `GGUF_DIR` | Directory containing GGUF files. | Must be set explicitly |
33+
| `BUILD_DIR` | CMake build directory. | macOS / Linux defaults are organized as `build_{mac/linux}_{cpu/metal/cuda}` |
34+
| `PORT` | Server listen port. | `5555` |
35+
| `THREADS` | Inference thread count. | `8` |
36+
| `TASK` | Language input describing the task. | `grab the block.` |
37+
| `NOISE_SEED` | Action noise seed. | `-1` |
38+
| `SKIP_BUILD` | Whether to skip configure/build. Set to `1` to directly launch an existing binary. | `0` |
39+
| `CMAKE_BIN` | CMake executable. | `cmake` |
40+
41+
SmolVLA variables:
42+
43+
| Variable | Description | Default |
44+
| --- | --- | --- |
45+
| `LLM_GGUF` | Full path to the SmolVLA LLM GGUF. | `${GGUF_DIR}/smolvla-llm-f32.gguf` |
46+
| `VISION_GGUF` | Full path to the SmolVLA vision/mmproj GGUF. | `${GGUF_DIR}/mmproj-smolvla-f32.gguf` |
47+
| `STATE_PROJ_GGUF` | Full path to the SmolVLA state projector GGUF. | `${GGUF_DIR}/state-proj-smolvla-f32.gguf` |
48+
| `ACTION_EXPERT_GGUF` | Full path to the SmolVLA action expert GGUF. | `${GGUF_DIR}/action-expert-smolvla-f32.gguf` |
49+
50+
pi0 variables:
51+
52+
| Variable | Description | Default |
53+
| --- | --- | --- |
54+
| `MODEL_BASENAME` | Common filename prefix for pi0 split GGUF files. | `robotcpp-pi0-libero-finetuned-v044` |
55+
| `VIT_GGUF` | Full path to the pi0 ViT GGUF. | `${GGUF_DIR}/${MODEL_BASENAME}.vit.gguf` |
56+
| `MMPROJ_GGUF` | Full path to the pi0 mmproj GGUF. | `${GGUF_DIR}/${MODEL_BASENAME}.mmproj.gguf` |
57+
| `LLM_GGUF` | Full path to the pi0 LLM GGUF. | `${GGUF_DIR}/${MODEL_BASENAME}.llm.gguf` |
58+
| `TOKENIZER_GGUF` | Full path to the pi0 tokenizer GGUF. | `${GGUF_DIR}/${MODEL_BASENAME}.tokenizer.gguf` |
59+
| `STATE_GGUF` | Full path to the pi0 state GGUF. | `${GGUF_DIR}/${MODEL_BASENAME}.state.gguf` |
60+
| `ACTION_DECODER_GGUF` | Full path to the pi0 action decoder GGUF. | `${GGUF_DIR}/${MODEL_BASENAME}.action_decoder.gguf` |
61+
62+
### Invocation
63+
64+
Run the macOS / Linux `.sh` scripts with `bash`:
65+
66+
```bash
67+
bash robot_server/shell/launch_robot_server_mac_cpu.sh
68+
bash robot_server/shell/launch_robot_server_mac_metal.sh
69+
bash robot_server/shell/launch_robot_server_linux_cpu.sh
70+
bash robot_server/shell/launch_robot_server_linux_cuda.sh
71+
```
672

7-
The active server binary is `model-server`; it supports both SmolVLA and pi0
8-
through the shared `robotcpp::Model` interface.
73+
Windows uses the `.bat` scripts.
974

10-
## Build
75+
### Troubleshooting
1176

12-
```sh
13-
cmake -S . -B build -DROBOT_CPP_BUILD_ROBOT_SERVER=ON
14-
cmake --build build --target model-server
15-
```
77+
- `Tell CMake where to find the compiler by setting either the environment variable "CUDACXX" or the CMake cache entry CMAKE_CUDA_COMPILER to the full path to the compiler, or to the compiler name if it is in the PATH.`
1678

17-
CUDA builds use the same target from a CUDA-enabled build directory:
79+
This happens when `CUDACXX` is not set. Set the environment variable as below
80+
(this is only an example; use the actual `nvcc` path on your machine):
1881

19-
```sh
20-
cmake --build build-cuda --target model-server -j
82+
```bash
83+
export CUDACXX=/usr/local/cuda-12.4/bin/nvcc
84+
export PATH=/usr/local/cuda-12.4/bin:$PATH
2185
```
2286

23-
## Launch
87+
## Method 2: Download a Prebuilt Release
88+
89+
After downloading from the release page, run the commands below.
2490

25-
SmolVLA:
91+
### Start SmolVLA
2692

27-
```sh
28-
./build/bin/model-server \
93+
```bash
94+
./model-server \
2995
--model-type smolvla \
3096
--llm /path/to/smolvla-llm.gguf \
3197
--mmproj /path/to/mmproj-smolvla.gguf \
@@ -35,13 +101,13 @@ SmolVLA:
35101
--port 5555
36102
```
37103

38-
pi0:
104+
### Start pi0
39105

40-
```sh
106+
```bash
41107
GGUF_DIR=ckpts/pi0-libero-finetuned-v044/robotcpp-split
42108
MODEL=robotcpp-pi0-libero-finetuned-v044
43109

44-
./build-cuda/bin/model-server \
110+
./model-server \
45111
--model-type pi0 \
46112
--vit "${GGUF_DIR}/${MODEL}.vit.gguf" \
47113
--mmproj "${GGUF_DIR}/${MODEL}.mmproj.gguf" \
@@ -53,38 +119,7 @@ MODEL=robotcpp-pi0-libero-finetuned-v044
53119
--port 5555
54120
```
55121

56-
The server currently listens only on `127.0.0.1`.
57-
58-
## Clients
59-
60-
Python client:
61-
62-
```text
63-
robot_client/python/model_client.py
64-
robot_client/base_policy/
65-
robot_client/examples/python/minimal_example.py
66-
eval/lerobot_so101/
67-
```
68-
69-
C++ client:
70-
71-
```text
72-
robot_client/cpp/model_client.{h,cpp}
73-
robot_client/examples/cpp/minimal_example.cpp
74-
```
75-
76-
Useful smoke and latency scripts:
77-
78-
```text
79-
robot_server/examples/python/minimal_predict.py
80-
robot_server/examples/cpp/minimal_predict.cpp # build target: model-server-minimal-predict
81-
robot_server/test/benchmark_latency.py
82-
robot_server/test/compare_server_model_cli.py
83-
robot_client/examples/python/minimal_example.py
84-
robot_client/examples/cpp/minimal_example.cpp # build target: model-cpp-client-example
85-
```
122+
Replace `/path/to/...`, `GGUF_DIR`, and `MODEL` with the actual local GGUF model
123+
file paths. `model-server` currently listens only on `127.0.0.1`.
86124

87-
`response.actions` is shaped `[chunk_size][action_dim]`.
88-
`response.actions_flat` is the same action buffer flattened.
89-
`response.timings` contains server/model timing metrics such as
90-
`server_predict_ms`, `model_total_ms`, and model-specific stage timings.
125+
## Method 3: Docker

0 commit comments

Comments
 (0)