在家中使用日常设备运行自己的 AI 集群。由 exo labs 维护。

Alex Cheema e4238f9ef3 Merge pull request #800 from exo-explore/grpcio1.71.0 1 month ago
.circleci 928214d479 apt-get debian noninteractive in circleci 2 months ago
.github 295f41c5cc increase bench job timeout to give enough time to download 3 months ago
docs ad0e0d02d8 fix readme images 3 months ago
examples 188ac445c9 function calling example with weather tool 4 months ago
exo 50b6800a61 m3 ultra flops estimates based on some quick profiling 1 month ago
extra 3c7bd48aa3 get rid of some more hf bloat 3 months ago
scripts 971f5240bf build fix 2 months ago
test 3c7bd48aa3 get rid of some more hf bloat 3 months ago
.gitattributes b045f7612d add png to git lfs 5 months ago
.gitignore fece3f0cef gitignore tinychat pngs 5 months ago
.style.yapf f53056dede more compact operator formatting 8 months ago
LICENSE bde1e53f5f add license 9 months ago
README.md 013d2573e7 remove dead links in README 2 months ago
configure_mlx.sh 218c1e79d9 Merge branch 'main' into runners2 3 months ago
format.py f82410f808 clear instructions on formatting with yapf, remove linting 6 months ago
install.sh cde912deef - Use `#!/usr/bin/env bash` instead of `#!/bin/bash` for better portability 4 months ago
setup.py ad3bc6ceaa downgrade grpcio, grpcio-tools to 1.70.0 1 month ago

README.md

exo logo exo: Run your own AI cluster at home with everyday devices. Maintained by [exo labs](https://x.com/exolabs).

[Discord](https://discord.gg/EUnjGpsmWw) | [Telegram](https://t.me/+Kh-KqHTzFYg3MGNk) | [X](https://x.com/exolabs)

[![GitHub Repo stars](https://img.shields.io/github/stars/exo-explore/exo)](https://github.com/exo-explore/exo/stargazers) [![Tests](https://dl.circleci.com/status-badge/img/circleci/TrkofJDoGzdQAeL6yVHKsg/4i5hJuafuwZYZQxbRAWS71/tree/main.svg?style=svg)](https://dl.circleci.com/status-badge/redirect/circleci/TrkofJDoGzdQAeL6yVHKsg/4i5hJuafuwZYZQxbRAWS71/tree/main) [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)

Unify your existing devices into one powerful GPU: iPhone, iPad, Android, Mac, NVIDIA, Raspberry Pi, pretty much any device!

Update: exo is hiring. See here for more details.

Interested in running exo in your business? Contact us to discuss.

Get Involved

exo is experimental software. Expect bugs early on. Create issues so they can be fixed. The exo labs team will strive to resolve issues quickly.

We also welcome contributions from the community. We have a list of bounties in this sheet.

Features

Wide Model Support

exo supports different models including LLaMA (MLX and tinygrad), Mistral, LlaVA, Qwen, and Deepseek.

Dynamic Model Partitioning

exo optimally splits up models based on the current network topology and device resources available. This enables you to run larger models than you would be able to on any single device.

Automatic Device Discovery

exo will automatically discover other devices using the best method available. Zero manual configuration.

ChatGPT-compatible API

exo provides a ChatGPT-compatible API for running models. It's a one-line change in your application to run models on your own hardware using exo.

Device Equality

Unlike other distributed inference frameworks, exo does not use a master-worker architecture. Instead, exo devices connect p2p. As long as a device is connected somewhere in the network, it can be used to run models.

Exo supports different partitioning strategies to split up a model across devices. The default partitioning strategy is ring memory weighted partitioning. This runs an inference in a ring where each device runs a number of model layers proportional to the memory of the device.

Installation

The current recommended way to install exo is from source.

Prerequisites

  • Python>=3.12.0 is required because of issues with asyncio in previous versions.
  • For Linux with NVIDIA GPU support (Linux-only, skip if not using Linux or NVIDIA):

Hardware Requirements

  • The only requirement to run exo is to have enough memory across all your devices to fit the entire model into memory. For example, if you are running llama 3.1 8B (fp16), you need 16GB of memory across all devices. Any of the following configurations would work since they each have more than 16GB of memory in total:
    • 2 x 8GB M3 MacBook Airs
    • 1 x 16GB NVIDIA RTX 4070 Ti Laptop
    • 2 x Raspberry Pi 400 with 4GB of RAM each (running on CPU) + 1 x 8GB Mac Mini
  • exo is designed to run on devices with heterogeneous capabilities. For example, you can have some devices with powerful GPUs and others with integrated GPUs or even CPUs. Adding less capable devices will slow down individual inference latency but will increase the overall throughput of the cluster.

From source

git clone https://github.com/exo-explore/exo.git
cd exo
pip install -e .
# alternatively, with venv
source install.sh

Troubleshooting

  • If running on Mac, MLX has an install guide with troubleshooting steps.

Performance

  • There are a number of things users have empirically found to improve performance on Apple Silicon Macs:
  1. Upgrade to the latest version of macOS Sequoia.
  2. Run ./configure_mlx.sh. This runs commands to optimize GPU memory allocation on Apple Silicon Macs.

Documentation

Example Usage on Multiple macOS Devices

Device 1:

exo

Device 2:

exo

That's it! No configuration required - exo will automatically discover the other device(s).

exo starts a ChatGPT-like WebUI (powered by tinygrad tinychat) on http://localhost:52415

For developers, exo also starts a ChatGPT-compatible API endpoint on http://localhost:52415/v1/chat/completions. Examples with curl:

Llama 3.2 3B:

curl http://localhost:52415/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
     "model": "llama-3.2-3b",
     "messages": [{"role": "user", "content": "What is the meaning of exo?"}],
     "temperature": 0.7
   }'

Llama 3.1 405B:

curl http://localhost:52415/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
     "model": "llama-3.1-405b",
     "messages": [{"role": "user", "content": "What is the meaning of exo?"}],
     "temperature": 0.7
   }'

DeepSeek R1 (full 671B):

curl http://localhost:52415/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
     "model": "deepseek-r1",
     "messages": [{"role": "user", "content": "What is the meaning of exo?"}],
     "temperature": 0.7
   }'

Llava 1.5 7B (Vision Language Model):

curl http://localhost:52415/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
     "model": "llava-1.5-7b-hf",
     "messages": [
      {
        "role": "user",
        "content": [
          {
            "type": "text",
            "text": "What are these?"
          },
          {
            "type": "image_url",
            "image_url": {
              "url": "http://images.cocodataset.org/val2017/000000039769.jpg"
            }
          }
        ]
      }
    ],
     "temperature": 0.0
   }'

