Skip to content
02 / 03·thermo_physics.dispatch · Potts Rate-Limit & SLA Task Router (MIT)

The board settles the burst.

Open-source (MIT) Python package. Local, privacy-preserving task router that maps batched LLM routing to a Potts spin glass, eliminating provider rate-limit 429 thrashing and latency timeouts.

When autonomous agent loops dispatch dozens of tasks in sudden parallel bursts, naive greedy routers either blow provider tokens-per-minute (TPM) ceilings or route complex reasoning to underspecified smaller models. thermo_physics.router treats the entire burst as a discrete Potts Hamiltonian, relaxing model assignments through rapid GPU/CPU Gibbs sampling.

// rate-limit-aware dispatcher boardlive Potts router

Eight tasks, one burst

Illustrative simulation

Nexus gateDepartures
TaskTokensModelGate

Split-flap illustration. Endpoint limits match the published simulation. These eight tasks are not the 40-task file, and this is not customer traffic.

The board is settling.

β starts at 2.8, the value in the published 40-task call. The slider only changes this 8-task illustration.

Illustrative capability misses
—
Illustrative SLA misses
—
Illustrative TPM overage
—
40-task batch traceIllustrative simulation · All three run today as JAX simulations on ordinary computers. No special sampling hardware is required.
// 01 · published run

What the 40-task simulation measured

One benchmark trace, 40 tasks, 97,841 tokens. The greedy cheapest-first strategy in that file missed required capability specifications on 18 of 40 tasks.

36.3%

Lower operational model expenditure versus naive high-capability routing, 43,689 tokens vs 22,113 tokens baseline, simulated benchmark result, results may vary (not customer results).

0 tok

TPM overage, simulated benchmark result, results may vary (not customer results). In the same burst, the naive strategy exceeded rate limits by 43,689 tokens. Solve time 4.65 ms (4.65 ms typical), simulated benchmark result, results may vary (not customer results).

Performance metrics across routing algorithms (simulated benchmark result, results may vary (not customer results)):

  • Naive high-capability

    SLA misses
    20/40
    Capability misses
    22/40
    TPM overage
    +43,689 tok
    Solve time
    0.01 ms
  • Greedy cheapest-first

    SLA misses
    0/40
    Capability misses
    18/40
    TPM overage
    +22,113 tok
    Solve time
    0.00 ms
  • Potts / Gibbs dispatcher

    SLA misses
    3/40
    Capability misses
    0/40
    TPM overage
    0 tok
    Solve time
    4.65 ms

TPM overage measures cumulative tokens exceeding an endpoint provisioned rate ceiling within the benchmark file. The on-premise endpoint is designated Local-Ollama-RTX5080 as a reference simulation label. All three run today as JAX simulations on ordinary computers. No special sampling hardware is required.

The task record in the dispatcher source is an id, a complexity tier, an estimated token count, a latency limit, and a list of capabilities. Prompt text is not a field on that record.

Note: simulated benchmark result, results may vary (not customer results).

Explore Station 15 & 16 in the 16-Station Interactive Thermo Lab →

// 02 · potts hamiltonian

1. Multi-Objective Potts Hamiltonian H(x)

Every arriving task i in burst batch B is assigned to model endpoint m. The global energy function penalizes SLA overages, capability deficits, and token quota collisions:

H(x) = ∑ c_m x_{i,m} + w_cap ∑ (1 - match(i, m)) x_{i,m} + w_sla ∑ max(0, lat_m - sla_i) x_{i,m} + w_tpm ∑ max(0, tok_m - cap_m)²
  • ·Cost Minimization: Balances lightweight vs frontier model compute weight.
  • ·Hard Capability Filter: Penalizes assigning reasoning tasks to non-reasoning models.
  • ·SLA Latency Bounds: Enforces time-to-first-token ceilings for interactive calls.
  • ·Quadratic Barrier: Smoothly dampens bursts before hitting provider 429 errors.
// 03 · privacy & isolation

2. Zero Prompt Exposure & Data Privacy

Strict isolation between routing metadata and payload content:

  • ·Metadata-Only Scheduling: The router evaluates only token counts, latency requirements, priority tiers, and required tools. Prompt text is not a field on that record.
  • ·No External Telemetry: Runs completely within your private VPC or on-premise compute cluster with zero outbound logging or vendor telemetry.
// 04 · multi-tier backends

3. Multi-Tier Backend Orchestration

Seamlessly orchestrates across hybrid local hardware and commercial API providers:

  • · Local GPU Inference (Ollama / vLLM on RTX 5080 / A100 / H100)
  • · Cloud Foundation Models (Claude, OpenAI, Gemini)
  • · Specialized Embedding & Classification Small Models
// 05 · shadow audit cli

4. Offline Trace Replay & Shadow Audit CLI

Replay historical request logs offline to verify cost reductions and rate-limit headrooms before switching routing in production:

python scripts/run_shadow_audit.py \
  --log requests.jsonl --target-endpoint localhost:8000 \
  --out audit_report.json

Calculates empirical rate-limit headroom, SLA compliance, and token expenditure improvements against naive routing with zero impact on live services.

// open source · academic & foundry access

Request shadow audit & router access

Open-source (MIT) Python package. Local, privacy-preserving task router for multi-tenant LLM clusters and agent swarms. Email is required.

We use this only to follow up with you. We don't sell or share it.

Prefer to talk first? Book a call (opens in a new tab)

Discuss your workflow (opens in a new tab)