Skip to main content

BitTorrent-inspired peer-to-peer distributed LLM inference

Project description

Yaarbal

Yaarbal — the open model library. Contribute compute, access every model.

⚠ Status: early prototype. The credit economy and trust system are demo-grade; do not run production workloads on the public network.

Yaarbal quickstart demo

Visit yaarbal.app for the demo network.

Quickstart

pip install yaarbal && yaarbal run qwen2.5-0.5b-instruct "hello"

The single command above installs yaarbal from PyPI and runs a one-shot inference against a small (~600 MB) Qwen 2.5 0.5B instruct model. By default it auto-discovers any seeders on your local network or the configured tracker, submits the prompt, and streams tokens back to your terminal. If no seeder is reachable, the command exits with a clear error pointing at yaarbal seed (see Usage below).

Installation

From PyPI (recommended)

pip install yaarbal
yaarbal --version

See docs/distribution/INSTALL.md for Homebrew + Docker install paths and troubleshooting.

Alternate: install from source

git clone https://github.com/<owner>/yaarbal
cd yaarbal
pip install -e .

Requirements

  • Python 3.11 or newer
  • macOS or Linux (Windows is untested)
  • (Optional) A Hugging Face token in HF_TOKEN for gated models such as Llama 3.1 8B and above

The shipped CLI works on a CPU-only laptop for small models (Qwen 0.5B, Phi-3-mini Q4_K_M, MiniGPT). GPU acceleration (CUDA / Apple MPS) is auto-detected when available; pass --device cpu to force CPU.

Usage

yaarbal is a single binary with five subcommands. Run yaarbal --help for the full list.

Run inference (one-shot)

yaarbal run qwen2.5-0.5b-instruct "your prompt here"

Streams tokens to stdout. Falls back to a non-streaming pull-mode if the seeder does not advertise SSE support. Configuration precedence: explicit flags > YAARBAL_* environment variables > ~/.yaarbal/config.toml > built-in defaults.

Host a seeder (contribute compute)

yaarbal seed --model qwen2.5-0.5b-instruct

Loads the named model end-to-end, registers with the configured 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.

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. Honors YAARBAL_CHAT_BACKEND=single + YAARBAL_SINGLE_NODE_URL when you want to talk to a local seeder without a tracker.

Other subcommands

Command Effect
yaarbal status Credit balance, hosted models, tracker peer count (plain-text by default; --json for scripting)
yaarbal tracker [PORT] Run a tracker for a self-hosted Yaarbal network (default port 8000)
yaarbal ui Serve the local browser chat UI on 127.0.0.1:5173 (auto-opens in your browser; --no-open to suppress)
yaarbal --version Print the installed package version
yaarbal --help Full subcommand list

Optional swarm authentication

Set YAARBAL_AUTH_USER and YAARBAL_AUTH_PASS in the environment before starting tracker, seeders, and leechers so all HTTP traffic uses HTTP Basic Auth. If unset, authentication is disabled (typical for local dev). HTTP Basic is not a substitute for TLS — see KNOWN_LIMITATIONS.md.

For Engineers

For the engineering deep-dive — architecture, protocol design, model registry, BitTorrent-inspired piece-wise inference, credit economy mechanics — see PROJECT_OVERVIEW.md.

For the issue tracker (open limitations, P0–P3 prioritized), see KNOWN_LIMITATIONS.md.

For deeper component documentation:

Run with Docker (Compose)

The repo ships role-separated services (tracker, seeder, leecher, chat-proxy) in docker-compose.yml. The fastest container path is the single-node profile, which mirrors the local 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 available profiles: default, convenience, query, web. See QUICKSTART.md for the full profile / port matrix.

Testing

The project ships a pytest-managed test suite under tests/ covering unit, integration, regression, and large-scale tiers.

pip install -e .
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 via .github/workflows/python-ci.yml (Python 3.10 syntax check) and .github/workflows/pr-regression.yml (full unittest on PRs into main).

Contributing

Pull requests are welcome.

  1. Fork the repository and create a feature branch.
  2. Match the existing style — Python type hints + docstrings throughout; conventional-commit messages on commits.
  3. Add or update tests under tests/unit/ or tests/integration/ for any new behavior.
  4. Run make test to confirm a green suite before opening a PR.
  5. Open a PR against main with a short description of the change and a link to any tracking issue.

Issues, feature requests, and protocol-design discussion: file an issue on github.com//yaarbal. For deeper protocol questions, the research artifacts under docs/research/ are a good starting point.

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.3.tar.gz (157.6 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.3-py3-none-any.whl (183.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: yaarbal-0.1.3.tar.gz
  • Upload date:
  • Size: 157.6 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.3.tar.gz
Algorithm Hash digest
SHA256 af6888760d9f3b23b4a08351c087c1f8aa70e898e717392a9734a3f5db3dae3a
MD5 c1168cb7041a8e094edcc9db176d05bd
BLAKE2b-256 771c1548faf4a07c5094b500430286f4d6416910afbda2edf66c77753e1234b9

See more details on using hashes here.

Provenance

The following attestation bundles were made for yaarbal-0.1.3.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.3-py3-none-any.whl.

File metadata

  • Download URL: yaarbal-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 183.8 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e3fd54dc145b10f0251c7c0e7b913fdcaee2599fb8dcd2227ffcd8f060157514
MD5 ce153652c4c8dc6469214be1fe9df6f5
BLAKE2b-256 140cf531f4d710b2095d38ea5551d46156f163ac607f8c81dfb01bf4ff6a68f4

See more details on using hashes here.

Provenance

The following attestation bundles were made for yaarbal-0.1.3-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