Skip to main content
ARCHOS 525 BLUEPRINT · /d/dgm_int-llm-gateway

LLM Gateway & Router Internals (Fallback, Budgets & Semantic Guard)

6 COMPONENTS · 6 FLOWS · UPDATED 2026-11-24
GITHUB README / PR PREVIEW CARD
[![LLM Gateway & Router Internals (Fallback, Budgets & Semantic Guard) — ArchOS Architecture](https://archos.sageideas.dev/d/dgm_int-llm-gateway/opengraph-image)](https://archos.sageideas.dev/d/dgm_int-llm-gateway)

*Interactive architecture diagram powered by [ArchOS Studio](https://archos.sageideas.dev/d/dgm_int-llm-gateway)*
NOTION / DOCS / CONFLUENCE EMBED
<iframe src="https://archos.sageideas.dev/embed/dgm_int-llm-gateway" width="100%" height="580" style="border:1px solid rgba(240,236,225,0.14);border-radius:6px;" loading="lazy" title="LLM Gateway & Router Internals (Fallback, Budgets & Semantic Guard) — Interactive in ArchOS"></iframe>
PORTABLE MERMAID SPEC (GITHUB / NOTION / RFC)
flowchart LR
  client_0["Internal AI Apps"]
  n1_1["Unified Proxy Edge"]
  n2a_2["Smart Model Router"]
  n2b_3[("Token & Cost Ledger")]
  n3_4[("Prompt & Trace Audit")]
  downstream_5["Downstream & OTel"]
  client_0 -->|"1. Proxy LLM · HTTPS"| n1_1
  n1_1 -->|"2a. Route tier · HTTPS"| n2a_2
  n1_1 -.->|"2b. Meter $ · Redis"| n2b_3
  n2a_2 -->|"3a. Log trace · OTLP"| n3_4
  n2b_3 -->|"3b. Sync · Control"| n3_4
  n3_4 -.->|"4. Emit / · OTLP/API"| downstream_5

COMPONENT STACK (6)

  • Internal AI AppsSTATELESS
    Multi-model LLM API calls
  • Unified Proxy EdgeSTATELESS
    Auth, PII scrub & rate limit
  • Smart Model RouterSTATELESS
    Cost/latency tier + failover
  • Token & Cost LedgerSTATEFUL
    Per-tenant dollar caps in Redis
  • Prompt & Trace AuditSTATEFUL
    Redacted OTel GenAI spans
  • Downstream & OTelSTATELESS
    Consumers, metrics & SLOs

REQUEST & DATA FLOW (6)

  1. Internal AI Apps → Unified Proxy Edge (Proxy LLM)[HTTPS]
  2. Unified Proxy Edge → Smart Model Router (Route tier)[HTTPS]
  3. Unified Proxy Edge → Token & Cost Ledger (Meter $)[Redis]
  4. Smart Model Router → Prompt & Trace Audit (Log trace)[OTLP]
  5. Token & Cost Ledger → Prompt & Trace Audit (Sync)[Control]
  6. Prompt & Trace Audit → Downstream & OTel (Emit /)[OTLP/API]
Configure NGINX / Postgres / K8s →60-Sec L4–L7 Diagnostic →