Seeed-Jetson-DevelopTool / llama-cpp-rpc-distributed
AGENTS.md57 starsChanged 4 months agoMITView on GitHub
Distribute LLM inference across multiple Jetson devices using llama.cpp RPC backend with CUDA. Build from source with RPC+CUDA, convert models to GGUF, and run multi-node inference for horizontal scaling. Requires two Jetson devices with JetPack 6.x+.
- Installs packages
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,843 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository297 other files it gives its agents.
- AGENTS.mdAGENTS.md
- ai-nvrAGENTS.md
- allxon-ota-updateAGENTS.md
- allxon-setupAGENTS.md
- alwaysai-setupAGENTS.md
- backup-restoreAGENTS.md
- bsp-source-buildAGENTS.md
- clawdbot-developmentAGENTS.md
- cochl-sense-setupAGENTS.md
- cvedia-setupAGENTS.md
- dashcamnet-xavier-nx-multicameraAGENTS.md
- deciai-setupAGENTS.md
- deepseek-quick-deployAGENTS.md
- deploy-deepseek-mlcAGENTS.md
- deploy-depth-anything-v3AGENTS.md
- deploy-diaAGENTS.md
- deploy-efficient-vision-engineAGENTS.md
- deploy-frigateAGENTS.md
- deploy-live-vlm-webuiAGENTS.md
- deploy-nvbloxAGENTS.md
- deploy-ollama-anythingllmAGENTS.md
- deploy-riva-llama2AGENTS.md
- developtool-deviceAGENTS.md
- disk-encryptionAGENTS.md
- diy-bsp-buildAGENTS.md
- ethercat-communicationAGENTS.md
- ethercat-setupAGENTS.md
- finetune-llm-llama-factoryAGENTS.md
- fix-browser-snap-jetsonAGENTS.md
- gapi-setupAGENTS.md
- generative-ai-introAGENTS.md
- gpt-oss-liveAGENTS.md
- gr00t-n1-5-deploy-thorAGENTS.md
- gr00t-n1-6-deploy-agxAGENTS.md
- hardhat-setupAGENTS.md
- hybrid-bsp-dk-to-recomputerAGENTS.md
- imx477-a603-setupAGENTS.md
- j501-viola-fruit-sortingAGENTS.md
- jetpack5-ssd-boot-fixAGENTS.md
- jetpack-flash-wsl2AGENTS.md
- jetpack-jetson-overviewAGENTS.md
- jetpack-ota-updateAGENTS.md
- jetson-ai-toolsAGENTS.md
- jetson-docker-setupAGENTS.md
- jetson-faqAGENTS.md
- jetson-pc-wired-shareAGENTS.md
- jetson-project-galleryAGENTS.md
- jetson-resource-indexAGENTS.md
- jetson-tutorial-exercisesAGENTS.md
- ko-module-buildAGENTS.md
- l4t-differencesAGENTS.md
- langchain-output-formattingAGENTS.md
- lerobot-env-setupAGENTS.md
- llm-interface-controlAGENTS.md
- local-chatbot-multimodalAGENTS.md
- local-chatbot-physicalAGENTS.md
- local-llm-text-to-imageAGENTS.md
- local-rag-llamaindexAGENTS.md
- lumeo-setupAGENTS.md
- maskcam-nanoAGENTS.md
- The first 60 shown.
The file
We split this AGENTS.md into the rules it gives an agent
7 rules. About 0 are common, 4 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Run large language models across multiple Jetson devices by leveraging llama.cpp's RPC backend.
- Distinctive: line 14
Run one phase at a time. After each phase:
- Very specific: line 16
If output contains [STOP] → stop, consult the failure decision tree.
- Very specific: line 17
If output ends with [OK] → tell the user "Phase N complete" and proceed.
- Distinctive: line 35
Run on both machines:
- Distinctive: line 74
Run on the client machine (Machine A):
- Very specific: line 132
Default port is 50052. Customize with -p <port>.
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Distributed llama.cpp on Jetson (RPC Mode)
Run large language models across multiple Jetson devices by leveraging llama.cpp's RPC backend. This enables horizontal scaling — split model layers across GPUs on different machines connected via LAN.
Execution model
Run one phase at a time. After each phase:
- Relay all output to the user.
- If output contains
[STOP]→ stop, consult the failure decision tree. - If output ends with
[OK]→ tell the user "Phase N complete" and proceed.
Prerequisites
| Requirement | Detail |
| Hardware | Two reComputer Jetson devices (e.g. Orin NX/AGX Orin) |
| JetPack | 6.x+ with working CUDA drivers |
| Network | Both devices on same LAN, able to ping each other |
| RAM | Client ≥ 64 GB, remote node ≥ 32 GB (unified memory) |
| Storage | ~5 GB free for build + model |
Phase 1 — Clone and install build dependencies (~2 min)
Run on both machines:
git clone https://github.com/ggml-org/llama.cpp.git
cd llama.cpp
sudo apt update
sudo apt install -y build-essential cmake git libcurl4-openssl-dev python3-pip[OK] when clone and apt install complete on both machines.
Phase 2 — Build with RPC + CUDA backend (~5 min)
Run on both machines:
cd llama.cpp
cmake -B build \
-DGGML_CUDA=ON \
-DGGML_RPC=ON \
-DCMAKE_BUILD_TYPE=Release
cmake --build build --parallelVerify:
ls build/bin/llama-cli build/bin/rpc-server[OK] when both llama-cli and rpc-server binaries exist.
[STOP] if cmake or build fails — see failure decision tree.
Phase 3 — Install Python conversion tools (~1 min)
Run on the client machine (Machine A):
cd llama.cpp
pip3 install -e .[OK] when pip install completes.
Phase 4 — Download and convert model (~5–10 min)
Using TinyLlama-1.1B-Chat as an example:
pip3 install huggingface-hub
huggingface-cli download TinyLlama/TinyLlama-1.1B-Chat-v1.0 --local-dir ~/TinyLlama-1.1B-Chat-v1.0Convert to GGUF:
cd llama.cpp
python3 convert_hf_to_gguf.py \
--outfile ~/TinyLlama-1.1B.gguf \
~/TinyLlama-1.1B-Chat-v1.0[OK] when GGUF file is created.
[STOP] if conversion fails — check model files are complete.
Phase 5 — Verify single-machine inference (~1 min)
cd llama.cpp
./build/bin/llama-cli \
-m ~/TinyLlama-1.1B.gguf \
-p "Hello, how are you today?" \
-n 64[OK] when the model generates a text response.
[STOP] if inference fails — check CUDA with nvidia-smi.
Phase 6 — Start RPC server on remote machine (Machine B)
SSH into Machine B and run:
cd llama.cpp
CUDA_VISIBLE_DEVICES=0 ./build/bin/rpc-server --host <MACHINE_B_IP>Default port is 50052. Customize with -p <port>.
[OK] when server prints "listening on <IP>:50052".
Phase 7 — Start RPC server on local machine (Machine A)
In a separate terminal on Machine A:
cd llama.cpp
CUDA_VISIBLE_DEVICES=0 ./build/bin/rpc-server -p 50052[OK] when server prints listening message.
Phase 8 — Run distributed inference (~1 min)
On Machine A, in another terminal:
cd llama.cpp
./build/bin/llama-cli \
-m ~/TinyLlama-1.1B.gguf \
-p "Hello, my name is" \
-n 64 \
--rpc <MACHINE_B_IP>:50052,127.0.0.1:50052 \
-ngl 99-ngl 99 offloads all layers to GPU across both RPC nodes.
[OK] when distributed inference produces output and both RPC servers show activity.
[STOP] if connection refused — check network and firewall.
Failure decision tree
| Symptom | Action |
| cmake fails with CUDA not found | Verify CUDA: nvcc --version. Ensure JetPack 6.x is installed. |
| Build fails with missing headers | Run sudo apt install -y build-essential cmake libcurl4-openssl-dev. |
rpc-server startup failure | Check if port 50052 is occupied: ss -tlnp | grep 50052. Check firewall: sudo ufw allow 50052. |
| Connection refused during distributed inference | Verify machines can ping each other. Confirm RPC servers are running on both. |
| Slower inference with RPC than single-node | Model too small for network overhead to pay off. Try a larger model (7B+). |
| Out of memory error | Reduce -ngl value to keep some layers on CPU. Close other GPU processes. |
| Model conversion fails | Ensure all model files downloaded completely. Check disk space. |
Reference files
references/source.body.md— Full Seeed Wiki tutorial with hardware topology diagrams, performance comparison screenshots, and troubleshooting details (reference only)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

