BitTorrent-inspired peer-to-peer distributed LLM inference
Project description
Yaarbal
Yaarbal — distributed LLM inference over a credit-metered P2P network.
Status: early prototype. The credit economy and trust system are demo-grade; do not run production workloads on the public network.
Every node hosts a complete model. A tracker brokers peer discovery. Inference requests are routed to available seeders, credits are earned by hosting and spent by querying. No central GPU pool — just peers.
Visit yaarbal.app for the demo network.
Quickstart
pip install yaarbal
yaarbal run qwen2.5-0.5b-instruct "hello"
This auto-discovers seeders on the configured tracker (https://tracker.yaarbal.app by default), submits the prompt, and streams tokens to your terminal. If no seeder is reachable, the command exits with a clear error and tells you how to start one.
Installation
From PyPI
pip install yaarbal
yaarbal --version
See docs/distribution/INSTALL.md for Docker and Homebrew paths.
From source (internal)
git clone <yaarbal repo> && cd yaarbal
pip install -e ".[dev]"
Requirements
- Python 3.11 or newer
- macOS or Linux (Windows is untested)
- (Optional)
HF_TOKENfor gated models such as Llama 3.1 8B and above
CPU-only works for small models (Qwen 0.5B, Phi-3-mini Q4_K_M, MiniGPT). GPU acceleration (CUDA / Apple MPS) is auto-detected; pass --device cpu to force CPU.
Usage
yaarbal is a single binary with subcommands. Run yaarbal --help for the full list.
One-shot inference
yaarbal run qwen2.5-0.5b-instruct "your prompt here"
Streams tokens to stdout. Discovers peers via the tracker; falls back to pull-mode if the seeder does not support SSE streaming. Configuration precedence: explicit flags > YAARBAL_* env vars > ~/.yaarbal/config.toml > built-in defaults.
Host a seeder
yaarbal seed --model qwen2.5-0.5b-instruct
Loads the named model end-to-end, registers with the tracker, and serves /inference, /inference/stream, /v1/chat/completions, and /v1/models over HTTP. Seeders earn credits on every settled inference and spend them when running yaarbal run against the network.
Single-node mode (local, no tracker)
# Terminal 1
yaarbal seeder --mode single-node --model qwen2.5-0.5b-instruct --port 7001
# Terminal 2
YAARBAL_CHAT_BACKEND=single YAARBAL_SINGLE_NODE_URL=http://127.0.0.1:7001 \
yaarbal chat --model qwen2.5-0.5b-instruct
Best for local development and offline use. See QUICKSTART.md for the full walkthrough.
Interactive chat
yaarbal chat --model qwen2.5-0.5b-instruct
Multi-turn REPL with rolling conversation history. In-REPL commands: /models, /health, /metrics, /reset, /quit.
Other subcommands
| Command | Effect |
|---|---|
yaarbal status |
Credit balance, hosted models, tracker peer count (--json for scripting) |
yaarbal tracker [PORT] |
Run a tracker for a self-hosted Yaarbal network (default port 8000) |
yaarbal ui |
Serve the pre-built browser chat UI from web/dist/ on 127.0.0.1:5173 (auto-opens browser; --no-open to suppress; requires cd web && npm run build first) |
yaarbal --version |
Print the installed package version |
yaarbal --help |
Full subcommand list |
Browser UI (development)
To run the React frontend in dev mode:
cd web && npm install && npm run dev
Open http://localhost:5173. Configure the backend mode, model, and URLs in the Connection panel.
Optional swarm authentication
Set YAARBAL_AUTH_USER and YAARBAL_AUTH_PASS before starting the tracker, seeders, and leechers to enable HTTP Basic Auth across all HTTP traffic. If unset, authentication is disabled. HTTP Basic is not a substitute for TLS — see KNOWN_LIMITATIONS.md.
Docker
Role-separated services are defined in docker-compose.yml. The fastest path mirrors the single-node quickstart:
docker compose --profile single-node up single-node
# from a second terminal:
YAARBAL_CHAT_BACKEND=single YAARBAL_SINGLE_NODE_URL=http://127.0.0.1:7001 \
yaarbal chat --model qwen2.5-0.5b-instruct
Other profiles: default (tracker + minigpt seeders), convenience (all-in-one orchestrator), query (one-shot leecher), web (browser chat proxy). See QUICKSTART.md for the full profile and port matrix.
Testing
pip install -e ".[dev]"
make test # full suite
make test-unit # unit tier only
make test-integration # integration tier only
make test-verbose # full suite with verbose output
python -m pytest tests/unit/test_tracker.py -v # one file
CI runs on every push and PR: .github/workflows/python-ci.yml (Python 3.10 syntax check on *.py) and .github/workflows/pr-regression.yml (unittest discover on PRs into main).
Note: pyproject.toml requires Python >=3.11 for installation; the CI syntax-check workflow uses 3.10. This is a known gap — see KNOWN_LIMITATIONS.md.
For Engineers
Architecture, protocol design, model registry, BitTorrent-inspired inference routing, and credit economy mechanics: PROJECT_OVERVIEW.md.
Open limitations (P0–P3 prioritized): KNOWN_LIMITATIONS.md.
Deeper component documentation:
- docs/architecture/ — protocol design and architectural notes
- docs/api/reference.md — HTTP endpoint reference
- docs/deployment/ — Docker / multi-node deployment
- docs/guides/ — development and getting-started guides
- docs/testing/ — test plan and manual testing guide
- bittorrent/README.md — internal docs for the inference-routing component
- MODELS.md — full model catalog (30+ entries) with hardware requirements
- QUICKSTART.md — single-node walkthrough and Docker profile reference
Contributing
This is a closed-source project; contributions are not accepted via public PRs. Internal contributors: see docs/guides/development.md.
Further Reading
Yaarbal originated as research on P2P inference. See docs/research/ for the original protocol design and rebuttal exchange.
License
Copyright 2026 Abdul Hannan Kanji. Licensed under Apache-2.0.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file yaarbal-0.1.4.tar.gz.
File metadata
- Download URL: yaarbal-0.1.4.tar.gz
- Upload date:
- Size: 157.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3e8c35df599678d0ebc7fa4e0b82288c1f7ed098dfb9cfc4ba22c26bea6b39b5
|
|
| MD5 |
31018b090e07e507a11b4576ededf90e
|
|
| BLAKE2b-256 |
fc49c19d709cac183a7c18ccdb154c364711b83674a6c0474abbba22d18cd73e
|
Provenance
The following attestation bundles were made for yaarbal-0.1.4.tar.gz:
Publisher:
release.yml on hannanabdul55/distributed-full-gpt-inference
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
yaarbal-0.1.4.tar.gz -
Subject digest:
3e8c35df599678d0ebc7fa4e0b82288c1f7ed098dfb9cfc4ba22c26bea6b39b5 - Sigstore transparency entry: 1419677295
- Sigstore integration time:
-
Permalink:
hannanabdul55/distributed-full-gpt-inference@f94ca5f2c2df340693c143d801fb16150985d2d2 -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/hannanabdul55
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f94ca5f2c2df340693c143d801fb16150985d2d2 -
Trigger Event:
push
-
Statement type:
File details
Details for the file yaarbal-0.1.4-py3-none-any.whl.
File metadata
- Download URL: yaarbal-0.1.4-py3-none-any.whl
- Upload date:
- Size: 183.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
65c6953607cd0c77c8868d1fa5a461a6bb9791ff6376240b863490053e3efdb1
|
|
| MD5 |
bc2acf1d09d5fcd7a41124c81c240157
|
|
| BLAKE2b-256 |
fca9b8fd862d4b5f3cc085479358aa1410a7095bb040ffea88ccfe306bed3934
|
Provenance
The following attestation bundles were made for yaarbal-0.1.4-py3-none-any.whl:
Publisher:
release.yml on hannanabdul55/distributed-full-gpt-inference
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
yaarbal-0.1.4-py3-none-any.whl -
Subject digest:
65c6953607cd0c77c8868d1fa5a461a6bb9791ff6376240b863490053e3efdb1 - Sigstore transparency entry: 1419677382
- Sigstore integration time:
-
Permalink:
hannanabdul55/distributed-full-gpt-inference@f94ca5f2c2df340693c143d801fb16150985d2d2 -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/hannanabdul55
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f94ca5f2c2df340693c143d801fb16150985d2d2 -
Trigger Event:
push
-
Statement type: