Skip to main content

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_TOKEN for 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:

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

License: Apache 2.0

Copyright 2026 Abdul Hannan Kanji. Licensed under Apache-2.0.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

yaarbal-0.1.5.tar.gz (180.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

yaarbal-0.1.5-py3-none-any.whl (207.6 kB view details)

Uploaded Python 3

File details

Details for the file yaarbal-0.1.5.tar.gz.

File metadata

  • Download URL: yaarbal-0.1.5.tar.gz
  • Upload date:
  • Size: 180.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for yaarbal-0.1.5.tar.gz
Algorithm Hash digest
SHA256 410dde9cecfc6fee495f1733ad222b0dd0e7fae4260e56fe6d14a998a167675e
MD5 d10023b9a1d291aecd166f44e2aed7b0
BLAKE2b-256 474aa382bdd17108116c4bfb1f9e3b2d25125d21b8f7166dcd7a28b7033c068e

See more details on using hashes here.

Provenance

The following attestation bundles were made for yaarbal-0.1.5.tar.gz:

Publisher: release.yml on hannanabdul55/distributed-full-gpt-inference

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file yaarbal-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: yaarbal-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 207.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for yaarbal-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 ff68e6f9f66c84c5eff897ad27429fb8f170e91de156b840eed965b2f120b6b0
MD5 7466d9978c2fe6cc3728307fd6e96268
BLAKE2b-256 d32adab725985eaa1b684777db03c964f810e239026cd5da8fab4a4504a50093

See more details on using hashes here.

Provenance

The following attestation bundles were made for yaarbal-0.1.5-py3-none-any.whl:

Publisher: release.yml on hannanabdul55/distributed-full-gpt-inference

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page