Under the hood

How the p2p actually works

A thin coordinator only introduces two peers; the prompt and answer then flow directly between them, encrypted — never through a server. Here's the stack that does it, and why.

Built for four things

Speed — the prompt goes straight to the serving peer over a direct channel (no cloud hop), and the model runs locally.

Reliability — the Erlang VM supervises and self-heals; WebRTC punches through NATs so peers actually connect and stay connected.

Security — self-authenticating keypair IDs, an encrypted peer channel, and every job settled by a receipt both sides signed.

Privacy — the coordinator never sees a prompt; traffic is end-to-end encrypted and travels peer to peer.

The stack, in three layers

Standards and battle-tested libraries — we add the credit layer, not a new protocol.

Coordinator the thin server — introduces peers, keeps credits, never sees a prompt

Phoenix

Discovery + WebRTC signaling relay over WebSockets. Lean: channels + DB, no inference traffic.

Phoenix →

SQLite · signed receipts

An append-only, content-free Compute-Credit ledger. Each job is a receipt both peers signed.

SQLite → Credits →
Communication peer ↔ peer — find each other, then talk direct & encrypted

Slipstream

Each peer's WebSocket link to the coordinator — for discovery and signaling only.

Slipstream →

Elixir WebRTC

The direct channel: ICE (NAT traversal) + DTLS (encryption) + SCTP (reliable data). Prompt/answer flow straight between peers.

ex_webrtc → WebRTC →

Ed25519

Your peer ID is your public key — no accounts, no central authority. Auth + every receipt signed.

Ed25519 →
Peer on your machine — the app + the model you already run

Elixir · the BEAM

The local app runtime: lightweight concurrency + OTP supervision, so it self-heals.

Elixir → BEAM/OTP →

Phoenix LiveView

The small local UI it opens in your browser — no build step, no JS toolchain.

LiveView →

Ollama or LM Studio

The model runs on your own machine; LAPSUS just sits in front of whichever engine you run.

Ollama → LM Studio →
The shape

Coordinator introduces, peers talk direct

Coordinator introduces peers · keeps credits signaling signaling You your local model A peer their local model prompt ⇄ answer