Answer
BitLLM is one binary that turns your machine into a client of a peer-to-peer inference network. A local gateway on 127.0.0.1:7778 speaks both the OpenAI and Anthropic wire shapes. A libp2p node finds peers sharing vLLM, llama.cpp, MLX or Ollama models. Countersigned receipts attribute every answer to the peer that served it.
- Any OpenAI-compatible tool works with no code change: point it at the local port and use any string as the API key.1
- Peers announce their models every ten seconds, the gateway picks a host, and the answer names it in
X-Bitllm-Peer.1 - By default the serving peer reads your prompt and sees your IP; a
tee/model seals the text to an attested enclave, while tool names and arguments stay visible.1 - Nothing is filtered or logged in the middle: the middle is relays, hole punching and receipts.
Applies toBitLLM 0.8.4 on one laptopinvite-only beta, uninvited nodes served on spare capacity
What runs on the machine?
Diagram structure
- Agent tools and SDKs
tools - Local gateway :7778
gateway - P2P node :4001
node - Seed nodes
seeds - Relays and hole punching
relays - Receipt ledger
ledger tools→gateway· POST /v1/chat/completionsgateway→node· place requestnode→seeds· bootstrap, sync receiptsnode→relays· dial peersrelays→node· relay circuitsnode→ledger· countersign
The same binary is both halves. The gateway binds loopback only, so requests written on the machine are never filtered. The node binds every interface, joins the DHT through the seeds, and announces the models this machine serves every ten seconds.
What happens to one prompt?
Diagram structure
- Agent tool
tool - Local gateway
gw - Serving peer
peer - Inference server
inf - Receipt ledger
led tool→gw· POST /v1/chat/completionsgw→peer· dial and forward fieldspeer→inf· local model callinf→peer· answerpeer→led· countersign receiptpeer→gw· answer + X-Bitllm-Peergw→tool· 200 with usage
- Agent tool
Posts the model name, messages and tool schemas to the local gateway.
- Local gateway
Picks a host from the announcements and dials it, directly or through a relay.
- Inference server
Runs the model and returns the answer to the peer.
- Receipt ledger
The host countersigns: peer id, address, token counts, never the text.
- Agent tool
The answer streams back with
X-Bitllm-Peernaming the peer that served it.
Who can read the prompt?
| Question | Default model | tee/ model |
|---|---|---|
| Prompt and answer text | plain textThe serving peer reads it | end to endSealed to an attested enclave |
| Your IP address | Visible to the peer | Visible unless you use a VPN |
| Tool names and arguments | Visible | even sealedVisible |
| Failed attestation | Not checked | 502, nothing sent |
The host forwards only the fields it knows: the standard OpenAI and Anthropic fields, data: images, and one prompt per /completions call. Unknown fields are dropped, not rejected.
How does a new node join?
Diagram structure
- Gateway up on loopback
gw - Resolve _dnsaddr TXT
txt - Seeds found?
ok - Pin with --bootstrap
pin - conns fill, receipts sync
conns - /v1/models lists models
models conns→models· announcementsgw→txtok→conns· yesok→pin· resolver said nopin→connstxt→ok
The seed list is a DNS TXT record at _dnsaddr.bootstrap.bitllm.org. When a resolver answers NXDOMAIN for it, the gateway still comes up but the network stays empty; pinning the seed addresses with --bootstrap fixes it, as measured on this machine.
What breaks, and how does it say so?
| Symptom | What it means | What to do |
|---|---|---|
Empty /v1/models | Resolver failed the TXT record, or no peers yet | Pin seeds with --bootstrap, then wait |
| 502 naming multiaddrs | The one serving peer could not be dialed | Retry, or pick another model |
NO_RESERVATION | Stale relay reservation | Retry the request |
| 429 after 60 s | Server busy; normal for uninvited nodes | Back off and retry |
Most models show nodes: 1, so there is no fallback host. An unreachable peer empties its models from the menu until it returns.