Layr-Labs/d-inference

Private Inference Network on Idle Macs

Darkbloom (d‑inference)

What it is – Darkbloom is a public‑alpha, decentralized inference service that lets owners of Apple‑silicon Macs rent out their idle GPU/CPU cycles as an OpenAI‑compatible backend. Consumers call a single HTTPS endpoint (https://api.darkbloom.dev/v1) with the usual OpenAI or Anthropic request format; the request is routed to a provider Mac that runs the model in‑process via Apple’s MLX library.


Core ideas

Idea How Darkbloom implements it
Decentralised compute Macs (M1‑M2‑Ultra, etc.) run a hardened Swift CLI (darkbloom) that connects outbound over a WebSocket to a Go‑based coordinator running in a GCP Confidential VM (AMD‑SEV).
Privacy‑by‑design • End‑to‑end encryption with NaCl Box (X25519 + XSalsa20‑Poly1305) for every request.
• Provider process is locked down (Hardened Runtime, SIP, PT_DENY_ATTACH) so the machine owner cannot attach a debugger or read memory.
• The only plaintext exposure is inside the coordinator’s hardware‑encrypted VM memory; it is never logged or persisted.
Hardware attestation Four‑layer chain: Secure Enclave‑signed attestation blob → MDM cross‑check → Apple Managed Device Attestation (MDA) → APNs code‑identity signature. The provider’s public key is bound to its Secure Enclave, and the coordinator validates it every 5 min.
OpenAI‑compatible API All standard endpoints (/v1/chat/completions, /v1/completions, /v1/messages, etc.) work unchanged; only the base URL changes. Streaming (SSE), tool calling, vision, and continuous batching are supported.
Self‑route / direct mode If you own a provider node you can route requests to your machine for free (X‑Darkbloom‑Route: self) or run a local OpenAI‑compatible server (darkbloom start --local) that bypasses the coordinator entirely.

Architecture at a glance

flowchart LR
    U[Consumer (SDK / curl / UI)] -->|HTTPS| CO[Coordinator (Go, GCP Confidential VM)]
    CO -->|WebSocket + NaCl Box| P[Provider (Swift CLI on macOS)]
    P -->|Metal GPU via MLX| GPU[Apple Silicon GPU]
    P -.->|encrypted SSE| CO
    CO -.->|streamed response| U
  • Coordinator – authenticates, does billing, selects a provider, re‑encrypts payloads, and relays SSE chunks.
  • Provider – a hardened macOS process that loads models with mlx‑swift‑lm, runs inference on‑device, and never exposes plaintext to the OS user.
  • Models – stored centrally (https://models.darkbloom.ai), downloaded and verified (SHA‑256) by each provider. Model aliases (e.g. gemma-4-26b) are resolved at request time.

Getting started (consumer)

from openai import OpenAI
client = OpenAI(base_url="https://api.darkbloom.dev/v1", api_key="sk-db-…")
stream = client.chat.completions.create(
    model="gemma-4-26b",
    messages=[{"role": "user", "content": "Hello, Darkbloom!"}],
    stream=True,
)
for chunk in stream:
    if chunk.choices[0].delta.content:
        print(chunk.choices[0].delta.content, end="")

Or with curl:

curl https://api.darkbloom.dev/v1/chat/completions \
  -H "Authorization: Bearer sk-db-…" \
  -H "Content-Type: application/json" \
  -d '{"model":"gemma-4-26b","messages":[{"role":"user","content":"Hello!"}],"stream":true}'

All standard OpenAI SDKs work by swapping the base URL.


Running a provider (earnings)

  1. Prerequisites – Apple Silicon (M1+), macOS 14+, ≥8 GB RAM, 50 GB free disk, outbound HTTPS.
  2. Install – one‑liner:
    curl -fsSL https://api.darkbloom.dev/install.sh | bash
    
    The script verifies signatures, provisions the Secure Enclave helper, and (optionally) installs the MDM profile for attestation.
  3. Start the daemon
    darkbloom start               # background launchd service
    darkbloom login              # device‑code flow to link your account
    darkbloom status             # see hardware, trust level, earnings
    
  4. Model managementdarkbloom models download gemma-4-26b, darkbloom models list, darkbloom models remove ….
  5. Earnings – view in the web console (https://console.darkbloom.dev). Requests routed to your own node are free; all other traffic follows the per‑token pricing below.

Pricing (public API)

Token type Default rate
Input $0.05 / 1 M tokens
Output $0.20 / 1 M tokens
Minimum per‑request charge $0.0001
Platform fee defined in docs/architecture/billing.md#invariants

Rates are per‑model and can be overridden by individual providers; the live list is always available at GET /v1/pricing.


Security & privacy highlights

  • Zero observation surface – inference runs inside the same process that receives the encrypted payload; no subprocesses, no local servers, no IPC.
  • Kernel‑level debugger denialPT_DENY_ATTACH prevents any external debugger from attaching.
  • Hardened Runtime & SIP – blocks memory‑reading APIs; the protections cannot be removed without a reboot that kills the process.
  • End‑to‑end encryption – NaCl Box seals the request for the provider’s attested key; response chunks are sealed back to the coordinator.
  • Attestation chain – Secure Enclave signature → MDM → Apple Managed Device Attestation → APNs code‑identity, giving the coordinator confidence the binary is genuine and unmodified.
  • Threat model – only a physical attacker who can desolder and probe the memory chips could see plaintext; all software‑level attacks are mitigated.

Maturity & licensing

  • StatusPublic Alpha. Expect breaking changes, occasional downtime, and frequent updates.
  • Repository layout
    • coordinator/ (Go) – control plane, routing, billing, attestation.
    • provider‑swift/ (Swift) – the hardened CLI that runs on Macs.
    • console‑ui/, admin‑ui/ – Next.js dashboards.
    • docs/ – extensive design, security, and run‑book documentation.
  • License – The README references a standard open‑source license (see LICENSE in the repo) but also includes a disclaimer that the service is provided “as‑is” and that the provider software may be subject to Apple developer‑program agreements.

Who might use it?

  • Developers who need an OpenAI‑compatible endpoint but want to avoid centralized cloud costs.
  • Researchers looking for a test‑bed for privacy‑preserving inference on commodity hardware.
  • Mac owners who want to monetize idle GPU cycles while keeping their data private.
  • Enterprises that require on‑premise inference but lack their own GPU fleet; they can tap the pooled Mac network instead.

Quick links (from the repo)

  • Docsdocs/consumer/quickstart.md, docs/provider/installation.md, docs/architecture/security/encryption.md
  • API referencedocs/reference/api-contracts.md
  • Billing invariantsdocs/architecture/billing.md#invariants
  • Provider CLI referencedocs/provider/cli-reference.md
  • Self‑route guidedocs/provider/self-route.md
  • Direct mode guidedocs/provider/direct-mode.md

Darkbloom is a genuine, open‑source attempt to turn the massive pool of idle Apple‑silicon Macs into a privacy‑preserving, OpenAI‑compatible inference cloud. Its design hinges on hardware attestation, end‑to‑end encryption, and a hardened macOS process, making it a noteworthy example of decentralized AI compute.

Related

  • Project
  • Project
  • Project
  • Project
  • Project