Gateway mode can't offer AI Gateway custom providers — and there's no other way for a deployment to give users a model #400
Justin-Dearing
started this conversation in
Ideas
Replies: 1 comment 1 reply
|
This is a massive oversight and also likely a maintenance nightmare for you guys as model names from providers change constantly. You should be using discovery against the providers and offering the models in a dynamic fashion back to Cloudflare OS |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
TLDR - AI Gateway lets you register a custom provider. Cloudflare OS's gateway mode can't offer it: the catalog is a compile-time table and the provider routes are four hardcoded paths, so the gateway's own provider registry is never consulted. And outside gateway mode there's no deployment-level model at all — everything is per-user. Net result: a team deployment cannot give its users a model on a custom endpoint by any supported path. We think this would be a great capability for team deployments, and the nice part is the two halves compose naturally.
We run a team deployment from the unmodified starter with a self-hosted model (vLLM behind an Anthropic-compatible gateway). Ideally we'd register it as an AI Gateway custom provider and have gateway mode offer it — central key, per-user cost logs, zero user setup, exactly what gateway mode is for. But:
What a fix could look like. Since an AI Gateway custom provider is just a base URL — the gateway doesn't know its models, wire formats, or context windows — even the gateway-side fix needs deployment config declaring the models. Something like: deployment config lists models (id, display name, wire format, context window, and either a custom-{slug} gateway route or a direct URL + secret-backed key), and those appear in every user's picker, optionally as the default. That one shape covers both avenues: gateway-mode deployments get custom providers with the gateway's key custody and cost logging; non-gateway deployments get the same models pointed directly at the endpoint.
This hole has a workaround ecosystem already, which is usually the sign of a missing feature: #29 (generic OpenAI-compatible provider), #50 (admin control over offered models), #219 (a ~1,400-line overlay patch series adding deployment gateway models with an admin UI), and ours — we inject a script into the built frontend that auto-adds our model to each user's account on load, over the same authenticated /api websocket the frontend uses. It works, but everyone's building bootstrap hacks around the same wall from different directions.
We prototyped the non-gateway half on a private fork and the seam is small (three call sites in user.ts, plus a modelTokenWindow branch for models outside the catalogs). Happy to share notes or test against our deployment — per CONTRIBUTING, deliberately not attaching a PR.
All reactions