Extensible AI Platform — Modular gateway for controlling AI token flows via plugins.
Cortex Gate is an extensible platform for routing, governing, and optimizing AI LLM requests. It provides a pluggable architecture where functionality is delivered through extensions — self-contained modules that register UI pages and backend routes.
Current status: Early v0.2. The platform shell and extension system are functional. Individual extensions (routing, governance, benchmarking) are under active development.
| Feature | Status | Description |
|---|---|---|
| Extension System | ✅ Done | Registry with lazy-loaded pages, toggle enable/disable, localStorage persistence |
| Prompt Router UI | ✅ Done | Visual equalizer with 8 dimensions + economy slider |
| Server Control | ✅ Done | Tauri app manages backend lifecycle (start/stop/status) |
| Backend API | ✅ Done | OpenAI-compatible /v1/chat/completions endpoint |
| SQLite Database | ✅ Done | User, API key, and budget storage |
| Provider Config | ✅ Done | Multi-provider configuration (OpenAI, Anthropic, OpenRouter) |
| Embedding Classifier | 🟡 Stub | ONNX int8 embeddings — keyword heuristic fallback for now |
| Benchmark Engine | 🟡 Stub | Real model benchmarking — test framework exists, full integration pending |
| Cost Governance | 🟡 Stub | Token budgets and alerts — basic structure in place |
| Streaming Proxy | 🟡 Stub | SSE passthrough + Anthropic→OpenAI translation — wired but untested with real providers |
- Extension registry (frontend: JS, lazy imports, toggle enable/disable)
- Prompt Router extension (equalizer UI)
- Server control from Tauri (start/stop/status)
- Backend serves frontend static files (single port :18801)
- Wire classifier → actual ONNX embeddings
- Wire streaming → real provider calls
- Wire governance → token tracking + budget enforcement
- Complete embedding classifier (ONNX int8, dimension scoring)
- Real provider proxy (streaming SSE with keepalive)
- Token usage tracking + cost calculation
- Dashboard extension (real-time stats, charts)
- Rate limiting middleware (tower-governor)
- Circuit breaker per provider (tower-resilience)
- Retry with exponential backoff
- OpenAPI docs (utoipa-axum)
- Stress testing + performance benchmarks
- Prometheus metrics
- Analytics extension
- Audit log extension
- A/B testing extension
- MCP / JSON-RPC protocol support
┌──────────────────────────────────────────────────┐
│ Client │
│ (OpenAI-compatible SDK / HTTP) │
└──────────┬───────────────────────────────────────┘
│ POST /v1/chat/completions
▼
┌──────────────────────────────────────────────────┐
│ Gateway (Rust / Axum) │
│ :18801/api/* + :18801/ (static frontend) │
│ │
│ ┌──────────┐ ┌──────────┐ ┌────────────────┐ │
│ │ Auth │ │ Routes │ │ Extensions │ │
│ │ Middleware│ │ Handlers │ │ (plugin loader)│ │
│ └──────────┘ └──────────┘ └────────────────┘ │
│ │
│ ┌──────────┐ ┌──────────┐ ┌────────────────┐ │
│ │ProxyEngine│ │Classifier│ │ Governance │ │
│ │(reqwest) │ │(ONNX) │ │ (SQLite) │ │
│ └──────────┘ └──────────┘ └────────────────┘ │
└──────────────────────────────────────────────────┘
│
▼
┌──────────┴──────────┐ ┌──────────────────────┐
│ LLM Providers │ │ Tauri Desktop App │
│ OpenAI / Anthropic │ │ (Electron-like, │
│ OpenRouter / Custom│ │ embeds frontend) │
└─────────────────────┘ └──────────────────────┘
# 1. Build and run the backend
cargo build --release
./target/release/cortex-gate
# 2. Open in browser
# http://127.0.0.1:18801
# Or use the Tauri desktop app (Linux with display):
cd frontend/src-tauri && cargo build --release
DISPLAY=:0 ./target/release/cortex-gate-tauri- Double-click the Cortex Gate icon
- Click Start Server in the sidebar
- Status dot turns green → Server Online
- Click Open Web UI → browser opens
http://127.0.0.1:18801 - Click Stop Server to shut down
Extensions are self-contained modules that register UI pages and optional backend routes. Currently available:
| Extension | Status | Description |
|---|---|---|
| Prompt Router | 🟡 Partial | Equalizer UI works; backend routing not yet wired to real providers |
To create a new extension:
// frontend/src/extensions/my-ext/manifest.js
export const manifest = {
id: "my-ext",
name: "My Extension",
description: "Does something cool",
version: "0.1.0",
pages: [{
name: "my-ext",
label: "My Ext",
icon: "puzzle",
load: () => import("./page.js"),
}],
};Then register it in frontend/src/main.js.
- Project Origins — Historical context
- Best Practices — Code standards and patterns
- Code Suggestions — Pending improvements
PolyForm Noncommercial License 1.0.0. See LICENSE.
For commercial use, contact the author: Luis Daniel Dos Santos