Example Usage on Multiple Heterogenous Devices (macOS + Linux)

Device 1 (macOS):

exo

Note: We don't need to explicitly tell exo to use the tinygrad inference engine. MLX and tinygrad are interoperable!

Device 2 (Linux):

exo

Linux devices will automatically default to using the tinygrad inference engine.

You can read about tinygrad-specific env vars here. For example, you can configure tinygrad to use the cpu by specifying CLANG=1.

Example Usage on a single device with "exo run" command

exo run llama-3.2-3b

With a custom prompt:

exo run llama-3.2-3b --prompt "What is the meaning of exo?"

Model Storage

Models by default are stored in ~/.cache/exo/downloads.

You can set a different model storage location by setting the EXO_HOME env var.

Model Downloading

Models are downloaded from Hugging Face. If you are running exo in a country with strict internet censorship, you may need to download the models manually and put them in the ~/.cache/exo/downloads directory.

To download models from a proxy endpoint, set the HF_ENDPOINT environment variable. For example, to run exo with the huggingface mirror endpoint:

HF_ENDPOINT=https://hf-mirror.com exo

Debugging

Enable debug logs with the DEBUG environment variable (0-9).

DEBUG=9 exo

For the tinygrad inference engine specifically, there is a separate DEBUG flag TINYGRAD_DEBUG that can be used to enable debug logs (1-6).

TINYGRAD_DEBUG=2 exo

Formatting

We use yapf to format the code. To format the code, first install the formatting requirements:

pip3 install -e '.[formatting]'

Then run the formatting script:

python3 format.py ./exo

Known Issues

  • On certain versions of Python on macOS, certificates may not installed correctly, potentially causing SSL errors (e.g., when accessing huggingface.co). To resolve this, run the Install Certificates command, typicall as follows:

    /Applications/Python 3.x/Install Certificates.command
    
  • 🚧 As the library is evolving so quickly, the iOS implementation has fallen behind Python. We have decided for now not to put out the buggy iOS version and receive a bunch of GitHub issues for outdated code. We are working on solving this properly and will make an announcement when it's ready. If you would like access to the iOS implementation now, please email alex@exolabs.net with your GitHub username explaining your use-case and you will be granted access on GitHub.

Inference Engines

exo supports the following inference engines:

Discovery Modules

Peer Networking Modules

  • GRPC
  • 🚧 NCCL