Exo 分布式 AI 集群——将 Mac/PC/WSL2 设备整合为统一 GPU集群,本地运行大模型,支持 DeepSeek、Qwen、LLaMA。
将闲置设备整合为统一算力集群
Exo 可将多台 Mac、PC、手机等设备整合为一个 GPU 集群,在本地运行大模型。
项目信息Stars44.5K官网https://exolabs.net/GitHubexo-explore/exo
搭建集群 / exo集群 / 本地部署大模型 / 分布式推理
bash
# 1. 安装 Xcode
xcode-select --install
# 2. 安装 Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# 3. 安装依赖
brew install uv node rust
# 4. 安装 Exo
git clone https://github.com/exo-explore/exo
cd exo
bash
# 方式1: 用社区原生版
git clone https://github.com/tensorsofthewall/exo_windows
exo_windows
# 方式2: WSL2 中运行
git clone https://github.com/exo-explore/exo
cd exo
pip install -e .
python -m exo.main --role master
bash
# 安装 CUDA 和相关驱动
# 然后同样 clone exo
git clone https://github.com/exo-explore/exo
cd exo
bash
# 如果有 Nix
nix run .#exo
bash
cd exo
# 启动主节点
python -m exo.main --role master --port 8080 --name "home-cluster"
# 其他设备加入(从节点)
python -m exo.main --role worker --master-addr 主节点IP:8080 --name "设备名"
# 低配设备轻量模式
python -m exo.main --role worker --master-addr 主节点IP:8080 --light-mode
bash
# 1. 克隆
cd ~
git clone https://github.com/tensorsofthewall/exo_windows
exo_windows
# 2. 安装依赖
pip install -e .
# 或
pip install torch tinygrad
# 3. 启动
python -m exo.main --role master --port 8080 --name "wsl2-cluster"
# 浏览器打开 http://localhost:52415
bash
python -m exo.master.api --list-available-models
bash
# 部署 DeepSeek 7B
python -m exo.master.api --deploy-model deepseek-7b --min-nodes 2 --max-nodes 4
# 部署更大的模型
python -m exo.master.api --deploy-model qwen3-235b --min-nodes 2 --max-nodes 4
Exo 提供多种 API 兼容:
bash
curl http://localhost:52415/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-7b",
"messages": [{"role": "user", "content": "你好"}]
}'
bash
curl http://localhost:52415/v1/messages \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-7b",
"messages": [{"role": "user", "content": "你好"}]
}'
bash
curl http://localhost:52415/api/generate \
-d '{"model": "deepseek-7b", "prompt": "你好"}'
text
http://主节点IP:52415
bash
python -m exo.main --status
bash
python -m exo.utils.info_gatherer.system_info --detailed
设备数量推荐模型内存要求1 台7B16GB2 台14B32GB4 台70B~128GB4 台 Mac Studio 512GB671B (8-bit)2TB 统一内存
A: 确保在同一局域网,使用有线或 5GHz WiFi
A: 从 7B 开始测试,确认单设备能跑再增加节点
A: 使用 Thunderbolt 联网,或启用 RDMA
需求命令启动主节点exo --role master设备加入集群exo --role worker --master-addr IP部署模型exo --deploy-model 模型名查看模型列表exo --list-models查看状态exo --status打开管理界面http://localhost:52415
可以配合使用:
示例:
bash
# 让集群运行推理
curl -X POST http://mac-server:52415/v1/chat/completions \
-d '{"model": "deepseek-7b", "messages": [{"role": "user", "content": "解释量子计算"}]}'
Exo | 分布式 AI 集群框架