prima.cpp 是一个分布式推理引擎,能在笔记本电脑、台式机和手机等异构日常设备上运行大语言模型(30B-70B),内存压力低且相比 llama.cpp 有显著加速。

Stars

64

7 天增长

暂无数据

Fork 数

9

开放 Issue

1

开源协议

MIT

最近更新

2026-06-30

AI 仓库情报摘要
FR-AI / ANALYSIS

为什么值得关注

它能够在由廉价异构设备组成的家庭集群上运行 70B 级别的模型,内存使用低于 10%,通过管道环并行、异构感知负载分配和自动设备选择实现最高 15 倍的加速。

适合谁使用

  • 拥有多台设备(笔记本、手机、台式机)并希望在本地运行大模型的家用用户
  • 探索低资源设备上分布式 LLM 推理的研究者与爱好者
  • 构建隐私保护的家庭 AI 助手或代理的开发者
  • 学习分布式系统和模型并行的学生与教育工作者

典型使用场景

  • 在家庭网络中的旧笔记本和手机上运行 Llama 3-70B 或 DeepSeek R1-70B
  • 构建无需上传数据到云端的私人本地 AI 助手(Home Siri)
  • 在异构集群上实验推测解码和动态批处理
  • 为教育或原型设计创建低成本推理环境

项目优势

  • 通过 mmap 和操作系统页面缓存管理实现低内存压力(<10%),允许大模型与其他应用同时运行
  • 在家庭集群上相比 llama.cpp 推理速度提升最高 15 倍(70B 模型延迟对比可见)
  • 支持多种异构设备(macOS、Linux、Android),具备自动设备选择与负载分配
  • 提供管道环并行+预取、推测解码(最高 80% 加速)以及动态批处理等高级功能

使用前须知

  • 暂不支持 Windows 和 AMD GPU,仅支持 CUDA 显卡
  • 需要本地网络并手动设置多台设备(IP 地址、端口),依赖 HiGHS 和 zmq 等组件
  • 性能高度依赖设备规格和网络状况;性能过差的设备会被自动移除,但极低配置下体验有限

README 快速开始

prima.cpp: Fast 30-70B LLM Inference on Heterogeneous and Everyday Home Devices

prima.cpp is a distributed implementation of llama.cpp that lets you run 70B-level LLMs on your everyday devices—💻 laptops, 🖥️ desktops, 📱 phones, and tablets (GPU or no GPU, it’s all good). With it, you can run QwQ-32B, Qwen 2.5-72B, Llama 3-70B, or DeepSeek R1 70B right from your local home cluster!

Worried about OOM or your device stucking? Never again! prima.cpp keeps its memory pressure below 10%, you can run very large models while enjoying Tiktok (if you don't mind the inference speed).

🚀 Performance

How about speed? Built upon llama.cpp, but it’s 15x faster! 🚀 On my poor devices, QwQ-32B generates 11 tokens per second, and Llama 3-70B generates 1.5 tokens per second. That's about the same speed as audiobook apps, from slow to fast speaking. We plan to power a Home Siri soon, then we can have private chats without privacy concerns.

prima.cpp vs llama.cpp on QwQ 32B:

https://github.com/user-attachments/assets/9fa3e57f-3f6b-49f3-800e-df9d758a60c6

prima.cpp vs llama.cpp on DeepSeek R1 70B:

https://github.com/user-attachments/assets/9549290e-a56f-46e1-9549-74250c1e0f7e

And, if your devices are more powerful, you could unlock even more possibilities, like running LLM agents right in your home! If you do, we’d love to hear about it, just share your cluster setup and token throughput with us!

Table 1: Home cluster configurations.

D1D2D3D4
DeviceMac M1LaptopDesktopMate40Pro
OSMacOS (UMA)LinuxLinuxLinux (on HarmonyOS)
CPUApple M1Intel i9Intel i9Kirin 9000
CPU Cores88168
RAM (available)2.4 GiB4.1 GiB9.7 GiB1.9 GiB
Disk Read Speed0.72 GB/s2.98 GB/s3.17 GB/s1.37 GB/s
GPU TypeApple Metal30702080TI-
VRAM (available)-8 GiB11 GiB-

Device D4 runs inside a Termux-simulate

项目描述

[Official] prima.cpp: Fast 30-70B LLM inference on heterogeneous and everyday home devices

相关仓库与替代方案

根据分类、Topic 和编程语言匹配的相似项目。

alecjacobson
精选
alecjacobson GitHub avatar

alpha-wrap

A CGAL-free, MIT-licensed reimplementation of the Alpha Wrapping algorithm that takes a defective triangle soup and produces a watertight, manifold, outward-oriented mesh with controllable level of detail and tightness.

C++
5
hypervising
精选
hypervising GitHub avatar

gta-enhanced-audio-queue-poc

A proof-of-concept tool that patches a synchronous three-slot audio queue in GTA V Enhanced, boosting frame rates from ~260 to ~499 FPS by removing coarse wait delays.

设计与创意
3
ammaarreshi
ammaarreshi GitHub avatar

Generals-Mac-iOS-iPad

This repository ports Command & Conquer Generals: Zero Hour to run natively on Apple Silicon Macs, iPhones, and iPads without emulation, adding touch controls and modern rendering.

C++
1,523