Skip to content

Expert-as-a-service — dynamic MoE paging across the grid #580

Closed

Description

@joelteply

The Idea

MoE models load ALL experts but only activate a few per token. On constrained devices, this wastes memory. Instead: keep the router + hot experts local, page cold experts from the grid on demand.

Architecture

iPhone (2GB budget):
  - Router weights (tiny, always resident)  
  - 4 hot experts (recently used, ~500MB)
  - Cold expert requests → grid mesh → nearest node with expert loaded

MacBook (8-16GB budget):
  - Router + 16-32 experts resident
  - Overflow to grid for rare experts

5090 Tower (32GB):
  - Full expert set resident
  - Serves cold expert requests from edge devices

How It Works

  1. Token arrives at MoE layer
  2. Router selects top-K experts
  3. If expert is local → run locally (fast path)
  4. If expert is remote → request from grid (async, with fallback to best local expert)
  5. Prefetch: router predicts next-token experts, pre-fetches from grid
  6. LRU eviction: least-recently-used experts paged out when memory pressure

The Docker Parallel

  • Expert = container image
  • Router = orchestrator/scheduler
  • Grid node = compute host
  • Pull expert = docker pull
  • Hot expert = running container
  • Cold expert = image in registry

Performance

  • Local expert: ~1ms (GPU memory access)
  • Grid expert over Tailscale: ~5-20ms (LAN latency)
  • Grid expert over internet: ~50-200ms (WAN)
  • Prefetching hides most latency for sequential generation

This Is The Moat

Hermes/OpenClaw route to cloud APIs. We route to experts on YOUR hardware. The model is distributed across devices you own. No API keys. No monthly bill. No data leaving your network.

Dependencies

  • Grid transport working (Tailscale now, Reticulum later)
  • MoE model loading with partial expert sets
  • Expert-level weight serialization (ship one expert, not the whole model)
  • Candle inference with dynamic expert loading
  • Factory widget showing expert residency across grid

Related

Activity

  1. joelteply commented on Mar 30, 2026

    @joelteply
    ContributorAuthor

    Tracked in architecture roadmap. Not actionable as individual issue — needs grid + inference + dynamic loading.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions