Skip to content

feat: immersive network stats with geo analytics - #212

Merged
Gajesh2007 merged 2 commits into
masterfrom
feat/stats-network-analytics
May 25, 2026
Merged

Gajesh2007 merged 2 commits into
masterfrom
feat/stats-network-analytics

Conversation

@Gajesh2007

@Gajesh2007 Gajesh2007 commented May 25, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Port the codex/stats-network-analytics worktree onto master with updated import paths (coordinator/internal/ -> coordinator/).
  • Remove the standalone analytics/ Go service -- its endpoints (/v1/overview, /v1/leaderboard/earnings) are duplicates of the coordinator's /v1/stats, /v1/leaderboard, and /v1/network/totals. It was never deployed.

Architecture: Before & After

Before

graph LR
    subgraph "Console UI /stats"
        A[Stats Page]
    end
    subgraph "Coordinator"
        B[GET /v1/stats]
        C[Registry<br/>in-memory providers]
        D[Store<br/>usage table]
    end
    subgraph "analytics/ service"
        E["GET /v1/overview<br/>GET /v1/leaderboard/earnings"]
        F[Postgres read replica]
    end

    A -->|"direct fetch<br/>every 10s"| B
    B --> C
    B --> D
    E --> F

    style E fill:#f9d6d6,stroke:#c00
    style F fill:#f9d6d6,stroke:#c00
    style A fill:#e8e8e8,stroke:#666

    linkStyle 3 stroke:#c00,stroke-dasharray:5
Loading
  • /v1/stats returns flat provider list + usage totals + time series
  • No geo data, no location tracking, no flow visualization
  • analytics/ service duplicates coordinator endpoints, never deployed
  • Provider entries lack attestation fields

After

graph LR
    subgraph "Console UI /stats"
        A["Stats Page<br/>(SVG world map,<br/>flow arcs, model inventory)"]
    end
    subgraph "Console UI API Routes"
        P["/api/stats proxy<br/>(?mock=geo for dev)"]
        Q["/api/attestation proxy"]
    end
    subgraph "Coordinator"
        B["GET /v1/stats<br/>(+ 10 geo fields)"]
        C["Registry<br/>Provider.Location"]
        D["Store<br/>usage.request_location JSONB<br/>providers.location JSONB"]
        G["GeoIP Resolver<br/>(MaxMind DB /<br/>CF+Vercel headers)"]
    end

    A --> P
    P --> B
    A --> Q
    Q -->|"/v1/providers/attestation"| B
    B --> C
    B --> D
    G -->|"provider connect"| C
    G -->|"consumer request"| D

    style A fill:#d4edda,stroke:#28a745
    style G fill:#cce5ff,stroke:#004085
    style P fill:#fff3cd,stroke:#856404
    style Q fill:#fff3cd,stroke:#856404
Loading

Data flow: geo capture to stats response

sequenceDiagram
    participant Provider as Provider (WS)
    participant Geo as GeoIP Resolver
    participant Reg as Registry
    participant Store as Store (Postgres)
    participant Stats as GET /v1/stats
    participant UI as Console UI

    Provider->>Geo: WebSocket connect
    Geo->>Geo: MaxMind lookup / trusted headers
    Geo->>Reg: attachProviderLocation(loc)
    Reg->>Store: UpsertProvider(location JSONB)

    Note over Provider,Store: Consumer inference request
    Geo->>Store: RecordUsageWithCostAndLocation(request_location)

    UI->>Stats: GET /v1/stats
    Stats->>Reg: ForEachProvider (live locations)
    Stats->>Store: UsageLocationBuckets (SQL GROUP BY)
    Stats->>Store: UsageRecordsSince (flow aggregation)
    Stats->>Store: ListProviderRecords (disconnected providers)
    Stats->>Stats: Privacy floor (k-anonymity)
    Stats->>UI: provider_locations, request_locations, request_flows
Loading

What changes

Area Change
Coordinator: GeoIP New provider_geo.go -- MaxMind DB + trusted reverse-proxy header (CF/Vercel) resolver. Env: EIGENINFERENCE_GEOIP_DB, EIGENINFERENCE_TRUST_GEO_HEADERS. Validates proxy source before accepting headers. Rejects NaN/Inf coordinates.
Coordinator: /v1/stats 10 new JSON fields: provider_locations, provider_regions, request_locations, request_regions, request_flows, plus privacy floor metadata. Provider entries gain attestation fields (attested, mda_verified, acme_verified, runtime_verified, certificate_available, last_challenge_verified, failed_challenges). All buckets include key, scope, token counts.
Coordinator: store New ProviderLocation struct, RecordUsageWithCostAndLocation() + UsageLocationBuckets() + UsageRecordsSince() interface methods. Postgres: location JSONB on providers + request_location JSONB on usage, with schema migrations. NULL locations excluded from geo aggregation. Memory store implementations included.
Coordinator: registry Location field on Provider, ConsumerLocation on PendingRequest. RestoreProviderState preserves fresh location on reconnect (does not overwrite). Deep-copy on persist/restore.
Console-UI: /stats Immersive rewrite: SVG world map with equirectangular-projected provider/consumer dots, animated request flow arcs, provider geography tables, model inventory with routability/fleet mix.
Console-UI: routes New /api/stats proxy (with ?mock=geo for dev) and /api/attestation proxy.
Console-UI: CSS network-flow-ping keyframe animation with prefers-reduced-motion support.
Cleanup Removed analytics/ standalone Go service (11 files, ~1,400 lines).

Privacy

  • City-level provider location buckets suppressed below 2 providers (k-anonymity).
  • City-level request location buckets suppressed below 5 requests.
  • Request flows suppressed below 5 requests per city-to-city path, capped at 24 flows.
  • Raw client IPs are never stored -- only approximate geo derived from GeoIP DB or trusted proxy headers.
  • Coordinates are averaged across the bucket, not per-provider.
  • Postgres excludes NULL-location rows from geo aggregation.

Verification

  • cd coordinator && go build ./... -- passes
  • cd coordinator && go test ./... -count=1 -timeout 180s -- all packages green
  • gofmt -l coordinator/ -- clean
  • cd console-ui && npm run build -- passes
  • 5 new Go tests (geo IP parsing, trusted header extraction, provider/request/flow location aggregation with privacy floor)

Dependencies

  • github.com/oschwald/geoip2-golang v1.13.0 (MaxMind GeoIP2 reader)

@vercel

vercel Bot commented May 25, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
d-inference Ready Ready Preview May 25, 2026 9:12pm
d-inference-console-ui-dev Ready Ready Preview May 25, 2026 9:12pm
d-inference-landing Ready Ready Preview May 25, 2026 9:12pm

Request Review

@github-actions

github-actions Bot commented May 25, 2026 •

Copy link
Copy Markdown
Contributor

Benchmark Results

Runner: macos-15 (M1 Virtual) | Date: 2026-05-25 20:08 UTC

1-provider-streaming

1 providers, 1 users, 30 requests, concurrency=5, streaming=true

Model Providers RAM
mlx-community/Qwen3.5-0.8B-MLX-4bit 1 0.5 GB
Metric Value
Total Requests 30
Success 4
Errors 26
Total Duration 5.006s
Throughput 0.8 req/s

Latency Decomposition

Segment Count Mean P50 P95 Max
total_e2e 4 1.788s 1.788s 1.788s 1.788s
parse 4 38µs 29µs 79µs 79µs
reserve 4 7ms 8ms 10ms 10ms
route 4 31µs 31µs 56µs 56µs
encrypt 4 741µs 850µs 987µs 987µs
dispatch 4 49µs 50µs 63µs 63µs
coordinator_to_provider 4 1.773s 1.773s 1.776s 1.776s

Assertion Report: PASS

Assertion Result Detail
parse:mean<=1ms PASS mean=38.25µs (threshold=1ms)
parse:p95<=5ms PASS p95=79µs (threshold=5ms)
reserve:mean<=50ms PASS mean=7.37325ms (threshold=50ms)
reserve:p95<=200ms PASS p95=10.055ms (threshold=200ms)
encrypt:mean<=5ms PASS mean=740.5µs (threshold=5ms)
encrypt:p95<=50ms PASS p95=987µs (threshold=50ms)
dispatch:mean<=5ms PASS mean=49µs (threshold=5ms)
dispatch:p95<=50ms PASS p95=63µs (threshold=50ms)

1-provider-non-streaming

1 providers, 1 users, 20 requests, concurrency=5, streaming=false

Model Providers RAM
mlx-community/Qwen3.5-0.8B-MLX-4bit 1 0.5 GB
Metric Value
Total Requests 20
Success 4
Errors 16
Total Duration 3.298s
Throughput 1.2 req/s

Latency Decomposition

Segment Count Mean P50 P95 Max
total_e2e 4 3.294s 3.294s 3.298s 3.298s
parse 4 24µs 27µs 33µs 33µs
reserve 4 4ms 5ms 6ms 6ms
route 4 18µs 23µs 26µs 26µs
encrypt 4 554µs 573µs 590µs 590µs
dispatch 4 57µs 73µs 83µs 83µs
coordinator_to_provider 4 1.752s 1.752s 1.754s 1.754s

Assertion Report: PASS

Assertion Result Detail
parse:mean<=1ms PASS mean=23.75µs (threshold=1ms)
parse:p95<=5ms PASS p95=33µs (threshold=5ms)
reserve:mean<=50ms PASS mean=4.46ms (threshold=50ms)
reserve:p95<=200ms PASS p95=6.28ms (threshold=200ms)
encrypt:mean<=5ms PASS mean=553.5µs (threshold=5ms)
encrypt:p95<=50ms PASS p95=590µs (threshold=50ms)
dispatch:mean<=5ms PASS mean=56.75µs (threshold=5ms)
dispatch:p95<=50ms PASS p95=83µs (threshold=50ms)

7-provider-multi-model

7 providers, 5 users, 50 requests, concurrency=10, streaming=true

Model Providers RAM
mlx-community/Qwen3.5-0.8B-MLX-4bit 4 0.5 GB
mlx-community/gemma-3-270m-4bit 3 0.2 GB
Metric Value
Total Requests 50
Success 50
Errors 0
Total Duration 16.732s
Throughput 3.0 req/s

Latency Decomposition

Segment Count Mean P50 P95 Max
total_e2e 50 738ms 168ms 4.174s 4.267s
parse 49 31µs 20µs 127µs 187µs
reserve 49 2ms 2ms 3ms 3ms
route 49 33µs 27µs 88µs 109µs
encrypt 50 1ms 1ms 1ms 3ms
dispatch 50 0s 0s 0s 1ms
coordinator_to_provider 50 683ms 164ms 4.063s 4.262s

Assertion Report: PASS

Assertion Result Detail
parse:mean<=1ms PASS mean=31.469µs (threshold=1ms)
parse:p95<=5ms PASS p95=127µs (threshold=5ms)
reserve:mean<=50ms PASS mean=1.683775ms (threshold=50ms)
reserve:p95<=200ms PASS p95=2.608ms (threshold=200ms)
encrypt:mean<=5ms PASS mean=601.12µs (threshold=5ms)
encrypt:p95<=50ms PASS p95=1.021ms (threshold=50ms)
dispatch:mean<=5ms PASS mean=67.82µs (threshold=5ms)
dispatch:p95<=50ms PASS p95=126µs (threshold=50ms)

3-provider-high-concurrency

3 providers, 10 users, 60 requests, concurrency=20, streaming=true

Model Providers RAM
mlx-community/Qwen3.5-0.8B-MLX-4bit 3 0.5 GB
Metric Value
Total Requests 60
Success 12
Errors 48
Total Duration 4.054s
Throughput 3.0 req/s

Latency Decomposition

Segment Count Mean P50 P95 Max
total_e2e 12 2.196s 2.19s 2.225s 2.225s
parse 12 58µs 14µs 313µs 313µs
reserve 12 3ms 3ms 3ms 3ms
route 12 15µs 12µs 55µs 55µs
encrypt 12 615µs 618µs 822µs 822µs
dispatch 12 32µs 20µs 96µs 96µs
coordinator_to_provider 12 2.187s 2.182s 2.218s 2.218s

Assertion Report: PASS

Assertion Result Detail
parse:mean<=1ms PASS mean=58.166µs (threshold=1ms)
parse:p95<=5ms PASS p95=313µs (threshold=5ms)
reserve:mean<=50ms PASS mean=2.734083ms (threshold=50ms)
reserve:p95<=200ms PASS p95=3.169ms (threshold=200ms)
encrypt:mean<=5ms PASS mean=615.166µs (threshold=5ms)
encrypt:p95<=50ms PASS p95=822µs (threshold=50ms)
dispatch:mean<=5ms PASS mean=31.916µs (threshold=5ms)
dispatch:p95<=50ms PASS p95=96µs (threshold=50ms)

1-provider-queue-saturation

1 providers, 10 users, 40 requests, concurrency=15, streaming=true

Model Providers RAM
mlx-community/Qwen3.5-0.8B-MLX-4bit 1 0.5 GB
Metric Value
Total Requests 40
Success 4
Errors 36
Total Duration 3.647s
Throughput 1.1 req/s

Latency Decomposition

Segment Count Mean P50 P95 Max
total_e2e 4 2.208s 2.208s 2.208s 2.208s
parse 4 16µs 15µs 27µs 27µs
reserve 4 2ms 2ms 2ms 2ms
route 4 22µs 29µs 37µs 37µs
encrypt 4 469µs 454µs 708µs 708µs
dispatch 4 28µs 30µs 32µs 32µs
coordinator_to_provider 4 2.202s 2.202s 2.203s 2.203s

Assertion Report: PASS

Assertion Result Detail
parse:mean<=1ms PASS mean=16.25µs (threshold=1ms)
parse:p95<=5ms PASS p95=27µs (threshold=5ms)
reserve:mean<=50ms PASS mean=2.14175ms (threshold=50ms)
reserve:p95<=200ms PASS p95=2.187ms (threshold=200ms)
encrypt:mean<=5ms PASS mean=468.5µs (threshold=5ms)
encrypt:p95<=50ms PASS p95=708µs (threshold=50ms)
dispatch:mean<=5ms PASS mean=27.5µs (threshold=5ms)
dispatch:p95<=50ms PASS p95=32µs (threshold=50ms)

3-provider-20-users

3 providers, 20 users, 60 requests, concurrency=10, streaming=true

Model Providers RAM
mlx-community/Qwen3.5-0.8B-MLX-4bit 3 0.5 GB
Metric Value
Total Requests 60
Success 46
Errors 14
Total Duration 7.706s
Throughput 6.0 req/s

Latency Decomposition

Segment Count Mean P50 P95 Max
total_e2e 46 555ms 90ms 2.289s 2.29s
parse 46 20µs 17µs 30µs 121µs
reserve 46 1ms 1ms 2ms 3ms
route 46 19µs 18µs 32µs 47µs
encrypt 46 420µs 376µs 694µs 816µs
dispatch 46 36µs 28µs 72µs 169µs
coordinator_to_provider 46 552ms 87ms 2.28s 2.283s

Assertion Report: PASS

Assertion Result Detail
parse:mean<=1ms PASS mean=19.652µs (threshold=1ms)
parse:p95<=5ms PASS p95=30µs (threshold=5ms)
reserve:mean<=50ms PASS mean=1.393869ms (threshold=50ms)
reserve:p95<=200ms PASS p95=2.468ms (threshold=200ms)
encrypt:mean<=5ms PASS mean=420.217µs (threshold=5ms)
encrypt:p95<=50ms PASS p95=694µs (threshold=50ms)
dispatch:mean<=5ms PASS mean=36.347µs (threshold=5ms)
dispatch:p95<=50ms PASS p95=72µs (threshold=50ms)

1-provider-scaling

1 providers, 5 users, 30 requests, concurrency=10, streaming=true

Model Providers RAM
mlx-community/Qwen3.5-0.8B-MLX-4bit 1 0.5 GB
Metric Value
Total Requests 30
Success 4
Errors 26
Total Duration 3.184s
Throughput 1.3 req/s

Latency Decomposition

Segment Count Mean P50 P95 Max
total_e2e 4 1.878s 1.878s 1.879s 1.879s
parse 4 16µs 17µs 23µs 23µs
reserve 4 2ms 2ms 2ms 2ms
route 4 13µs 13µs 15µs 15µs
encrypt 4 511µs 543µs 588µs 588µs
dispatch 4 38µs 40µs 62µs 62µs
coordinator_to_provider 4 1.873s 1.873s 1.873s 1.873s

Assertion Report: PASS

Assertion Result Detail
parse:mean<=1ms PASS mean=15.75µs (threshold=1ms)
parse:p95<=5ms PASS p95=23µs (threshold=5ms)
reserve:mean<=50ms PASS mean=2.118ms (threshold=50ms)
reserve:p95<=200ms PASS p95=2.304ms (threshold=200ms)
encrypt:mean<=5ms PASS mean=510.5µs (threshold=5ms)
encrypt:p95<=50ms PASS p95=588µs (threshold=50ms)
dispatch:mean<=5ms PASS mean=38µs (threshold=5ms)
dispatch:p95<=50ms PASS p95=62µs (threshold=50ms)

3-provider-scaling

3 providers, 5 users, 30 requests, concurrency=10, streaming=true

Model Providers RAM
mlx-community/Qwen3.5-0.8B-MLX-4bit 3 0.5 GB
Metric Value
Total Requests 30
Success 30
Errors 0
Total Duration 5.908s
Throughput 5.1 req/s

Latency Decomposition

Segment Count Mean P50 P95 Max
total_e2e 30 751ms 154ms 2.162s 2.162s
parse 30 28µs 18µs 83µs 97µs
reserve 30 3ms 2ms 6ms 7ms
route 30 35µs 16µs 182µs 226µs
encrypt 30 1ms 1ms 1ms 1ms
dispatch 30 36µs 29µs 87µs 96µs
coordinator_to_provider 30 743ms 148ms 2.145s 2.145s

Assertion Report: PASS

Assertion Result Detail
parse:mean<=1ms PASS mean=28.133µs (threshold=1ms)
parse:p95<=5ms PASS p95=83µs (threshold=5ms)
reserve:mean<=50ms PASS mean=2.762433ms (threshold=50ms)
reserve:p95<=200ms PASS p95=5.706ms (threshold=200ms)
encrypt:mean<=5ms PASS mean=568µs (threshold=5ms)
encrypt:p95<=50ms PASS p95=1.059ms (threshold=50ms)
dispatch:mean<=5ms PASS mean=36.066µs (threshold=5ms)
dispatch:p95<=50ms PASS p95=87µs (threshold=50ms)

5-provider-scaling

5 providers, 5 users, 30 requests, concurrency=10, streaming=true

Model Providers RAM
mlx-community/Qwen3.5-0.8B-MLX-4bit 5 0.5 GB
Metric Value
Total Requests 30
Success 30
Errors 0
Total Duration 7.053s
Throughput 4.3 req/s

Latency Decomposition

Segment Count Mean P50 P95 Max
total_e2e 30 773ms 11ms 2.309s 2.309s
parse 30 26µs 21µs 64µs 107µs
reserve 30 5ms 2ms 15ms 16ms
route 30 48µs 27µs 180µs 203µs
encrypt 30 1ms 1ms 2ms 2ms
dispatch 30 51µs 36µs 131µs 363µs
coordinator_to_provider 30 761ms 6ms 2.281s 2.283s

Assertion Report: PASS

Assertion Result Detail
parse:mean<=1ms PASS mean=25.633µs (threshold=1ms)
parse:p95<=5ms PASS p95=64µs (threshold=5ms)
reserve:mean<=50ms PASS mean=4.9593ms (threshold=50ms)
reserve:p95<=200ms PASS p95=15.451ms (threshold=200ms)
encrypt:mean<=5ms PASS mean=776.766µs (threshold=5ms)
encrypt:p95<=50ms PASS p95=1.634ms (threshold=50ms)
dispatch:mean<=5ms PASS mean=50.966µs (threshold=5ms)
dispatch:p95<=50ms PASS p95=131µs (threshold=50ms)

3-provider-heavy-100conc-10kb

3 providers, 20 users, 100 requests, concurrency=100, streaming=true

Model Providers RAM
mlx-community/Qwen3.5-0.8B-MLX-4bit 3 0.5 GB
Metric Value
Total Requests 100
Success 13
Errors 87
Total Duration 4.654s
Throughput 2.8 req/s

Latency Decomposition

Segment Count Mean P50 P95 Max
total_e2e 13 2.387s 2.273s 3.802s 3.802s
parse 13 93µs 77µs 192µs 192µs
reserve 13 9ms 9ms 9ms 9ms
route 13 289ms 0s 3.76s 3.76s
queue_wait 1 3.761s 3.761s 3.761s 3.761s
encrypt 13 19ms 21ms 21ms 21ms
dispatch 13 39µs 31µs 103µs 103µs
coordinator_to_provider 13 2.056s 2.231s 2.244s 2.244s

Assertion Report: FAIL

Assertion Result Detail
parse:mean<=1ms PASS mean=92.615µs (threshold=1ms)
parse:p95<=5ms PASS p95=192µs (threshold=5ms)
reserve:mean<=50ms PASS mean=8.767923ms (threshold=50ms)
reserve:p95<=200ms PASS p95=9.162ms (threshold=200ms)
encrypt:mean<=5ms FAIL mean=19.476615ms (threshold=5ms)
encrypt:p95<=50ms PASS p95=21.38ms (threshold=50ms)
dispatch:mean<=5ms PASS mean=39.076µs (threshold=5ms)
dispatch:p95<=50ms PASS p95=103µs (threshold=50ms)

@github-actions

github-actions Bot commented May 25, 2026 •

Copy link
Copy Markdown
Contributor

Benchmark Results

Runner: macos-15 (M1 Virtual) | Date: 2026-05-25 20:15 UTC

1-provider-streaming

1 providers, 1 users, 30 requests, concurrency=5, streaming=true

Model Providers RAM
mlx-community/Qwen3.5-0.8B-MLX-4bit 1 0.5 GB
Metric Value
Total Requests 30
Success 4
Errors 26
Total Duration 4.938s
Throughput 0.8 req/s

Latency Decomposition

Segment Count Mean P50 P95 Max
total_e2e 4 1.712s 1.712s 1.712s 1.712s
parse 4 52µs 64µs 78µs 78µs
reserve 4 4ms 4ms 5ms 5ms
route 4 17µs 16µs 39µs 39µs
encrypt 4 402µs 399µs 450µs 450µs
dispatch 4 30µs 29µs 45µs 45µs
coordinator_to_provider 4 1.703s 1.703s 1.704s 1.704s

Assertion Report: PASS

Assertion Result Detail
parse:mean<=1ms PASS mean=52µs (threshold=1ms)
parse:p95<=5ms PASS p95=78µs (threshold=5ms)
reserve:mean<=50ms PASS mean=3.7735ms (threshold=50ms)
reserve:p95<=200ms PASS p95=5.467ms (threshold=200ms)
encrypt:mean<=5ms PASS mean=401.5µs (threshold=5ms)
encrypt:p95<=50ms PASS p95=450µs (threshold=50ms)
dispatch:mean<=5ms PASS mean=29.5µs (threshold=5ms)
dispatch:p95<=50ms PASS p95=45µs (threshold=50ms)

1-provider-non-streaming

1 providers, 1 users, 20 requests, concurrency=5, streaming=false

Model Providers RAM
mlx-community/Qwen3.5-0.8B-MLX-4bit 1 0.5 GB
Metric Value
Total Requests 20
Success 4
Errors 16
Total Duration 3.414s
Throughput 1.2 req/s

Latency Decomposition

Segment Count Mean P50 P95 Max
total_e2e 4 3.41s 3.411s 3.413s 3.413s
parse 4 40µs 55µs 60µs 60µs
reserve 4 7ms 6ms 13ms 13ms
route 4 26µs 31µs 32µs 32µs
encrypt 4 811µs 815µs 836µs 836µs
dispatch 4 61µs 55µs 116µs 116µs
coordinator_to_provider 4 1.714s 1.717s 1.718s 1.718s

Assertion Report: PASS

Assertion Result Detail
parse:mean<=1ms PASS mean=39.5µs (threshold=1ms)
parse:p95<=5ms PASS p95=60µs (threshold=5ms)
reserve:mean<=50ms PASS mean=6.84375ms (threshold=50ms)
reserve:p95<=200ms PASS p95=13.121ms (threshold=200ms)
encrypt:mean<=5ms PASS mean=811.25µs (threshold=5ms)
encrypt:p95<=50ms PASS p95=836µs (threshold=50ms)
dispatch:mean<=5ms PASS mean=61.25µs (threshold=5ms)
dispatch:p95<=50ms PASS p95=116µs (threshold=50ms)

7-provider-multi-model

7 providers, 5 users, 50 requests, concurrency=10, streaming=true

Model Providers RAM
mlx-community/Qwen3.5-0.8B-MLX-4bit 4 0.5 GB
mlx-community/gemma-3-270m-4bit 3 0.2 GB
Metric Value
Total Requests 50
Success 50
Errors 0
Total Duration 13.918s
Throughput 3.6 req/s

Latency Decomposition

Segment Count Mean P50 P95 Max
total_e2e 50 699ms 164ms 3.714s 3.843s
parse 49 23µs 18µs 50µs 124µs
reserve 49 2ms 1ms 3ms 4ms
route 49 29µs 24µs 72µs 174µs
encrypt 50 1ms 1ms 1ms 2ms
dispatch 50 50µs 31µs 133µs 433µs
coordinator_to_provider 50 645ms 161ms 3.685s 3.835s

Assertion Report: PASS

Assertion Result Detail
parse:mean<=1ms PASS mean=23.163µs (threshold=1ms)
parse:p95<=5ms PASS p95=50µs (threshold=5ms)
reserve:mean<=50ms PASS mean=1.634693ms (threshold=50ms)
reserve:p95<=200ms PASS p95=3.103ms (threshold=200ms)
encrypt:mean<=5ms PASS mean=525.84µs (threshold=5ms)
encrypt:p95<=50ms PASS p95=771µs (threshold=50ms)
dispatch:mean<=5ms PASS mean=50.38µs (threshold=5ms)
dispatch:p95<=50ms PASS p95=133µs (threshold=50ms)

3-provider-high-concurrency

3 providers, 10 users, 60 requests, concurrency=20, streaming=true

Model Providers RAM
mlx-community/Qwen3.5-0.8B-MLX-4bit 3 0.5 GB
Metric Value
Total Requests 60
Success 12
Errors 48
Total Duration 4.072s
Throughput 2.9 req/s

Latency Decomposition

Segment Count Mean P50 P95 Max
total_e2e 12 2.286s 2.31s 2.314s 2.314s
parse 12 17µs 18µs 27µs 27µs
reserve 12 2ms 2ms 4ms 4ms
route 12 19µs 14µs 60µs 60µs
encrypt 12 435µs 437µs 600µs 600µs
dispatch 12 24µs 24µs 45µs 45µs
coordinator_to_provider 12 2.275s 2.3s 2.307s 2.307s

Assertion Report: PASS

Assertion Result Detail
parse:mean<=1ms PASS mean=17µs (threshold=1ms)
parse:p95<=5ms PASS p95=27µs (threshold=5ms)
reserve:mean<=50ms PASS mean=2.41375ms (threshold=50ms)
reserve:p95<=200ms PASS p95=3.797ms (threshold=200ms)
encrypt:mean<=5ms PASS mean=434.5µs (threshold=5ms)
encrypt:p95<=50ms PASS p95=600µs (threshold=50ms)
dispatch:mean<=5ms PASS mean=24.166µs (threshold=5ms)
dispatch:p95<=50ms PASS p95=45µs (threshold=50ms)

1-provider-queue-saturation

1 providers, 10 users, 40 requests, concurrency=15, streaming=true

Model Providers RAM
mlx-community/Qwen3.5-0.8B-MLX-4bit 1 0.5 GB
Metric Value
Total Requests 40
Success 4
Errors 36
Total Duration 3.89s
Throughput 1.0 req/s

Latency Decomposition

Segment Count Mean P50 P95 Max
total_e2e 4 2.193s 2.193s 2.193s 2.193s
parse 4 145µs 190µs 363µs 363µs
reserve 4 3ms 3ms 3ms 3ms
route 4 11µs 12µs 14µs 14µs
encrypt 4 1ms 1ms 1ms 1ms
dispatch 4 46µs 42µs 95µs 95µs
coordinator_to_provider 4 2.186s 2.187s 2.187s 2.187s

Assertion Report: PASS

Assertion Result Detail
parse:mean<=1ms PASS mean=145µs (threshold=1ms)
parse:p95<=5ms PASS p95=363µs (threshold=5ms)
reserve:mean<=50ms PASS mean=2.9085ms (threshold=50ms)
reserve:p95<=200ms PASS p95=3.034ms (threshold=200ms)
encrypt:mean<=5ms PASS mean=855.25µs (threshold=5ms)
encrypt:p95<=50ms PASS p95=1.258ms (threshold=50ms)
dispatch:mean<=5ms PASS mean=45.5µs (threshold=5ms)
dispatch:p95<=50ms PASS p95=95µs (threshold=50ms)

3-provider-20-users

3 providers, 20 users, 60 requests, concurrency=10, streaming=true

Model Providers RAM
mlx-community/Qwen3.5-0.8B-MLX-4bit 3 0.5 GB
Metric Value
Total Requests 60
Success 60
Errors 0
Total Duration 9.614s
Throughput 6.2 req/s

Latency Decomposition

Segment Count Mean P50 P95 Max
total_e2e 60 456ms 94ms 2.402s 2.402s
parse 60 20µs 16µs 43µs 60µs
reserve 60 1ms 1ms 3ms 3ms
route 60 21µs 19µs 42µs 53µs
encrypt 60 389µs 346µs 704µs 871µs
dispatch 60 37µs 26µs 99µs 128µs
coordinator_to_provider 60 453ms 92ms 2.394s 2.396s

Assertion Report: PASS

Assertion Result Detail
parse:mean<=1ms PASS mean=20µs (threshold=1ms)
parse:p95<=5ms PASS p95=43µs (threshold=5ms)
reserve:mean<=50ms PASS mean=1.341933ms (threshold=50ms)
reserve:p95<=200ms PASS p95=2.877ms (threshold=200ms)
encrypt:mean<=5ms PASS mean=389.183µs (threshold=5ms)
encrypt:p95<=50ms PASS p95=704µs (threshold=50ms)
dispatch:mean<=5ms PASS mean=36.566µs (threshold=5ms)
dispatch:p95<=50ms PASS p95=99µs (threshold=50ms)

1-provider-scaling

1 providers, 5 users, 30 requests, concurrency=10, streaming=true

Model Providers RAM
mlx-community/Qwen3.5-0.8B-MLX-4bit 1 0.5 GB
Metric Value
Total Requests 30
Success 4
Errors 26
Total Duration 3.61s
Throughput 1.1 req/s

Latency Decomposition

Segment Count Mean P50 P95 Max
total_e2e 4 2.09s 2.091s 2.091s 2.091s
parse 4 16µs 18µs 19µs 19µs
reserve 4 2ms 2ms 2ms 2ms
route 4 34µs 25µs 83µs 83µs
encrypt 4 419µs 409µs 521µs 521µs
dispatch 4 45µs 49µs 60µs 60µs
coordinator_to_provider 4 2.085s 2.086s 2.086s 2.086s

Assertion Report: PASS

Assertion Result Detail
parse:mean<=1ms PASS mean=15.5µs (threshold=1ms)
parse:p95<=5ms PASS p95=19µs (threshold=5ms)
reserve:mean<=50ms PASS mean=1.9545ms (threshold=50ms)
reserve:p95<=200ms PASS p95=2.18ms (threshold=200ms)
encrypt:mean<=5ms PASS mean=419.25µs (threshold=5ms)
encrypt:p95<=50ms PASS p95=521µs (threshold=50ms)
dispatch:mean<=5ms PASS mean=45.25µs (threshold=5ms)
dispatch:p95<=50ms PASS p95=60µs (threshold=50ms)

3-provider-scaling

3 providers, 5 users, 30 requests, concurrency=10, streaming=true

Model Providers RAM
mlx-community/Qwen3.5-0.8B-MLX-4bit 3 0.5 GB
Metric Value
Total Requests 30
Success 30
Errors 0
Total Duration 6.122s
Throughput 4.9 req/s

Latency Decomposition

Segment Count Mean P50 P95 Max
total_e2e 30 768ms 90ms 2.221s 2.221s
parse 30 19µs 17µs 40µs 63µs
reserve 30 2ms 2ms 3ms 5ms
route 30 20µs 17µs 39µs 125µs
encrypt 30 0s 0s 1ms 1ms
dispatch 30 37µs 28µs 90µs 124µs
coordinator_to_provider 30 763ms 88ms 2.214s 2.215s

Assertion Report: PASS

Assertion Result Detail
parse:mean<=1ms PASS mean=19.433µs (threshold=1ms)
parse:p95<=5ms PASS p95=40µs (threshold=5ms)
reserve:mean<=50ms PASS mean=1.8769ms (threshold=50ms)
reserve:p95<=200ms PASS p95=3.497ms (threshold=200ms)
encrypt:mean<=5ms PASS mean=459.033µs (threshold=5ms)
encrypt:p95<=50ms PASS p95=814µs (threshold=50ms)
dispatch:mean<=5ms PASS mean=36.566µs (threshold=5ms)
dispatch:p95<=50ms PASS p95=90µs (threshold=50ms)

5-provider-scaling

5 providers, 5 users, 30 requests, concurrency=10, streaming=true

Model Providers RAM
mlx-community/Qwen3.5-0.8B-MLX-4bit 5 0.5 GB
Metric Value
Total Requests 30
Success 30
Errors 0
Total Duration 6.908s
Throughput 4.3 req/s

Latency Decomposition

Segment Count Mean P50 P95 Max
total_e2e 30 799ms 9ms 2.382s 2.382s
parse 30 22µs 18µs 44µs 64µs
reserve 30 2ms 2ms 3ms 4ms
route 30 28µs 25µs 57µs 76µs
encrypt 30 502µs 488µs 804µs 860µs
dispatch 30 33µs 29µs 72µs 101µs
coordinator_to_provider 30 794ms 5ms 2.37s 2.376s

Assertion Report: PASS

Assertion Result Detail
parse:mean<=1ms PASS mean=22.166µs (threshold=1ms)
parse:p95<=5ms PASS p95=44µs (threshold=5ms)
reserve:mean<=50ms PASS mean=1.963933ms (threshold=50ms)
reserve:p95<=200ms PASS p95=3.343ms (threshold=200ms)
encrypt:mean<=5ms PASS mean=502.366µs (threshold=5ms)
encrypt:p95<=50ms PASS p95=804µs (threshold=50ms)
dispatch:mean<=5ms PASS mean=33.333µs (threshold=5ms)
dispatch:p95<=50ms PASS p95=72µs (threshold=50ms)

3-provider-heavy-100conc-10kb

3 providers, 20 users, 100 requests, concurrency=100, streaming=true

Model Providers RAM
mlx-community/Qwen3.5-0.8B-MLX-4bit 3 0.5 GB
Metric Value
Total Requests 100
Success 12
Errors 88
Total Duration 3.974s
Throughput 3.0 req/s

Latency Decomposition

Segment Count Mean P50 P95 Max
total_e2e 12 2.189s 2.188s 2.205s 2.205s
parse 12 1ms 1ms 2ms 2ms
reserve 12 8ms 7ms 10ms 10ms
route 12 16µs 16µs 27µs 27µs
encrypt 12 27ms 27ms 29ms 29ms
dispatch 12 45µs 44µs 67µs 67µs
coordinator_to_provider 12 2.142s 2.142s 2.157s 2.157s

Assertion Report: FAIL

Assertion Result Detail
parse:mean<=1ms PASS mean=742.666µs (threshold=1ms)
parse:p95<=5ms PASS p95=1.72ms (threshold=5ms)
reserve:mean<=50ms PASS mean=7.618583ms (threshold=50ms)
reserve:p95<=200ms PASS p95=9.92ms (threshold=200ms)
encrypt:mean<=5ms FAIL mean=27.081333ms (threshold=5ms)
encrypt:p95<=50ms PASS p95=28.558ms (threshold=50ms)
dispatch:mean<=5ms PASS mean=45.083µs (threshold=5ms)
dispatch:p95<=50ms PASS p95=67µs (threshold=50ms)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5310503c5b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread coordinator/api/stats.go Outdated
Comment on lines +416 to +417
for i := 0; i < b.Providers; i++ {
ra.providers[strings.Repeat("p", i+1)] = struct{}{}

This comment was marked as resolved.

Comment thread coordinator/store/postgres.go Outdated
Comment on lines 749 to 750
VALUES ($1, $2, $3, $4, $5, $6, $7)`,
providerID, h, model, promptTokens, completionTokens, requestID, costMicroUSD,

This comment was marked as resolved.

Comment thread coordinator/api/stats.go Outdated
Comment on lines +466 to +467
consumerCity, consumerCountry string
providerCity, providerCountry string

This comment was marked as resolved.

Comment thread coordinator/api/provider_geo.go Outdated
Comment on lines +65 to +67
if g.trustHeaders {
if loc := locationFromTrustedGeoHeaders(r); loc != nil {
return loc

This comment was marked as resolved.

Comment thread coordinator/api/stats.go
Comment on lines +475 to +481
// Build a provider location lookup from the live fleet.
providerLocs := make(map[string]*store.ProviderLocation)
s.registry.ForEachProvider(func(p *registry.Provider) {
if p.Location != nil {
cp := *p.Location
providerLocs[p.ID] = &cp
}

This comment was marked as resolved.

Comment thread coordinator/api/stats.go Outdated
Comment on lines +358 to +360
allRecords := s.store.UsageRecords()
var totalInWindow int64
for _, rec := range allRecords {

This comment was marked as resolved.

Comment thread coordinator/api/stats.go
Comment on lines +533 to +538
for _, fa := range flows {
out = append(out, publicRequestFlowBucket{
From: fa.from,
To: fa.to,
Requests: fa.requests,
})

This comment was marked as resolved.

if ip == nil {
return false
}
return ip.IsLoopback() || ip.IsPrivate()

This comment was marked as resolved.

@github-actions

github-actions Bot commented May 25, 2026 •

Copy link
Copy Markdown
Contributor

Benchmark Results

Runner: macos-15 (M1 Virtual) | Date: 2026-05-25 20:28 UTC

1-provider-streaming

1 providers, 1 users, 30 requests, concurrency=5, streaming=true

Model Providers RAM
mlx-community/Qwen3.5-0.8B-MLX-4bit 1 0.5 GB
Metric Value
Total Requests 30
Success 4
Errors 26
Total Duration 4.932s
Throughput 0.8 req/s

Latency Decomposition

Segment Count Mean P50 P95 Max
total_e2e 4 1.743s 1.743s 1.744s 1.744s
parse 4 31µs 19µs 73µs 73µs
reserve 4 4ms 4ms 6ms 6ms
route 4 25µs 28µs 38µs 38µs
encrypt 4 532µs 536µs 560µs 560µs
dispatch 4 39µs 46µs 59µs 59µs
coordinator_to_provider 4 1.735s 1.736s 1.737s 1.737s

Assertion Report: PASS

Assertion Result Detail
parse:mean<=1ms PASS mean=30.75µs (threshold=1ms)
parse:p95<=5ms PASS p95=73µs (threshold=5ms)
reserve:mean<=50ms PASS mean=3.8535ms (threshold=50ms)
reserve:p95<=200ms PASS p95=5.811ms (threshold=200ms)
encrypt:mean<=5ms PASS mean=532.25µs (threshold=5ms)
encrypt:p95<=50ms PASS p95=560µs (threshold=50ms)
dispatch:mean<=5ms PASS mean=38.75µs (threshold=5ms)
dispatch:p95<=50ms PASS p95=59µs (threshold=50ms)

1-provider-non-streaming

1 providers, 1 users, 20 requests, concurrency=5, streaming=false

Model Providers RAM
mlx-community/Qwen3.5-0.8B-MLX-4bit 1 0.5 GB
Metric Value
Total Requests 20
Success 4
Errors 16
Total Duration 3.372s
Throughput 1.2 req/s

Latency Decomposition

Segment Count Mean P50 P95 Max
total_e2e 4 3.367s 3.369s 3.372s 3.372s
parse 4 14µs 15µs 20µs 20µs
reserve 4 3ms 3ms 4ms 4ms
route 4 12µs 12µs 16µs 16µs
encrypt 4 389µs 435µs 464µs 464µs
dispatch 4 28µs 34µs 47µs 47µs
coordinator_to_provider 4 1.768s 1.769s 1.769s 1.769s

Assertion Report: PASS

Assertion Result Detail
parse:mean<=1ms PASS mean=13.5µs (threshold=1ms)
parse:p95<=5ms PASS p95=20µs (threshold=5ms)
reserve:mean<=50ms PASS mean=2.89125ms (threshold=50ms)
reserve:p95<=200ms PASS p95=4.275ms (threshold=200ms)
encrypt:mean<=5ms PASS mean=389.25µs (threshold=5ms)
encrypt:p95<=50ms PASS p95=464µs (threshold=50ms)
dispatch:mean<=5ms PASS mean=28µs (threshold=5ms)
dispatch:p95<=50ms PASS p95=47µs (threshold=50ms)

7-provider-multi-model

7 providers, 5 users, 50 requests, concurrency=10, streaming=true

Model Providers RAM
mlx-community/Qwen3.5-0.8B-MLX-4bit 4 0.5 GB
mlx-community/gemma-3-270m-4bit 3 0.2 GB
Metric Value
Total Requests 50
Success 50
Errors 0
Total Duration 12.994s
Throughput 3.8 req/s

Latency Decomposition

Segment Count Mean P50 P95 Max
total_e2e 50 668ms 166ms 3.648s 3.779s
parse 49 24µs 19µs 43µs 146µs
reserve 49 2ms 1ms 4ms 5ms
route 49 29µs 22µs 58µs 116µs
encrypt 50 1ms 1ms 1ms 1ms
dispatch 50 41µs 35µs 75µs 140µs
coordinator_to_provider 50 614ms 164ms 3.614s 3.768s

Assertion Report: PASS

Assertion Result Detail
parse:mean<=1ms PASS mean=24.265µs (threshold=1ms)
parse:p95<=5ms PASS p95=43µs (threshold=5ms)
reserve:mean<=50ms PASS mean=1.634938ms (threshold=50ms)
reserve:p95<=200ms PASS p95=3.536ms (threshold=200ms)
encrypt:mean<=5ms PASS mean=533.82µs (threshold=5ms)
encrypt:p95<=50ms PASS p95=829µs (threshold=50ms)
dispatch:mean<=5ms PASS mean=41.3µs (threshold=5ms)
dispatch:p95<=50ms PASS p95=75µs (threshold=50ms)

3-provider-high-concurrency

3 providers, 10 users, 60 requests, concurrency=20, streaming=true

Model Providers RAM
mlx-community/Qwen3.5-0.8B-MLX-4bit 3 0.5 GB
Metric Value
Total Requests 60
Success 12
Errors 48
Total Duration 3.441s
Throughput 3.5 req/s

Latency Decomposition

Segment Count Mean P50 P95 Max
total_e2e 12 1.988s 1.991s 2s 2s
parse 12 35µs 29µs 84µs 84µs
reserve 12 6ms 7ms 8ms 8ms
route 12 148µs 31µs 661µs 661µs
encrypt 12 1ms 1ms 2ms 2ms
dispatch 12 90µs 56µs 534µs 534µs
coordinator_to_provider 12 1.959s 1.963s 1.974s 1.974s

Assertion Report: PASS

Assertion Result Detail
parse:mean<=1ms PASS mean=35.333µs (threshold=1ms)
parse:p95<=5ms PASS p95=84µs (threshold=5ms)
reserve:mean<=50ms PASS mean=6.498ms (threshold=50ms)
reserve:p95<=200ms PASS p95=8.035ms (threshold=200ms)
encrypt:mean<=5ms PASS mean=1.39525ms (threshold=5ms)
encrypt:p95<=50ms PASS p95=2.04ms (threshold=50ms)
dispatch:mean<=5ms PASS mean=90.333µs (threshold=5ms)
dispatch:p95<=50ms PASS p95=534µs (threshold=50ms)

1-provider-queue-saturation

1 providers, 10 users, 40 requests, concurrency=15, streaming=true

Model Providers RAM
mlx-community/Qwen3.5-0.8B-MLX-4bit 1 0.5 GB
Metric Value
Total Requests 40
Success 4
Errors 36
Total Duration 3.771s
Throughput 1.1 req/s

Latency Decomposition

Segment Count Mean P50 P95 Max
total_e2e 4 2.351s 2.352s 2.352s 2.352s
parse 4 16µs 17µs 23µs 23µs
reserve 4 2ms 2ms 3ms 3ms
route 4 18µs 19µs 28µs 28µs
encrypt 4 692µs 748µs 824µs 824µs
dispatch 4 23µs 23µs 37µs 37µs
coordinator_to_provider 4 2.345s 2.345s 2.346s 2.346s

Assertion Report: PASS

Assertion Result Detail
parse:mean<=1ms PASS mean=16.25µs (threshold=1ms)
parse:p95<=5ms PASS p95=23µs (threshold=5ms)
reserve:mean<=50ms PASS mean=2.311ms (threshold=50ms)
reserve:p95<=200ms PASS p95=2.555ms (threshold=200ms)
encrypt:mean<=5ms PASS mean=691.5µs (threshold=5ms)
encrypt:p95<=50ms PASS p95=824µs (threshold=50ms)
dispatch:mean<=5ms PASS mean=23.25µs (threshold=5ms)
dispatch:p95<=50ms PASS p95=37µs (threshold=50ms)

3-provider-20-users

3 providers, 20 users, 60 requests, concurrency=10, streaming=true

Model Providers RAM
mlx-community/Qwen3.5-0.8B-MLX-4bit 3 0.5 GB
Metric Value
Total Requests 60
Success 38
Errors 22
Total Duration 7.781s
Throughput 4.9 req/s

Latency Decomposition

Segment Count Mean P50 P95 Max
total_e2e 38 693ms 16ms 2.517s 2.517s
parse 38 18µs 16µs 33µs 37µs
reserve 38 2ms 2ms 3ms 5ms
route 38 20µs 16µs 31µs 159µs
encrypt 38 1ms 0s 1ms 2ms
dispatch 38 31µs 24µs 72µs 139µs
coordinator_to_provider 38 688ms 14ms 2.51s 2.51s

Assertion Report: PASS

Assertion Result Detail
parse:mean<=1ms PASS mean=18.131µs (threshold=1ms)
parse:p95<=5ms PASS p95=33µs (threshold=5ms)
reserve:mean<=50ms PASS mean=1.965026ms (threshold=50ms)
reserve:p95<=200ms PASS p95=3.11ms (threshold=200ms)
encrypt:mean<=5ms PASS mean=566.105µs (threshold=5ms)
encrypt:p95<=50ms PASS p95=1.424ms (threshold=50ms)
dispatch:mean<=5ms PASS mean=30.5µs (threshold=5ms)
dispatch:p95<=50ms PASS p95=72µs (threshold=50ms)

1-provider-scaling

1 providers, 5 users, 30 requests, concurrency=10, streaming=true

Model Providers RAM
mlx-community/Qwen3.5-0.8B-MLX-4bit 1 0.5 GB
Metric Value
Total Requests 30
Success 4
Errors 26
Total Duration 3.87s
Throughput 1.0 req/s

Latency Decomposition

Segment Count Mean P50 P95 Max
total_e2e 4 2.337s 2.337s 2.338s 2.338s
parse 4 21µs 22µs 24µs 24µs
reserve 4 3ms 3ms 3ms 3ms
route 4 14µs 16µs 18µs 18µs
encrypt 4 506µs 536µs 710µs 710µs
dispatch 4 25µs 21µs 56µs 56µs
coordinator_to_provider 4 2.331s 2.331s 2.331s 2.331s

Assertion Report: PASS

Assertion Result Detail
parse:mean<=1ms PASS mean=20.75µs (threshold=1ms)
parse:p95<=5ms PASS p95=24µs (threshold=5ms)
reserve:mean<=50ms PASS mean=3.017ms (threshold=50ms)
reserve:p95<=200ms PASS p95=3.389ms (threshold=200ms)
encrypt:mean<=5ms PASS mean=505.5µs (threshold=5ms)
encrypt:p95<=50ms PASS p95=710µs (threshold=50ms)
dispatch:mean<=5ms PASS mean=25µs (threshold=5ms)
dispatch:p95<=50ms PASS p95=56µs (threshold=50ms)

3-provider-scaling

3 providers, 5 users, 30 requests, concurrency=10, streaming=true

Model Providers RAM
mlx-community/Qwen3.5-0.8B-MLX-4bit 3 0.5 GB
Metric Value
Total Requests 30
Success 30
Errors 0
Total Duration 6.649s
Throughput 4.5 req/s

Latency Decomposition

Segment Count Mean P50 P95 Max
total_e2e 30 851ms 169ms 2.401s 2.401s
parse 30 48µs 17µs 44µs 884µs
reserve 30 2ms 1ms 4ms 4ms
route 30 21µs 19µs 43µs 49µs
encrypt 30 1ms 0s 1ms 1ms
dispatch 30 35µs 26µs 107µs 150µs
coordinator_to_provider 30 846ms 164ms 2.393s 2.395s

Assertion Report: PASS

Assertion Result Detail
parse:mean<=1ms PASS mean=48.333µs (threshold=1ms)
parse:p95<=5ms PASS p95=44µs (threshold=5ms)
reserve:mean<=50ms PASS mean=1.9212ms (threshold=50ms)
reserve:p95<=200ms PASS p95=3.634ms (threshold=200ms)
encrypt:mean<=5ms PASS mean=522.433µs (threshold=5ms)
encrypt:p95<=50ms PASS p95=1.1ms (threshold=50ms)
dispatch:mean<=5ms PASS mean=34.7µs (threshold=5ms)
dispatch:p95<=50ms PASS p95=107µs (threshold=50ms)

5-provider-scaling

5 providers, 5 users, 30 requests, concurrency=10, streaming=true

Model Providers RAM
mlx-community/Qwen3.5-0.8B-MLX-4bit 5 0.5 GB
Metric Value
Total Requests 30
Success 30
Errors 0
Total Duration 6.313s
Throughput 4.8 req/s

Latency Decomposition

Segment Count Mean P50 P95 Max
total_e2e 30 799ms 112ms 2.281s 2.281s
parse 30 20µs 18µs 44µs 48µs
reserve 30 2ms 2ms 3ms 4ms
route 30 24µs 21µs 46µs 51µs
encrypt 30 0s 0s 1ms 1ms
dispatch 30 36µs 26µs 93µs 108µs
coordinator_to_provider 30 795ms 110ms 2.275s 2.276s

Assertion Report: PASS

Assertion Result Detail
parse:mean<=1ms PASS mean=19.8µs (threshold=1ms)
parse:p95<=5ms PASS p95=44µs (threshold=5ms)
reserve:mean<=50ms PASS mean=1.774866ms (threshold=50ms)
reserve:p95<=200ms PASS p95=3.029ms (threshold=200ms)
encrypt:mean<=5ms PASS mean=471.833µs (threshold=5ms)
encrypt:p95<=50ms PASS p95=792µs (threshold=50ms)
dispatch:mean<=5ms PASS mean=36.066µs (threshold=5ms)
dispatch:p95<=50ms PASS p95=93µs (threshold=50ms)

3-provider-heavy-100conc-10kb

3 providers, 20 users, 100 requests, concurrency=100, streaming=true

Model Providers RAM
mlx-community/Qwen3.5-0.8B-MLX-4bit 3 0.5 GB
Metric Value
Total Requests 100
Success 12
Errors 88
Total Duration 4.175s
Throughput 2.9 req/s

Latency Decomposition

Segment Count Mean P50 P95 Max
total_e2e 12 2.188s 2.193s 2.222s 2.222s
parse 12 86µs 94µs 111µs 111µs
reserve 12 7ms 8ms 8ms 8ms
route 12 30µs 28µs 56µs 56µs
encrypt 12 18ms 18ms 19ms 19ms
dispatch 12 56µs 46µs 144µs 144µs
coordinator_to_provider 12 2.152s 2.158s 2.187s 2.187s

Assertion Report: FAIL

Assertion Result Detail
parse:mean<=1ms PASS mean=85.583µs (threshold=1ms)
parse:p95<=5ms PASS p95=111µs (threshold=5ms)
reserve:mean<=50ms PASS mean=7.46025ms (threshold=50ms)
reserve:p95<=200ms PASS p95=8.205ms (threshold=200ms)
encrypt:mean<=5ms FAIL mean=17.82625ms (threshold=5ms)
encrypt:p95<=50ms PASS p95=18.953ms (threshold=50ms)
dispatch:mean<=5ms PASS mean=56.166µs (threshold=5ms)
dispatch:p95<=50ms PASS p95=144µs (threshold=50ms)

@Gajesh2007

Copy link
Copy Markdown
Member Author

@codex can you check?

@github-actions

github-actions Bot commented May 25, 2026 •

Copy link
Copy Markdown
Contributor

Benchmark Results

Runner: macos-15 (M1 Virtual) | Date: 2026-05-25 20:36 UTC

1-provider-streaming

1 providers, 1 users, 30 requests, concurrency=5, streaming=true

Model Providers RAM
mlx-community/Qwen3.5-0.8B-MLX-4bit 1 0.5 GB
Metric Value
Total Requests 30
Success 4
Errors 26
Total Duration 5.178s
Throughput 0.8 req/s

Latency Decomposition

Segment Count Mean P50 P95 Max
total_e2e 4 1.833s 1.833s 1.833s 1.833s
parse 4 54µs 66µs 75µs 75µs
reserve 4 6ms 7ms 9ms 9ms
route 4 27µs 29µs 47µs 47µs
encrypt 4 680µs 704µs 709µs 709µs
dispatch 4 56µs 67µs 69µs 69µs
coordinator_to_provider 4 1.821s 1.822s 1.823s 1.823s

Assertion Report: PASS

Assertion Result Detail
parse:mean<=1ms PASS mean=53.75µs (threshold=1ms)
parse:p95<=5ms PASS p95=75µs (threshold=5ms)
reserve:mean<=50ms PASS mean=5.88375ms (threshold=50ms)
reserve:p95<=200ms PASS p95=8.658ms (threshold=200ms)
encrypt:mean<=5ms PASS mean=679.75µs (threshold=5ms)
encrypt:p95<=50ms PASS p95=709µs (threshold=50ms)
dispatch:mean<=5ms PASS mean=56.25µs (threshold=5ms)
dispatch:p95<=50ms PASS p95=69µs (threshold=50ms)

1-provider-non-streaming

1 providers, 1 users, 20 requests, concurrency=5, streaming=false

Model Providers RAM
mlx-community/Qwen3.5-0.8B-MLX-4bit 1 0.5 GB
Metric Value
Total Requests 20
Success 4
Errors 16
Total Duration 3.433s
Throughput 1.2 req/s

Latency Decomposition

Segment Count Mean P50 P95 Max
total_e2e 4 3.43s 3.431s 3.433s 3.433s
parse 4 16µs 18µs 20µs 20µs
reserve 4 3ms 3ms 4ms 4ms
route 4 11µs 12µs 17µs 17µs
encrypt 4 384µs 402µs 449µs 449µs
dispatch 4 30µs 28µs 43µs 43µs
coordinator_to_provider 4 1.826s 1.827s 1.827s 1.827s

Assertion Report: PASS

Assertion Result Detail
parse:mean<=1ms PASS mean=16.25µs (threshold=1ms)
parse:p95<=5ms PASS p95=20µs (threshold=5ms)
reserve:mean<=50ms PASS mean=2.7195ms (threshold=50ms)
reserve:p95<=200ms PASS p95=3.867ms (threshold=200ms)
encrypt:mean<=5ms PASS mean=384µs (threshold=5ms)
encrypt:p95<=50ms PASS p95=449µs (threshold=50ms)
dispatch:mean<=5ms PASS mean=30µs (threshold=5ms)
dispatch:p95<=50ms PASS p95=43µs (threshold=50ms)

7-provider-multi-model

7 providers, 5 users, 50 requests, concurrency=10, streaming=true

Model Providers RAM
mlx-community/Qwen3.5-0.8B-MLX-4bit 4 0.5 GB
mlx-community/gemma-3-270m-4bit 3 0.2 GB
Metric Value
Total Requests 50
Success 50
Errors 0
Total Duration 15.039s
Throughput 3.3 req/s

Latency Decomposition

Segment Count Mean P50 P95 Max
total_e2e 50 700ms 180ms 3.768s 3.769s
parse 49 28µs 23µs 52µs 117µs
reserve 49 2ms 1ms 4ms 6ms
route 49 33µs 27µs 67µs 172µs
encrypt 50 1ms 1ms 1ms 1ms
dispatch 50 60µs 35µs 210µs 525µs
coordinator_to_provider 50 645ms 177ms 3.64s 3.758s

Assertion Report: PASS

Assertion Result Detail
parse:mean<=1ms PASS mean=27.653µs (threshold=1ms)
parse:p95<=5ms PASS p95=52µs (threshold=5ms)
reserve:mean<=50ms PASS mean=1.873326ms (threshold=50ms)
reserve:p95<=200ms PASS p95=4.124ms (threshold=200ms)
encrypt:mean<=5ms PASS mean=593.18µs (threshold=5ms)
encrypt:p95<=50ms PASS p95=934µs (threshold=50ms)
dispatch:mean<=5ms PASS mean=59.76µs (threshold=5ms)
dispatch:p95<=50ms PASS p95=210µs (threshold=50ms)

3-provider-high-concurrency

3 providers, 10 users, 60 requests, concurrency=20, streaming=true

Model Providers RAM
mlx-community/Qwen3.5-0.8B-MLX-4bit 3 0.5 GB
Metric Value
Total Requests 60
Success 12
Errors 48
Total Duration 3.822s
Throughput 3.1 req/s

Latency Decomposition

Segment Count Mean P50 P95 Max
total_e2e 12 2.178s 2.172s 2.194s 2.194s
parse 12 32µs 17µs 207µs 207µs
reserve 12 2ms 3ms 4ms 4ms
route 12 26µs 14µs 132µs 132µs
encrypt 12 1ms 1ms 1ms 1ms
dispatch 12 40µs 21µs 268µs 268µs
coordinator_to_provider 12 2.169s 2.164s 2.187s 2.187s

Assertion Report: PASS

Assertion Result Detail
parse:mean<=1ms PASS mean=32µs (threshold=1ms)
parse:p95<=5ms PASS p95=207µs (threshold=5ms)
reserve:mean<=50ms PASS mean=2.491833ms (threshold=50ms)
reserve:p95<=200ms PASS p95=3.705ms (threshold=200ms)
encrypt:mean<=5ms PASS mean=704.083µs (threshold=5ms)
encrypt:p95<=50ms PASS p95=1.102ms (threshold=50ms)
dispatch:mean<=5ms PASS mean=39.75µs (threshold=5ms)
dispatch:p95<=50ms PASS p95=268µs (threshold=50ms)

1-provider-queue-saturation

1 providers, 10 users, 40 requests, concurrency=15, streaming=true

Model Providers RAM
mlx-community/Qwen3.5-0.8B-MLX-4bit 1 0.5 GB
Metric Value
Total Requests 40
Success 4
Errors 36
Total Duration 3.737s
Throughput 1.1 req/s

Latency Decomposition

Segment Count Mean P50 P95 Max
total_e2e 4 2.285s 2.285s 2.286s 2.286s
parse 4 17µs 20µs 28µs 28µs
reserve 4 2ms 2ms 2ms 2ms
route 4 29µs 22µs 55µs 55µs
encrypt 4 477µs 504µs 530µs 530µs
dispatch 4 22µs 19µs 35µs 35µs
coordinator_to_provider 4 2.279s 2.279s 2.28s 2.28s

Assertion Report: PASS

Assertion Result Detail
parse:mean<=1ms PASS mean=17µs (threshold=1ms)
parse:p95<=5ms PASS p95=28µs (threshold=5ms)
reserve:mean<=50ms PASS mean=2.10275ms (threshold=50ms)
reserve:p95<=200ms PASS p95=2.289ms (threshold=200ms)
encrypt:mean<=5ms PASS mean=476.75µs (threshold=5ms)
encrypt:p95<=50ms PASS p95=530µs (threshold=50ms)
dispatch:mean<=5ms PASS mean=21.75µs (threshold=5ms)
dispatch:p95<=50ms PASS p95=35µs (threshold=50ms)

3-provider-20-users

3 providers, 20 users, 60 requests, concurrency=10, streaming=true

Model Providers RAM
mlx-community/Qwen3.5-0.8B-MLX-4bit 3 0.5 GB
Metric Value
Total Requests 60
Success 38
Errors 22
Total Duration 7.898s
Throughput 4.8 req/s

Latency Decomposition

Segment Count Mean P50 P95 Max
total_e2e 38 653ms 105ms 2.331s 2.331s
parse 38 22µs 19µs 55µs 72µs
reserve 38 2ms 1ms 3ms 3ms
route 38 18µs 18µs 29µs 44µs
encrypt 38 443µs 416µs 781µs 842µs
dispatch 38 33µs 26µs 71µs 178µs
coordinator_to_provider 38 649ms 103ms 2.325s 2.325s

Assertion Report: PASS

Assertion Result Detail
parse:mean<=1ms PASS mean=22.236µs (threshold=1ms)
parse:p95<=5ms PASS p95=55µs (threshold=5ms)
reserve:mean<=50ms PASS mean=1.502ms (threshold=50ms)
reserve:p95<=200ms PASS p95=2.879ms (threshold=200ms)
encrypt:mean<=5ms PASS mean=442.921µs (threshold=5ms)
encrypt:p95<=50ms PASS p95=781µs (threshold=50ms)
dispatch:mean<=5ms PASS mean=32.526µs (threshold=5ms)
dispatch:p95<=50ms PASS p95=71µs (threshold=50ms)

1-provider-scaling

1 providers, 5 users, 30 requests, concurrency=10, streaming=true

Model Providers RAM
mlx-community/Qwen3.5-0.8B-MLX-4bit 1 0.5 GB
Metric Value
Total Requests 30
Success 5
Errors 25
Total Duration 4.43s
Throughput 1.1 req/s

Latency Decomposition

Segment Count Mean P50 P95 Max
total_e2e 5 2.485s 2.202s 3.617s 3.617s
parse 5 18µs 19µs 20µs 20µs
reserve 5 2ms 2ms 2ms 2ms
route 5 721ms 0s 3.604s 3.604s
queue_wait 1 3.605s 3.605s 3.605s 3.605s
encrypt 5 465µs 492µs 536µs 536µs
dispatch 5 20µs 22µs 23µs 23µs
coordinator_to_provider 5 1.759s 2.197s 2.197s 2.197s

Assertion Report: PASS

Assertion Result Detail
parse:mean<=1ms PASS mean=17.8µs (threshold=1ms)
parse:p95<=5ms PASS p95=20µs (threshold=5ms)
reserve:mean<=50ms PASS mean=1.978ms (threshold=50ms)
reserve:p95<=200ms PASS p95=2.251ms (threshold=200ms)
encrypt:mean<=5ms PASS mean=465.4µs (threshold=5ms)
encrypt:p95<=50ms PASS p95=536µs (threshold=50ms)
dispatch:mean<=5ms PASS mean=20.4µs (threshold=5ms)
dispatch:p95<=50ms PASS p95=23µs (threshold=50ms)

3-provider-scaling

3 providers, 5 users, 30 requests, concurrency=10, streaming=true

Model Providers RAM
mlx-community/Qwen3.5-0.8B-MLX-4bit 3 0.5 GB
Metric Value
Total Requests 30
Success 30
Errors 0
Total Duration 6.078s
Throughput 4.9 req/s

Latency Decomposition

Segment Count Mean P50 P95 Max
total_e2e 30 750ms 119ms 2.131s 2.132s
parse 30 18µs 15µs 56µs 80µs
reserve 30 2ms 1ms 4ms 4ms
route 30 22µs 17µs 47µs 84µs
encrypt 30 0s 0s 1ms 1ms
dispatch 30 50µs 34µs 108µs 216µs
coordinator_to_provider 30 746ms 116ms 2.126s 2.126s

Assertion Report: PASS

Assertion Result Detail
parse:mean<=1ms PASS mean=18.133µs (threshold=1ms)
parse:p95<=5ms PASS p95=56µs (threshold=5ms)
reserve:mean<=50ms PASS mean=1.799866ms (threshold=50ms)
reserve:p95<=200ms PASS p95=3.809ms (threshold=200ms)
encrypt:mean<=5ms PASS mean=462.633µs (threshold=5ms)
encrypt:p95<=50ms PASS p95=1.162ms (threshold=50ms)
dispatch:mean<=5ms PASS mean=49.766µs (threshold=5ms)
dispatch:p95<=50ms PASS p95=108µs (threshold=50ms)

5-provider-scaling

5 providers, 5 users, 30 requests, concurrency=10, streaming=true

Model Providers RAM
mlx-community/Qwen3.5-0.8B-MLX-4bit 5 0.5 GB
Metric Value
Total Requests 30
Success 30
Errors 0
Total Duration 6.767s
Throughput 4.4 req/s

Latency Decomposition

Segment Count Mean P50 P95 Max
total_e2e 30 767ms 16ms 2.274s 2.275s
parse 30 19µs 16µs 53µs 59µs
reserve 30 3ms 2ms 6ms 6ms
route 30 25µs 19µs 65µs 102µs
encrypt 30 1ms 1ms 1ms 1ms
dispatch 30 43µs 23µs 150µs 341µs
coordinator_to_provider 30 761ms 7ms 2.265s 2.269s

Assertion Report: PASS

Assertion Result Detail
parse:mean<=1ms PASS mean=19.2µs (threshold=1ms)
parse:p95<=5ms PASS p95=53µs (threshold=5ms)
reserve:mean<=50ms PASS mean=2.523766ms (threshold=50ms)
reserve:p95<=200ms PASS p95=5.727ms (threshold=200ms)
encrypt:mean<=5ms PASS mean=555.266µs (threshold=5ms)
encrypt:p95<=50ms PASS p95=1.133ms (threshold=50ms)
dispatch:mean<=5ms PASS mean=42.6µs (threshold=5ms)
dispatch:p95<=50ms PASS p95=150µs (threshold=50ms)

3-provider-heavy-100conc-10kb

3 providers, 20 users, 100 requests, concurrency=100, streaming=true

Model Providers RAM
mlx-community/Qwen3.5-0.8B-MLX-4bit 3 0.5 GB
Metric Value
Total Requests 100
Success 12
Errors 88
Total Duration 3.61s
Throughput 3.3 req/s

Latency Decomposition

Segment Count Mean P50 P95 Max
total_e2e 12 2.175s 2.17s 2.207s 2.207s
parse 12 128µs 92µs 367µs 367µs
reserve 12 10ms 10ms 10ms 10ms
route 12 45µs 13µs 401µs 401µs
encrypt 12 25ms 25ms 26ms 26ms
dispatch 12 63µs 31µs 293µs 293µs
coordinator_to_provider 12 2.112s 2.107s 2.144s 2.144s

Assertion Report: FAIL

Assertion Result Detail
parse:mean<=1ms PASS mean=127.5µs (threshold=1ms)
parse:p95<=5ms PASS p95=367µs (threshold=5ms)
reserve:mean<=50ms PASS mean=9.972166ms (threshold=50ms)
reserve:p95<=200ms PASS p95=10.457ms (threshold=200ms)
encrypt:mean<=5ms FAIL mean=24.858ms (threshold=5ms)
encrypt:p95<=50ms PASS p95=26.37ms (threshold=50ms)
dispatch:mean<=5ms PASS mean=62.833µs (threshold=5ms)
dispatch:p95<=50ms PASS p95=293µs (threshold=50ms)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 50a45a7d49

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread console-ui/src/app/api/stats/route.ts Outdated
if (req.nextUrl.searchParams.get("mock") === "geo") {
return NextResponse.json(withMockGeography(data));
}
return NextResponse.json(data);

This comment was marked as resolved.

Comment on lines +777 to +779
FROM usage
WHERE ($1::timestamptz IS NULL OR created_at >= $1)
GROUP BY city, region, region_code, country, country_code

This comment was marked as resolved.

Comment thread coordinator/registry/registry.go Outdated
Comment on lines +570 to +572
if rec.Location != nil {
cp := *rec.Location
p.Location = &cp

This comment was marked as resolved.

Comment on lines +246 to +251
func parseHeaderFloat(v string) float64 {
f, err := strconv.ParseFloat(strings.TrimSpace(v), 64)
if err != nil {
return 0
}
return f

This comment was marked as resolved.

Comment thread coordinator/api/provider_geo.go Outdated
Comment on lines +167 to +169
v = strings.Trim(v, "\"[]")
if host, _, err := net.SplitHostPort(v); err == nil {
v = host

This comment was marked as resolved.

Comment thread coordinator/api/stats.go Outdated
Comment on lines +294 to +295
ra = &regionAgg{key: rk, lat: loc.Latitude, lng: loc.Longitude}
regions[rk] = ra

This comment was marked as resolved.

@github-actions

github-actions Bot commented May 25, 2026 •

Copy link
Copy Markdown
Contributor

Benchmark Results

Runner: macos-15 (M1 Virtual) | Date: 2026-05-25 20:54 UTC

1-provider-streaming

1 providers, 1 users, 30 requests, concurrency=5, streaming=true

Model Providers RAM
mlx-community/Qwen3.5-0.8B-MLX-4bit 1 0.5 GB
Metric Value
Total Requests 30
Success 4
Errors 26
Total Duration 5.015s
Throughput 0.8 req/s

Latency Decomposition

Segment Count Mean P50 P95 Max
total_e2e 4 1.779s 1.78s 1.78s 1.78s
parse 4 28µs 27µs 47µs 47µs
reserve 4 4ms 4ms 6ms 6ms
route 4 22µs 21µs 39µs 39µs
encrypt 4 494µs 511µs 527µs 527µs
dispatch 4 36µs 36µs 52µs 52µs
coordinator_to_provider 4 1.77s 1.771s 1.772s 1.772s

Assertion Report: PASS

Assertion Result Detail
parse:mean<=1ms PASS mean=27.5µs (threshold=1ms)
parse:p95<=5ms PASS p95=47µs (threshold=5ms)
reserve:mean<=50ms PASS mean=4.00225ms (threshold=50ms)
reserve:p95<=200ms PASS p95=5.758ms (threshold=200ms)
encrypt:mean<=5ms PASS mean=494.25µs (threshold=5ms)
encrypt:p95<=50ms PASS p95=527µs (threshold=50ms)
dispatch:mean<=5ms PASS mean=35.5µs (threshold=5ms)
dispatch:p95<=50ms PASS p95=52µs (threshold=50ms)

1-provider-non-streaming

1 providers, 1 users, 20 requests, concurrency=5, streaming=false

Model Providers RAM
mlx-community/Qwen3.5-0.8B-MLX-4bit 1 0.5 GB
Metric Value
Total Requests 20
Success 4
Errors 16
Total Duration 3.282s
Throughput 1.2 req/s

Latency Decomposition

Segment Count Mean P50 P95 Max
total_e2e 4 3.277s 3.278s 3.281s 3.281s
parse 4 32µs 27µs 53µs 53µs
reserve 4 6ms 7ms 8ms 8ms
route 4 30µs 35µs 39µs 39µs
encrypt 4 608µs 613µs 721µs 721µs
dispatch 4 70µs 72µs 95µs 95µs
coordinator_to_provider 4 1.709s 1.71s 1.712s 1.712s

Assertion Report: PASS

Assertion Result Detail
parse:mean<=1ms PASS mean=31.75µs (threshold=1ms)
parse:p95<=5ms PASS p95=53µs (threshold=5ms)
reserve:mean<=50ms PASS mean=5.89975ms (threshold=50ms)
reserve:p95<=200ms PASS p95=8.359ms (threshold=200ms)
encrypt:mean<=5ms PASS mean=608.25µs (threshold=5ms)
encrypt:p95<=50ms PASS p95=721µs (threshold=50ms)
dispatch:mean<=5ms PASS mean=70.25µs (threshold=5ms)
dispatch:p95<=50ms PASS p95=95µs (threshold=50ms)

7-provider-multi-model

7 providers, 5 users, 50 requests, concurrency=10, streaming=true

Model Providers RAM
mlx-community/Qwen3.5-0.8B-MLX-4bit 4 0.5 GB
mlx-community/gemma-3-270m-4bit 3 0.2 GB
Metric Value
Total Requests 50
Success 50
Errors 0
Total Duration 15.928s
Throughput 3.1 req/s

Latency Decomposition

Segment Count Mean P50 P95 Max
total_e2e 50 729ms 183ms 3.949s 4.132s
parse 49 0s 0s 0s 2ms
reserve 49 2ms 2ms 3ms 5ms
route 49 32µs 26µs 80µs 92µs
encrypt 50 525µs 473µs 858µs 890µs
dispatch 50 59µs 39µs 201µs 301µs
coordinator_to_provider 50 674ms 180ms 3.922s 4.126s

Assertion Report: PASS

Assertion Result Detail
parse:mean<=1ms PASS mean=65.918µs (threshold=1ms)
parse:p95<=5ms PASS p95=52µs (threshold=5ms)
reserve:mean<=50ms PASS mean=1.804163ms (threshold=50ms)
reserve:p95<=200ms PASS p95=3.258ms (threshold=200ms)
encrypt:mean<=5ms PASS mean=524.64µs (threshold=5ms)
encrypt:p95<=50ms PASS p95=858µs (threshold=50ms)
dispatch:mean<=5ms PASS mean=59µs (threshold=5ms)
dispatch:p95<=50ms PASS p95=201µs (threshold=50ms)

3-provider-high-concurrency

3 providers, 10 users, 60 requests, concurrency=20, streaming=true

Model Providers RAM
mlx-community/Qwen3.5-0.8B-MLX-4bit 3 0.5 GB
Metric Value
Total Requests 60
Success 12
Errors 48
Total Duration 3.474s
Throughput 3.5 req/s

Latency Decomposition

Segment Count Mean P50 P95 Max
total_e2e 12 1.954s 1.958s 1.972s 1.972s
parse 12 28µs 28µs 60µs 60µs
reserve 12 4ms 4ms 5ms 5ms
route 12 29µs 34µs 48µs 48µs
encrypt 12 1ms 1ms 1ms 1ms
dispatch 12 48µs 43µs 110µs 110µs
coordinator_to_provider 12 1.926s 1.931s 1.945s 1.945s

Assertion Report: PASS

Assertion Result Detail
parse:mean<=1ms PASS mean=27.666µs (threshold=1ms)
parse:p95<=5ms PASS p95=60µs (threshold=5ms)
reserve:mean<=50ms PASS mean=3.611583ms (threshold=50ms)
reserve:p95<=200ms PASS p95=5.323ms (threshold=200ms)
encrypt:mean<=5ms PASS mean=848.833µs (threshold=5ms)
encrypt:p95<=50ms PASS p95=1.35ms (threshold=50ms)
dispatch:mean<=5ms PASS mean=48.25µs (threshold=5ms)
dispatch:p95<=50ms PASS p95=110µs (threshold=50ms)

1-provider-queue-saturation

1 providers, 10 users, 40 requests, concurrency=15, streaming=true

Model Providers RAM
mlx-community/Qwen3.5-0.8B-MLX-4bit 1 0.5 GB
Metric Value
Total Requests 40
Success 4
Errors 36
Total Duration 3.438s
Throughput 1.2 req/s

Latency Decomposition

Segment Count Mean P50 P95 Max
total_e2e 4 2.077s 2.077s 2.077s 2.077s
parse 4 17µs 20µs 21µs 21µs
reserve 4 2ms 2ms 3ms 3ms
route 4 46µs 64µs 93µs 93µs
encrypt 4 553µs 656µs 659µs 659µs
dispatch 4 23µs 26µs 28µs 28µs
coordinator_to_provider 4 2.071s 2.071s 2.071s 2.071s

Assertion Report: PASS

Assertion Result Detail
parse:mean<=1ms PASS mean=16.75µs (threshold=1ms)
parse:p95<=5ms PASS p95=21µs (threshold=5ms)
reserve:mean<=50ms PASS mean=2.37375ms (threshold=50ms)
reserve:p95<=200ms PASS p95=2.621ms (threshold=200ms)
encrypt:mean<=5ms PASS mean=552.5µs (threshold=5ms)
encrypt:p95<=50ms PASS p95=659µs (threshold=50ms)
dispatch:mean<=5ms PASS mean=22.5µs (threshold=5ms)
dispatch:p95<=50ms PASS p95=28µs (threshold=50ms)

3-provider-20-users

3 providers, 20 users, 60 requests, concurrency=10, streaming=true

Model Providers RAM
mlx-community/Qwen3.5-0.8B-MLX-4bit 3 0.5 GB
Metric Value
Total Requests 60
Success 60
Errors 0
Total Duration 9.009s
Throughput 6.7 req/s

Latency Decomposition

Segment Count Mean P50 P95 Max
total_e2e 60 397ms 40ms 2.161s 2.161s
parse 60 18µs 16µs 38µs 50µs
reserve 60 1ms 1ms 3ms 4ms
route 60 22µs 18µs 55µs 98µs
encrypt 60 455µs 419µs 816µs 890µs
dispatch 60 39µs 34µs 86µs 113µs
coordinator_to_provider 60 394ms 37ms 2.153s 2.156s

Assertion Report: PASS

Assertion Result Detail
parse:mean<=1ms PASS mean=18.033µs (threshold=1ms)
parse:p95<=5ms PASS p95=38µs (threshold=5ms)
reserve:mean<=50ms PASS mean=1.445666ms (threshold=50ms)
reserve:p95<=200ms PASS p95=2.877ms (threshold=200ms)
encrypt:mean<=5ms PASS mean=455.466µs (threshold=5ms)
encrypt:p95<=50ms PASS p95=816µs (threshold=50ms)
dispatch:mean<=5ms PASS mean=39.3µs (threshold=5ms)
dispatch:p95<=50ms PASS p95=86µs (threshold=50ms)

1-provider-scaling

1 providers, 5 users, 30 requests, concurrency=10, streaming=true

Model Providers RAM
mlx-community/Qwen3.5-0.8B-MLX-4bit 1 0.5 GB
Metric Value
Total Requests 30
Success 4
Errors 26
Total Duration 3.605s
Throughput 1.1 req/s

Latency Decomposition

Segment Count Mean P50 P95 Max
total_e2e 4 2.178s 2.178s 2.178s 2.178s
parse 4 33µs 44µs 57µs 57µs
reserve 4 3ms 3ms 3ms 3ms
route 4 18µs 17µs 31µs 31µs
encrypt 4 434µs 438µs 489µs 489µs
dispatch 4 29µs 29µs 44µs 44µs
coordinator_to_provider 4 2.171s 2.171s 2.171s 2.171s

Assertion Report: PASS

Assertion Result Detail
parse:mean<=1ms PASS mean=33µs (threshold=1ms)
parse:p95<=5ms PASS p95=57µs (threshold=5ms)
reserve:mean<=50ms PASS mean=2.73325ms (threshold=50ms)
reserve:p95<=200ms PASS p95=3.045ms (threshold=200ms)
encrypt:mean<=5ms PASS mean=433.5µs (threshold=5ms)
encrypt:p95<=50ms PASS p95=489µs (threshold=50ms)
dispatch:mean<=5ms PASS mean=28.75µs (threshold=5ms)
dispatch:p95<=50ms PASS p95=44µs (threshold=50ms)

3-provider-scaling

3 providers, 5 users, 30 requests, concurrency=10, streaming=true

Model Providers RAM
mlx-community/Qwen3.5-0.8B-MLX-4bit 3 0.5 GB
Metric Value
Total Requests 30
Success 30
Errors 0
Total Duration 6.247s
Throughput 4.8 req/s

Latency Decomposition

Segment Count Mean P50 P95 Max
total_e2e 30 840ms 132ms 2.43s 2.43s
parse 30 19µs 17µs 39µs 41µs
reserve 30 2ms 1ms 3ms 4ms
route 30 19µs 19µs 37µs 39µs
encrypt 30 448µs 394µs 722µs 761µs
dispatch 30 33µs 28µs 70µs 99µs
coordinator_to_provider 30 836ms 130ms 2.424s 2.424s

Assertion Report: PASS

Assertion Result Detail
parse:mean<=1ms PASS mean=18.7µs (threshold=1ms)
parse:p95<=5ms PASS p95=39µs (threshold=5ms)
reserve:mean<=50ms PASS mean=1.661866ms (threshold=50ms)
reserve:p95<=200ms PASS p95=2.978ms (threshold=200ms)
encrypt:mean<=5ms PASS mean=448.133µs (threshold=5ms)
encrypt:p95<=50ms PASS p95=722µs (threshold=50ms)
dispatch:mean<=5ms PASS mean=33.2µs (threshold=5ms)
dispatch:p95<=50ms PASS p95=70µs (threshold=50ms)

5-provider-scaling

5 providers, 5 users, 30 requests, concurrency=10, streaming=true

Model Providers RAM
mlx-community/Qwen3.5-0.8B-MLX-4bit 5 0.5 GB
Metric Value
Total Requests 30
Success 30
Errors 0
Total Duration 6.193s
Throughput 4.8 req/s

Latency Decomposition

Segment Count Mean P50 P95 Max
total_e2e 30 763ms 92ms 2.198s 2.198s
parse 30 25µs 20µs 75µs 134µs
reserve 30 2ms 2ms 3ms 3ms
route 30 25µs 19µs 67µs 97µs
encrypt 30 1ms 1ms 1ms 1ms
dispatch 30 50µs 34µs 170µs 188µs
coordinator_to_provider 30 758ms 90ms 2.19s 2.192s

Assertion Report: PASS

Assertion Result Detail
parse:mean<=1ms PASS mean=25.433µs (threshold=1ms)
parse:p95<=5ms PASS p95=75µs (threshold=5ms)
reserve:mean<=50ms PASS mean=1.872066ms (threshold=50ms)
reserve:p95<=200ms PASS p95=2.986ms (threshold=200ms)
encrypt:mean<=5ms PASS mean=566.7µs (threshold=5ms)
encrypt:p95<=50ms PASS p95=946µs (threshold=50ms)
dispatch:mean<=5ms PASS mean=49.666µs (threshold=5ms)
dispatch:p95<=50ms PASS p95=170µs (threshold=50ms)

3-provider-heavy-100conc-10kb

3 providers, 20 users, 100 requests, concurrency=100, streaming=true

Model Providers RAM
mlx-community/Qwen3.5-0.8B-MLX-4bit 3 0.5 GB
Metric Value
Total Requests 100
Success 12
Errors 88
Total Duration 3.974s
Throughput 3.0 req/s

Latency Decomposition

Segment Count Mean P50 P95 Max
total_e2e 12 2.239s 2.239s 2.256s 2.256s
parse 12 77µs 72µs 142µs 142µs
reserve 12 7ms 7ms 8ms 8ms
route 12 55µs 65µs 142µs 142µs
encrypt 12 23ms 23ms 23ms 23ms
dispatch 12 96µs 75µs 214µs 214µs
coordinator_to_provider 12 2.197s 2.197s 2.214s 2.214s

Assertion Report: FAIL

Assertion Result Detail
parse:mean<=1ms PASS mean=76.666µs (threshold=1ms)
parse:p95<=5ms PASS p95=142µs (threshold=5ms)
reserve:mean<=50ms PASS mean=7.046583ms (threshold=50ms)
reserve:p95<=200ms PASS p95=7.859ms (threshold=200ms)
encrypt:mean<=5ms FAIL mean=22.725166ms (threshold=5ms)
encrypt:p95<=50ms PASS p95=23.473ms (threshold=50ms)
dispatch:mean<=5ms PASS mean=96.416µs (threshold=5ms)
dispatch:p95<=50ms PASS p95=214µs (threshold=50ms)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2e3df6cd91

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +335 to +337
provider.Mu().Lock()
provider.Location = loc
provider.Mu().Unlock()

This comment was marked as resolved.

Comment thread coordinator/store/memory.go Outdated
Comment on lines +547 to +548
b = &agg{key: k, lat: loc.Latitude, lng: loc.Longitude, providers: make(map[string]struct{})}
buckets[k] = b

This comment was marked as resolved.

}

export async function GET(req: NextRequest) {
const res = await fetch(`${COORD_URL}/v1/stats`, { cache: "no-store" });

This comment was marked as resolved.

Comment thread coordinator/api/stats.go Outdated
ra.requests += b.Requests
ra.promptTok += b.PromptTokens
ra.completeTok += b.CompletionTokens
ra.providers += b.Providers

This comment was marked as resolved.

…e analytics/ service

Coordinator changes:
- Add GeoIP resolver (MaxMind DB + trusted reverse-proxy headers) for
  approximate provider and consumer location without storing raw IPs
- Extend /v1/stats with provider_locations, provider_regions,
  request_locations, request_regions, and request_flows aggregations
- Privacy floor: suppress city-level buckets below k-anonymity thresholds
  (min 2 providers per city, min 5 requests per city)
- Add ProviderLocation to store interface, ProviderRecord, and Provider
  registry structs with Postgres JSONB persistence
- Capture consumer request location on inference dispatch for flow
  visualization (stored as approximate geo, never raw IP)
- Add provider attestation fields (attested, mda_verified, acme_verified,
  runtime_verified, certificate_available, challenge freshness) to stats

Console-UI changes:
- Rewrite /stats page with immersive network flow visualization: SVG world
  map with projected provider/consumer dots and animated request flow arcs
- Add provider geography section with city/region breakdown tables
- Add model inventory section with capacity, routability, and fleet mix
- Add /api/stats proxy route with mock geo overlay (?mock=geo) for dev
- Add /api/attestation proxy route
- Add network-flow-ping CSS animation with prefers-reduced-motion support

Cleanup:
- Remove analytics/ standalone Go service (duplicate of coordinator
  /v1/stats, /v1/leaderboard, /v1/network/totals; never deployed)
@github-actions

github-actions Bot commented May 25, 2026 •

Copy link
Copy Markdown
Contributor

Benchmark Results

Runner: macos-15 (M1 Virtual) | Date: 2026-05-25 21:13 UTC

1-provider-streaming

1 providers, 1 users, 30 requests, concurrency=5, streaming=true

Model Providers RAM
mlx-community/Qwen3.5-0.8B-MLX-4bit 1 0.5 GB
Metric Value
Total Requests 30
Success 4
Errors 26
Total Duration 5.374s
Throughput 0.7 req/s

Latency Decomposition

Segment Count Mean P50 P95 Max
total_e2e 4 1.967s 1.967s 1.967s 1.967s
parse 4 25µs 28µs 32µs 32µs
reserve 4 3ms 3ms 4ms 4ms
route 4 14µs 14µs 23µs 23µs
encrypt 4 389µs 395µs 473µs 473µs
dispatch 4 26µs 28µs 42µs 42µs
coordinator_to_provider 4 1.96s 1.96s 1.961s 1.961s

Assertion Report: PASS

Assertion Result Detail
parse:mean<=1ms PASS mean=24.75µs (threshold=1ms)
parse:p95<=5ms PASS p95=32µs (threshold=5ms)
reserve:mean<=50ms PASS mean=2.65325ms (threshold=50ms)
reserve:p95<=200ms PASS p95=3.879ms (threshold=200ms)
encrypt:mean<=5ms PASS mean=389µs (threshold=5ms)
encrypt:p95<=50ms PASS p95=473µs (threshold=50ms)
dispatch:mean<=5ms PASS mean=26µs (threshold=5ms)
dispatch:p95<=50ms PASS p95=42µs (threshold=50ms)

1-provider-non-streaming

1 providers, 1 users, 20 requests, concurrency=5, streaming=false

Model Providers RAM
mlx-community/Qwen3.5-0.8B-MLX-4bit 1 0.5 GB
Metric Value
Total Requests 20
Success 4
Errors 16
Total Duration 3.359s
Throughput 1.2 req/s

Latency Decomposition

Segment Count Mean P50 P95 Max
total_e2e 4 3.355s 3.356s 3.359s 3.359s
parse 4 18µs 17µs 27µs 27µs
reserve 4 4ms 5ms 5ms 5ms
route 4 12µs 12µs 17µs 17µs
encrypt 4 460µs 453µs 488µs 488µs
dispatch 4 35µs 36µs 43µs 43µs
coordinator_to_provider 4 1.767s 1.767s 1.769s 1.769s

Assertion Report: PASS

Assertion Result Detail
parse:mean<=1ms PASS mean=17.75µs (threshold=1ms)
parse:p95<=5ms PASS p95=27µs (threshold=5ms)
reserve:mean<=50ms PASS mean=3.84925ms (threshold=50ms)
reserve:p95<=200ms PASS p95=5.492ms (threshold=200ms)
encrypt:mean<=5ms PASS mean=460.25µs (threshold=5ms)
encrypt:p95<=50ms PASS p95=488µs (threshold=50ms)
dispatch:mean<=5ms PASS mean=35µs (threshold=5ms)
dispatch:p95<=50ms PASS p95=43µs (threshold=50ms)

7-provider-multi-model

7 providers, 5 users, 50 requests, concurrency=10, streaming=true

Model Providers RAM
mlx-community/Qwen3.5-0.8B-MLX-4bit 4 0.5 GB
mlx-community/gemma-3-270m-4bit 3 0.2 GB
Metric Value
Total Requests 50
Success 50
Errors 0
Total Duration 15.728s
Throughput 3.2 req/s

Latency Decomposition

Segment Count Mean P50 P95 Max
total_e2e 50 707ms 167ms 3.979s 3.979s
parse 48 23µs 18µs 47µs 58µs
reserve 48 2ms 1ms 3ms 3ms
route 48 40µs 29µs 126µs 221µs
encrypt 50 1ms 0s 1ms 1ms
dispatch 50 0s 0s 0s 2ms
coordinator_to_provider 50 603ms 164ms 3.849s 3.974s

Assertion Report: PASS

Assertion Result Detail
parse:mean<=1ms PASS mean=22.5µs (threshold=1ms)
parse:p95<=5ms PASS p95=47µs (threshold=5ms)
reserve:mean<=50ms PASS mean=1.589875ms (threshold=50ms)
reserve:p95<=200ms PASS p95=2.643ms (threshold=200ms)
encrypt:mean<=5ms PASS mean=509.32µs (threshold=5ms)
encrypt:p95<=50ms PASS p95=811µs (threshold=50ms)
dispatch:mean<=5ms PASS mean=89.98µs (threshold=5ms)
dispatch:p95<=50ms PASS p95=139µs (threshold=50ms)

3-provider-high-concurrency

3 providers, 10 users, 60 requests, concurrency=20, streaming=true

Model Providers RAM
mlx-community/Qwen3.5-0.8B-MLX-4bit 3 0.5 GB
Metric Value
Total Requests 60
Success 12
Errors 48
Total Duration 3.9s
Throughput 3.1 req/s

Latency Decomposition

Segment Count Mean P50 P95 Max
total_e2e 12 2.086s 2.079s 2.105s 2.105s
parse 12 21µs 14µs 97µs 97µs
reserve 12 2ms 2ms 3ms 3ms
route 12 19µs 17µs 47µs 47µs
encrypt 12 508µs 553µs 893µs 893µs
dispatch 12 22µs 22µs 32µs 32µs
coordinator_to_provider 12 2.078s 2.073s 2.099s 2.099s

Assertion Report: PASS

Assertion Result Detail
parse:mean<=1ms PASS mean=21.166µs (threshold=1ms)
parse:p95<=5ms PASS p95=97µs (threshold=5ms)
reserve:mean<=50ms PASS mean=2.042333ms (threshold=50ms)
reserve:p95<=200ms PASS p95=2.645ms (threshold=200ms)
encrypt:mean<=5ms PASS mean=508.25µs (threshold=5ms)
encrypt:p95<=50ms PASS p95=893µs (threshold=50ms)
dispatch:mean<=5ms PASS mean=22.333µs (threshold=5ms)
dispatch:p95<=50ms PASS p95=32µs (threshold=50ms)

1-provider-queue-saturation

1 providers, 10 users, 40 requests, concurrency=15, streaming=true

Model Providers RAM
mlx-community/Qwen3.5-0.8B-MLX-4bit 1 0.5 GB
Metric Value
Total Requests 40
Success 4
Errors 36
Total Duration 3.418s
Throughput 1.2 req/s

Latency Decomposition

Segment Count Mean P50 P95 Max
total_e2e 4 1.993s 1.993s 1.994s 1.994s
parse 4 12µs 14µs 19µs 19µs
reserve 4 2ms 2ms 2ms 2ms
route 4 12µs 11µs 17µs 17µs
encrypt 4 469µs 509µs 511µs 511µs
dispatch 4 19µs 21µs 24µs 24µs
coordinator_to_provider 4 1.988s 1.988s 1.989s 1.989s

Assertion Report: PASS

Assertion Result Detail
parse:mean<=1ms PASS mean=12.25µs (threshold=1ms)
parse:p95<=5ms PASS p95=19µs (threshold=5ms)
reserve:mean<=50ms PASS mean=2.27475ms (threshold=50ms)
reserve:p95<=200ms PASS p95=2.455ms (threshold=200ms)
encrypt:mean<=5ms PASS mean=469.25µs (threshold=5ms)
encrypt:p95<=50ms PASS p95=511µs (threshold=50ms)
dispatch:mean<=5ms PASS mean=18.75µs (threshold=5ms)
dispatch:p95<=50ms PASS p95=24µs (threshold=50ms)

3-provider-20-users

3 providers, 20 users, 60 requests, concurrency=10, streaming=true

Model Providers RAM
mlx-community/Qwen3.5-0.8B-MLX-4bit 3 0.5 GB
Metric Value
Total Requests 60
Success 33
Errors 27
Total Duration 7.559s
Throughput 4.4 req/s

Latency Decomposition

Segment Count Mean P50 P95 Max
total_e2e 33 748ms 34ms 2.387s 2.387s
parse 33 22µs 17µs 48µs 93µs
reserve 33 2ms 2ms 4ms 7ms
route 33 30µs 20µs 92µs 174µs
encrypt 33 442µs 397µs 749µs 789µs
dispatch 33 42µs 34µs 95µs 193µs
coordinator_to_provider 33 744ms 30ms 2.381s 2.383s

Assertion Report: PASS

Assertion Result Detail
parse:mean<=1ms PASS mean=21.515µs (threshold=1ms)
parse:p95<=5ms PASS p95=48µs (threshold=5ms)
reserve:mean<=50ms PASS mean=1.924666ms (threshold=50ms)
reserve:p95<=200ms PASS p95=3.641ms (threshold=200ms)
encrypt:mean<=5ms PASS mean=441.969µs (threshold=5ms)
encrypt:p95<=50ms PASS p95=749µs (threshold=50ms)
dispatch:mean<=5ms PASS mean=42.333µs (threshold=5ms)
dispatch:p95<=50ms PASS p95=95µs (threshold=50ms)

1-provider-scaling

1 providers, 5 users, 30 requests, concurrency=10, streaming=true

Model Providers RAM
mlx-community/Qwen3.5-0.8B-MLX-4bit 1 0.5 GB
Metric Value
Total Requests 30
Success 4
Errors 26
Total Duration 3.661s
Throughput 1.1 req/s

Latency Decomposition

Segment Count Mean P50 P95 Max
total_e2e 4 2.112s 2.112s 2.113s 2.113s
parse 4 23µs 26µs 28µs 28µs
reserve 4 2ms 2ms 3ms 3ms
route 4 14µs 14µs 26µs 26µs
encrypt 4 453µs 425µs 702µs 702µs
dispatch 4 19µs 23µs 26µs 26µs
coordinator_to_provider 4 2.106s 2.106s 2.107s 2.107s

Assertion Report: PASS

Assertion Result Detail
parse:mean<=1ms PASS mean=22.5µs (threshold=1ms)
parse:p95<=5ms PASS p95=28µs (threshold=5ms)
reserve:mean<=50ms PASS mean=2.2845ms (threshold=50ms)
reserve:p95<=200ms PASS p95=2.94ms (threshold=200ms)
encrypt:mean<=5ms PASS mean=453.25µs (threshold=5ms)
encrypt:p95<=50ms PASS p95=702µs (threshold=50ms)
dispatch:mean<=5ms PASS mean=19.25µs (threshold=5ms)
dispatch:p95<=50ms PASS p95=26µs (threshold=50ms)

3-provider-scaling

3 providers, 5 users, 30 requests, concurrency=10, streaming=true

Model Providers RAM
mlx-community/Qwen3.5-0.8B-MLX-4bit 3 0.5 GB
Metric Value
Total Requests 30
Success 30
Errors 0
Total Duration 5.948s
Throughput 5.0 req/s

Latency Decomposition

Segment Count Mean P50 P95 Max
total_e2e 30 798ms 106ms 2.292s 2.292s
parse 30 19µs 16µs 38µs 52µs
reserve 30 2ms 2ms 3ms 3ms
route 30 23µs 17µs 60µs 122µs
encrypt 30 1ms 0s 2ms 3ms
dispatch 30 40µs 28µs 96µs 158µs
coordinator_to_provider 30 794ms 103ms 2.286s 2.287s

Assertion Report: PASS

Assertion Result Detail
parse:mean<=1ms PASS mean=19.1µs (threshold=1ms)
parse:p95<=5ms PASS p95=38µs (threshold=5ms)
reserve:mean<=50ms PASS mean=1.696866ms (threshold=50ms)
reserve:p95<=200ms PASS p95=2.85ms (threshold=200ms)
encrypt:mean<=5ms PASS mean=565.166µs (threshold=5ms)
encrypt:p95<=50ms PASS p95=2.126ms (threshold=50ms)
dispatch:mean<=5ms PASS mean=39.766µs (threshold=5ms)
dispatch:p95<=50ms PASS p95=96µs (threshold=50ms)

5-provider-scaling

5 providers, 5 users, 30 requests, concurrency=10, streaming=true

Model Providers RAM
mlx-community/Qwen3.5-0.8B-MLX-4bit 5 0.5 GB
Metric Value
Total Requests 30
Success 30
Errors 0
Total Duration 6.86s
Throughput 4.4 req/s

Latency Decomposition

Segment Count Mean P50 P95 Max
total_e2e 30 789ms 9ms 2.345s 2.345s
parse 30 26µs 17µs 65µs 189µs
reserve 30 2ms 2ms 4ms 4ms
route 30 24µs 20µs 47µs 154µs
encrypt 30 1ms 0s 1ms 1ms
dispatch 30 37µs 25µs 119µs 170µs
coordinator_to_provider 30 784ms 5ms 2.338s 2.34s

Assertion Report: PASS

Assertion Result Detail
parse:mean<=1ms PASS mean=25.9µs (threshold=1ms)
parse:p95<=5ms PASS p95=65µs (threshold=5ms)
reserve:mean<=50ms PASS mean=2.179466ms (threshold=50ms)
reserve:p95<=200ms PASS p95=4.175ms (threshold=200ms)
encrypt:mean<=5ms PASS mean=541.966µs (threshold=5ms)
encrypt:p95<=50ms PASS p95=870µs (threshold=50ms)
dispatch:mean<=5ms PASS mean=37.266µs (threshold=5ms)
dispatch:p95<=50ms PASS p95=119µs (threshold=50ms)

3-provider-heavy-100conc-10kb

3 providers, 20 users, 100 requests, concurrency=100, streaming=true

Model Providers RAM
mlx-community/Qwen3.5-0.8B-MLX-4bit 3 0.5 GB
Metric Value
Total Requests 100
Success 12
Errors 88
Total Duration 3.924s
Throughput 3.1 req/s

Latency Decomposition

Segment Count Mean P50 P95 Max
total_e2e 12 2.19s 2.198s 2.21s 2.21s
parse 12 76µs 78µs 101µs 101µs
reserve 12 6ms 6ms 7ms 7ms
route 12 53µs 11µs 489µs 489µs
encrypt 12 18ms 18ms 20ms 20ms
dispatch 12 41µs 37µs 81µs 81µs
coordinator_to_provider 12 2.155s 2.163s 2.176s 2.176s

Assertion Report: FAIL

Assertion Result Detail
parse:mean<=1ms PASS mean=75.916µs (threshold=1ms)
parse:p95<=5ms PASS p95=101µs (threshold=5ms)
reserve:mean<=50ms PASS mean=6.402166ms (threshold=50ms)
reserve:p95<=200ms PASS p95=6.851ms (threshold=200ms)
encrypt:mean<=5ms FAIL mean=18.416ms (threshold=5ms)
encrypt:p95<=50ms PASS p95=19.645ms (threshold=50ms)
dispatch:mean<=5ms PASS mean=41µs (threshold=5ms)
dispatch:p95<=50ms PASS p95=81µs (threshold=50ms)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c779b442af

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread coordinator/api/stats.go
records := s.store.UsageRecordsSince(since)
for _, rec := range records {
consumerLoc := rec.RequestLocation
providerLoc := providerLocs[rec.ProviderID]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Store provider location at request time for flow accuracy

aggregateRequestFlows resolves providerLoc from the provider’s current/stored record (providerLocs[rec.ProviderID]) instead of from immutable per-request data, so any provider that reconnects from a different network/location within the 30-minute window will have earlier requests re-attributed to its latest location. This produces incorrect request_flows geography during normal mobility, restarts, or egress-IP changes, even when request-side locations are correct.

Useful? React with 👍 / 👎.

routable,
};
})
: data.providers;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Return complete mock stats shape when upstream is down

In mock=geo mode, the offline fallback calls withMockGeography({}), but withMockGeography preserves data.providers/data.models when they are not arrays, leaving them undefined in the response. The stats page immediately does stats.providers.filter(...) and stats.models.map(...), so when the coordinator is unreachable this mock endpoint can still crash the page instead of providing a usable offline mock payload.

Useful? React with 👍 / 👎.

provider.Mu().Lock()
provider.Location = loc
provider.Mu().Unlock()
s.registry.PersistProvider(provider)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Avoid racing stale provider persistence during registration

This new persistence call runs before attestation verification and PersistProvider is asynchronous, so two registration-time writes can race: an early snapshot without attestation/serial/account metadata may commit after the later verified snapshot and overwrite the provider row with stale fields. In that ordering, reconnect restoration and stats can intermittently lose verified trust/location linkage until another persist happens.

Useful? React with 👍 / 👎.

M3kko added a commit to M3kko/d-inference that referenced this pull request May 28, 2026
…dpoints)

Master deleted the standalone analytics/ service in Layr-Labs#212 with the
rationale "duplicate of coordinator endpoints, never deployed." Bring
the liveness endpoints back as a single coordinator/api/liveness.go
file, admin-gated via the existing requireAdminKey pattern. Reuses the
coordinator's store.Store directly — no service layer, no separate
types package, no pseudonym aliasing (matches existing /v1/stats which
exposes raw provider IDs). Five endpoints:

  GET /v1/providers/{id}/liveness     reliability summary
  GET /v1/providers/{id}/sessions     recent session intervals
  GET /v1/providers/{id}/heartbeats   recent heartbeat samples
  GET /v1/providers/reliability       fleet shortlist by uptime bar
  GET /v1/network/availability        distributional fleet stats

Also repairs a stale interface docstring: GetReliabilityFeatures
returns (nil, nil) on miss, not ErrNotFound. Both backends already
returned (nil, nil); only the comment claimed otherwise.

Includes httptest coverage for the admin gate, happy path, not-found,
filter behavior, and small-N percentile correctness (math.Round so
p90 separates from p50 at N=3).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
M3kko added a commit to M3kko/d-inference that referenced this pull request May 28, 2026
…dpoints)

Master deleted analytics/ in Layr-Labs#212; this branch had been adding to it.
Now that the liveness read endpoints live in coordinator/api/liveness.go,
remove the duplicate tree (~1500 LOC across 17 files including the
separate go.mod). Post-rebase, this conflict resolves cleanly because
both sides delete the same files.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

This branch was successfully deployed

3 active deployments
Preview – d-inference-console-ui-dev — c779b442 Deployed May 25, 2026 by vercel[bot]
Preview – d-inference — c779b442 Deployed May 25, 2026 by vercel[bot]
Preview – d-inference-landing — c779b442 Deployed May 25, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant