Home/Docs/Core Concepts
ARCHITECTURAL DESIGN

Core Primitives & Concepts

Understand the foundational design mechanics and security primitives that make Selixes an elite-grade, neutral reliability layer.

🛡️ Sovereign Neutral Proxy Layer

Selixes operates completely transparently. Because it implements the standard OpenAI REST API schema, there are **no custom SDKs or proprietary libraries** to install. You point your existing SDK base URL to the gateway.

This neutral positioning guarantees zero vendor lock-in, letting you coordinate OpenAI, Anthropic, Gemini, or local models concurrently underneath a single uniform API interface.

🔌 The Continuity Engine & Local Backups

Selixes deploys advanced circuit-breakers to intercept upstream outages in under 15ms. If OpenAI experiences a network timeout or a 5xx gateway error, the transaction is seamlessly routed to Anthropic or Gemini.

During complete cloud network blackouts, the gateway boots our **Zero-Cost Continuity Mode**, proxying critical requests to a sandboxed local-model node (running Llama-3 via Ollama) on your edge infrastructure. Your software stays functional offline at exactly **$0.00** in token fees.

💵 Cost Containment & Swarm Budgets

Autonomous agent systems are highly susceptible to concurrency explosions and infinite tool-calling loops. Selixes implements an advanced real-time cost control system using Redis-backed atomic transaction blocks:

  • Session Budget Caps: Standard provider billing alerts can lag by hours. Selixes validates current cumulative spend on *every request transit* in under 1ms. By using Redis atomic floats (INCRBYFLOAT), the gateway blocks additional transits immediately (returning HTTP 429) the microsecond a session surpasses its configured limit (e.g. $0.20 budget).
  • Trajectory Instability Guard: To detect and terminate infinite agent loops (where an agent repeatedly queries the same tool with the same result), the gateway parses prompt metadata. If a tool output or prompt structure is flagged as repeating consecutively 3 times, the gateway automatically terminates the request thread.
  • Atomic Concurrency Bounds: Multiple parallel agent workers can quickly saturate LLM rate limits. Selixes locks concurrent connections per session key. If a worker goes offline mid-transit, Node.js process socket close listeners guarantee that connection counts are atomically decremented in Redis, preventing locked sessions.

📊 Observability & Trace Auditing

The gateway records strict metadata snapshots (prompt cost, latency, model hashes) for every transaction. These metrics populate our Postgres + Redis telemetry schemas, providing real-time Weekly Resiliency Reports ready for administrative review.

Next Up: API Header Specifications

Review custom budget headers, endpoint schemas, and sample response payloads.

View API Reference ->