Repository navigation
feat: refresh model list against vendor docs, Cloudflare first (#112 phase 2) - #123
Merged
Merged
Conversation
…phase 2) Workers AI: retire the 12 models Cloudflare deprecated (still accepted by name, never auto-routed), correct seven context windows, drop the unlisted function-calling claim on Qwen 2.5 Coder, price the two AI Gateway unified catalog models, and add Llama 3.1 8B FP8, Granite 4.0 Micro and SEA-LION v4. OpenAI: add GPT-6 Astra and GPT-5.6 Sol/Terra/Luna and GPT-5.5 before the 2026-10-23 shutdown of gpt-4, gpt-4-turbo and gpt-3.5-turbo (now retired in the catalog). Reasoning models get max_completion_tokens and no temperature. Anthropic: add Fable 5.1, Opus 5.5, Sonnet 5.5 and Haiku 5.5; mark 4.6 and Haiku 4.5 as legacy; omit temperature for 5.x; per-model cache-read rates and the Haiku 5.5 long-prompt rate. A new test requires a Workers AI model to rank first for every use case. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fable 5.1 and Opus 5.5 always think, and thinking counts against max_tokens, so the adapter's 1000-token default could leave no room for the answer. Requests that set no maxTokens now default to 16000 for these two models; estimateCost uses the same default. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…them Addresses the PR #123 review. - Add optional ModelCatalogEntry.explicitOnly; the new OpenAI and Claude 5.x models and SEA-LION are served only when named, so default routing stays on gpt-4o-mini and Claude 4.6 / Haiku 4.5 (lifecycles back to active; descriptions keep the shutdown/legacy notes). - Anthropic: no JSON prefill for Claude 4.6 and later (400 from Sonnet 4.6 on, so 1.22 JSON mode on claude-sonnet-4-6 already failed); restore the '{' only when prefilled. Forced tool choice on Fable 5.1, Opus 5.5 and Sonnet 5.5 throws a ConfigurationError before the call. Default max_tokens 16000 for all four 5.x models. - OpenAI: price dated snapshots by alias (was $0) and bill prompts over 272K at 2x/1.5x on the new 1M-context models. - Cloudflare: stop forwarding temperature/top_p to Claude Opus 4.8. - GPT_4O_MINI note names OpenAI's actual replacement; README claim scoped. - Restore factory.test.ts to main's content and 100755 mode. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tests Addresses the second PR #123 review. - CHANGELOG: gpt-4o-mini's shutdown shows in getRoutingInfo, not response metadata; list the routing changes from corrected data (Cloudflare long-context pick, new pool members, smaller OpenAI pool), the gpt-4o-mini cost change from $0, the new Qwen Coder tools error, and the 30s timeout caveat for 16K-token Claude 5.x responses. - README: Kimi K2.5 and Gemma 3 are no longer accepted; Anthropic defaults are per use case. - Streaming JSON mode restores the prefilled '{' (Haiku 4.5), matching generateResponse. - Factory-level tests: explicit-only models are served when named and never picked otherwise; forced tool choice on Sonnet 5.5 fails on generate and stream without calling any provider; toolChoice 'none'. - Link #124 (tool_result sent without tool_use_id). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…pend via factory Addresses the third PR #123 review. - CHANGELOG and README: a timed-out non-streaming Claude 5.x request is retried (maxRetries, default 3), so it can take about two minutes before fallback and each attempt may be billed. - README: Anthropic defaults follow request shape (JSON mode goes to Sonnet 4.6); Opus 4.6 only for high-performance/research workloads. - The gpt-4o-mini snapshot-pricing test now runs through LLMProviders and checks the CreditLedger records the spend. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #112 (phase 2). Unreleased; no version bump in this PR.
Every value was checked against vendor primary docs on 2026-10-15:
No live or billable vendor requests were made.
Review history.
gpt-4o-minicost test runs through the factory and checks the ledger, and mutation counts cover every test file.{in streamed JSON on prefilled models, and adds factory-level and streaming tests. It also opens Anthropic adapter sends tool_result blocks without tool_use_id, so multi-turn tool use fails #124:tool_resultblocks are sent withouttool_use_id, an older bug that affects every Claude model.Cloudflare (primary provider)
compatibility, so routing could still pick them. They now stay accepted by name but are never auto-routed.deepseek/deepseek-v4-proandanthropic/claude-opus-4.8were priced at $0. They now cost $1.74/$3.48 and $5/$25 per million tokens.temperatureortop_p, which Claude 4.7 and later reject.@cf/meta/llama-3.1-8b-instruct-fp8@cf/ibm-granite/granite-4.0-h-micro@cf/aisingapore/gemma-sea-lion-v4-27b-it(explicit-only)New
ModelCatalogEntry.explicitOnlyThis is an optional, additive field. An explicit-only model is served when a request names it, but recommendations and automatic routing skip it.
It is set on the new OpenAI models, the Claude 5.x models and SEA-LION. OpenAI and Anthropic defaults stay where they were in 1.22:
gpt-4o-minifor every OpenAI use case;Routing that does change, because the data was corrected:
gpt-4o-mini.OpenAI
gpt-4,gpt-4-turboandgpt-3.5-turboareretiredand no longer auto-routed, but are still accepted by name.gpt-3.5-turbo-16kis no longer a valid ID and is alsoretired.gpt-4o-ministays the default.getRoutingInfo()reports its 2027-01-14 shutdown; response metadata doesn't, because the model is stillactive.gpt-6-astra,gpt-5.6-sol,gpt-5.6-terra,gpt-5.6-lunaandgpt-5.5.max_completion_tokensinstead ofmax_tokens, and notemperature.temperatureis an inference; OpenAI's model pages don't say whether these models accept it.gpt-4o-mini, whose responses namegpt-4o-mini-2024-07-18. Ledgers and budgets will start showing real spend for it after upgrading.Anthropic
claude-fable-5-1,claude-opus-5-5,claude-sonnet-5-5andclaude-haiku-5-5.temperature.max_tokensdefaults to 16,000, because these models think by default and thinking counts againstmax_tokens.ConfigurationErrorbefore any API call, since those models return 400 for it. Haiku 5.5 still accepts it.claude-sonnet-4-6already fails today.{is restored only when it was prefilled, on both the non-streaming and streaming paths. Streaming previously never restored it.active, with a "legacy" note in their descriptions.Known limitations (still open on #112)
tool_resultblocks lacktool_use_id. This is why the 5.x models are explicit-only.timeoutcan cut off long non-streaming Fable 5.1 and Opus 5.5 responses at the new 16,000-token default. Timeouts are retried (maxRetries, default 3), so a request can take about two minutes before fallback, and each attempt may be billed. This is documented, not changed.ConfigurationErrorbefore any call.gpt-6-lunaandgpt-6.1-solrestrict tool calling on Chat Completions.Validation
tsc --noEmit, full vitest (789 tests;model-refresh.test.tshas 125),build,test:packageandtest:worker-importall pass.Factory-level tests now cover:
toolChoice: 'none'.factory.test.tsandcatalog-accuracy.test.tsare unchanged from main.Undoing each fix makes its tests fail (counts across all test files):
explicitOnlyexclusion{restoremax_tokens🤖 Generated with Claude Code