Repository navigation
Conversation
…er models Adds model `starlight-route` to /v1/chat/completions. It names the kind of work (the classes in starlight-evals routing-table.json), then tries routes from the cheapest tier up and stops at the first that answers. - New Workers AI routes: edge-glm (@cf/zai-org/glm-5.3) and edge-deepseek (@cf/deepseek-ai/deepseek-v4.1-flash-1017). - New provider `gateway`: one OpenAI-compatible upstream and one key for Anthropic, OpenAI, Google and xAI. Vercel AI Gateway by default. - Any Workers AI id or gateway id may be requested directly. - irreversible stakes never route below frontier-balanced; with no such route configured the answer is 503. - Each response reports the class, ladder, skipped and failed routes, and a cost estimate that is null unless prices are configured. - GET /v1/models. starlight-auto and every existing model name behave as before. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015JZDKoivSvKQuh571593Bv
|
The implementation here is Claude (Anthropic), so the receipt has to come from another provider. Nothing I push can clear it. @codex review Generated by Claude Code |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 57c5eb0a08
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…tch what the router does Three findings from the Codex review of 57c5eb0. - Cache identity now includes the routing plan and the response format, so a cached answer cannot carry another request's task class. - starlight-route is listed as available only when a route a ladder can select is configured. A lone Anthropic or OpenAI key no longer advertises a model that answers 503. - response_format json_object/json_schema is forwarded whole to the routes that enforce it (gateway, openai). Other routes are left out for that request, and a model with no such route answers 400 instead of prose. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015JZDKoivSvKQuh571593Bv
|
All three findings from the review of @codex review Generated by Claude Code |
|
Codex Review: Didn't find any major issues. Another round soon, please! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Scope
Stacked on #631 (base is its branch, head
6737029). Adds cost routing and a single upstream for frontier models toservices/starlight-cloud-worker. Four files, all inside that service.starlight-route: a new model name forPOST /v1/chat/completions. The worker names the kind of work (the classes in starlight-evalsrouting-table.json, plusgeneral), then tries routes from the cheapest tier up and stops at the first that answers. Callers can setstarlight_task,starlight_stakesandstarlight_min_tier, in the body or as headers.edge-glm(@cf/zai-org/glm-5.3) andedge-deepseek(@cf/deepseek-ai/deepseek-v4.1-flash-1017) on the Workers AI binding. Both hit the per-minute limit in the Workers AI catalog eval lane: probe harness, scorecard, research pack #654 sweep, so each sits in a ladder with a fallback.gatewaycalls one OpenAI-compatible endpoint withAI_GATEWAY_API_KEY. Vercel AI Gateway by default (the registry's decided model gateway);AI_GATEWAY_BASE_URLpoints it elsewhere. No OpenRouter.@cf/author/modelornamespace/modelid can be requested as the model.GET /v1/models: the names accepted and whether each can answer with the keys configured.estimated_cost_usd.starlight-autoand every existing model name are unchanged; #631's 15 tests pass untouched.Verification
At
57c5eb0, Node 22.23.5:node --test src/llm/router.test.mjs src/llm/ai-gateway.test.mjs: 31 pass, 0 fail (16 new, 15 from fix(cloud-worker): honest multi-route Workers AI chat gateway #631).tsc --noEmit --strictonrouter.tsandai-gateway.ts: clean.esbuild src/index.ts --bundlewith Cloudflare modules external: bundles, so the./router.tsimport resolves the way wrangler resolves it.node .claude/ci/estate-guard-scan.mjs --root .: 0 high.Not verified:
src/sandbox.test.mjsfails on fix(cloud-worker): honest multi-route Workers AI chat gateway #631's head before this change too (index.tsimports./edge-veil.js, which Node cannot resolve without a bundler). Not touched here.max_tokens. Whether every model behind the gateway accepts it rather thanmax_completion_tokensis untested.Privacy and security
@cf/author/modelornamespace/model. Paths, URLs and anything else are a 400 before any provider is called.starlight_stakes: "irreversible"never routes belowfrontier-balanced. With no such route configured the answer is 503, and a test checks no edge model is asked.What this does not do
resolveTenantin this worker returnsnullon purpose, so every protected route, this one included, answers 503 until a reviewed verifier lands. This PR does not change that and does not deploy.routing-table.jsonhardens a rule only after two concordant rounds.starlight_min_tieris the caller's floor.estimated_cost_usdis null unlessSTARLIGHT_PRICES_JSONis set.Evidence or preview
No UI. Response shape for a routed call:
{ "model": "@cf/zai-org/glm-5.3", "starlight_model": "starlight-route", "starlight_route": "edge-glm", "starlight_routing": { "task": "constrained-output", "source": "explicit", "stakes": "low", "start_tier": "edge-large", "ladder": ["edge-deepseek", "edge-glm", "edge-reason", "frontier-fast", "google", "frontier-balanced", "frontier-heavy"], "not_configured": ["frontier-fast", "google", "frontier-balanced", "frontier-heavy"], "failed": [{ "route": "edge-deepseek", "status": "error" }] }, "estimated_cost_usd": null }Substrate gate
Not applicable. Operational change inside
services/; no SIP, registry, attestation or canon file is touched.Implementation: Claude (Anthropic). #631 was written by Antigravity (Google), so review should come from a provider other than Anthropic.
Generated by Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.