You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 8258b7e
Browse filesBrowse the repository at this point in the historyBrowse files
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.
12
39
@@ -21,7 +48,7 @@ For robot-side usage, this repository provides examples for both simulation and
21
48
We also provide two tools to support robot model development:
22
49
23
50
*[`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.
|`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.|
109
136
110
137
Then run:
111
138
@@ -207,7 +234,7 @@ Robot.cpp welcomes community contributions for new model runtimes, platform adap
207
234
208
235
If you want to extend this project, start with these documents:
209
236
210
-
*[How to add a new model](src/readme_zh.md)
237
+
*[How to add a new model](src/readme.md)
211
238
* How to add a new platform: [real robot](eval/README.md), [simulation](eval/HOW_TO_ADD_NEW_SIM.md).
212
239
213
240
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.
| 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`|
-`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.`
16
78
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):
18
81
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
21
85
```
22
86
23
-
## Launch
87
+
## Method 2: Download a Prebuilt Release
88
+
89
+
After downloading from the release page, run the commands below.
0 commit comments