feat: add provider and model routing tables, admin UI, and audit category for gateway

Implement the multi-provider routing system for the OpenAI gateway, including two new database tables (`gateway_providers`, `gateway_models`) ensured at init, a new admin page at `/admin/gateway` with full CRUD for providers and model routes, and a `"gateway"` audit category mapped to `"ai"`. The routing layer sits transparently on top of the existing single-provider default path: unmatched model names fall through unchanged, while matched routes forward to the configured provider with their own pricing economy, vision model, and context window. Cross-worker cache invalidation uses a shared `_ROUTING_CACHE` bumped via `"gateway_routing"` cache version.
This commit is contained in:
2026-06-16 22:11:14 +00:00
parent c100b4b692
commit 7bc67662fa
21 changed files with 1401 additions and 20 deletions
+1
View File
@@ -26,6 +26,7 @@ CATEGORY_BY_PREFIX: dict[str, str] = {
"news": "news",
"admin": "admin",
"service": "service",
"gateway": "ai",
"container": "container",
"proxy": "ingress",
"seo": "tools",