prima.cpp
A research version of llama.cpp for low-memory home devices on Wi-Fi: it chains laptops, desktops and even phones in a ring, reads layers from disk as needed, and drops devices that would slow things down.
- Mac: Yes
- NVIDIA PC: Yes
- AMD PC: Partly
- Linux, processor only: Yes
- Raspberry Pi and boards: Partly
- Windows: No
- Android: Partly
- iPhone, iPad: No
At a glance
- Best for
- Getting a 30B-70B model running at all on a few ordinary laptops, desktops and Android phones whose memory together is still too small.
- Runs on
- macOS (Metal), Linux (CUDA or processor) and Android through Termux can mix in one cluster. No Windows, no Vulkan or ROCm yet; Raspberry Pi-type boards are untested.
- How it splits a model
- Pipeline in a ring, with its Halda solver deciding how many layers each device takes (and leaving out devices that would slow the rest).
- Connections
- Made for home Wi-Fi: it barely needs bandwidth, but latency matters.
- How devices join
- Manual: each device is started with its place in the ring.
- Models
- GGUF (tested with Llama, Qwen 2.5, QwQ and DeepSeek R1 distills).
- API
- OpenAI compatible (llama-server on the first device).
- Rules
- Every device needs its own copy of the model file on a fast disk.
Get started
macOS
brew install gcc make cmake fio git wget highs zeromq curl, then make -jLinux
Build with make -j (GGML_CUDA=1 for NVIDIA, USE_HIGHS=1 on the first device)
Then:
./llama-server -m model.gguf --world 2 --rank 0 --master 192.168.1.2 --next 192.168.1.3 --prefetch # device 1
./llama-cli -m model.gguf --world 2 --rank 1 --master 192.168.1.2 --next 192.168.1.2 --prefetch # device 2
Published speeds
Limits to know
- The open code hasn't changed since June 2026, and its makers' newer runtime is closed.
- No Windows.
- Few model families tested.
- Our estimates don't model its disk streaming, so for models bigger than the devices' memory it may run where we say it won't (slowly).
Estimates come from published hardware specs and our open formulas, not from running the model on your machine. Real speed varies with runtime, drivers and settings. Numbers marked “Measured” come from a linked benchmark.