Repository navigation
feat(js/plugins/compat-oai): refresh OpenAI model catalog - #7201
Conversation
Derive OpenAI chat model info from one catalog table. Each entry has a
tools rule and an optional shutdown date.
- Drop the 22 ids OpenAI has shut down. Add gpt-6-sol, gpt-6-luna,
gpt-6.1-sol, gpt-6.1-terra and gpt-5-search-api. Catalog gpt-4.1 and
gpt-4.1-mini.
- Mark models with an announced shutdown as stage 'deprecated'.
- supports.tools and supports.toolChoice are false only for gpt-6-astra,
gpt-6.1-sol, gpt-6.1-terra and gpt-5-search-api. gpt-5.4 and later,
except those no-tools models, take tools only at reasoning_effort
'none'. o3 gets constrained: 'all'.
- Dated snapshots take their alias's info. Shut-down snapshots get
generic info.
- Listing hides ids the plugin can't call: moderation, Realtime, Live,
audio, Responses-only ids, legacy completions base models and their
fine-tunes, and unsupported image ids. gpt-5-search-api is listed.
- A shared /v1/models fixture drives the listing tests.
- Move README, testapp and samples/js-openai to current models.
Breaking changes:
- 22 shut-down ids (gpt-4.5, o1, o3-mini, o4-mini, gpt-4, gpt-4-turbo,
gpt-3.5-turbo and their variants, gpt-5-chat-latest and others) are
no longer registered. They still resolve by name with generic info.
- openAI.model('o4-mini') and openAI.model('o3-mini') no longer match a
typed key. They compile through the untyped string overload.
There was a problem hiding this comment.
Code Review
This pull request refactors and updates the OpenAI compatibility plugin (compat-oai) to support newer model families (GPT-5 and GPT-6 variants) while deprecating or removing older, shut-down models. It introduces a structured model catalog (GPT_MODEL_SPECS) to dynamically derive capabilities, handles dated snapshots, refactors model filtering logic, and updates the documentation, test suites, and sample applications accordingly. As there are no review comments provided, I have no feedback to offer.
hilariie
left a comment
There was a problem hiding this comment.
The testapp and sample drop the web-search flows instead of moving them to gpt-5-search-api, which takes web_search_options and returns citations. Was that intended? They were the only place the search options and annotations got exercised.
…model The listing filter and the action-type branches matched substrings of the full id, so a fine-tune's user suffix could hide it (support-pro-v2, image-captioner, realtime-x) or route it to the speech, transcription or embedder path (tts-helper, transcribe-fix, embedding-ranker). New-style ft:babbage-002 and ft:davinci-002 fine-tunes were listed as chat models. Classify on the base model id instead.
The 'other' listing check only ran when the id was listed, so it passed when an embedder, tts, stt or image id was hidden. Move the image ids the plugin hides on purpose to 'hidden', and assert every 'other' id is listed with its expected action type and non-chat metadata.
The catalog refresh removed the web search flows with gpt-4o-search-preview. Bring them back on gpt-5-search-api, still using web_search_options, and type the citation annotations they return.
…l info stage: 'deprecated' is set on the model reference info, but core drops it when the model is registered, so the Dev UI and generate do not show it yet (#7221).
OpenAI gives the 2027-01-14 shutdown for the dated gpt-4o, gpt-4o-mini, gpt-4.1 and gpt-4.1-mini snapshots. Its model pages mark the aliases deprecated and point them at those snapshots. Say that an alias shutdownDate is the date of the snapshot it resolves to.
…dels The legacy matcher only caught bare base models, so text-davinci-003, code-davinci-002 and text-ada-001 were listed as chat models. Main hid them through a substring match.
…og info
openAI.model('gpt-4o') built a generic reference, so its info had no
stage and no catalog supports. Build chat references with gptModelRef,
which also makes the README claim about the model reference info true.
gpt-6.1-terra accepts function tools on Chat Completions at reasoning_effort 'none', like gpt-6-sol and gpt-6-luna. gpt-6-astra and gpt-6.1-sol still reject them.
gpt-5-search-api ignores image input and accepts json_schema response_format. Advertise media false, text and json output, and constrained output.
|
@hilariie not intended, thanks. a7859f5 restores both flows on |
- pin the full deprecated model set and o3 system role in tests - look up only own keys in known-model maps - trim the unsupported-model matcher comment - remove assertions that repeat other tests - keep only the fixture fields that tests read
… output A dated snapshot now takes its alias's supports and stage, but not `constrained`. With `constrained: 'all'`, core dropped the format instructions and the plugin sent `response_format: json_schema`, which OpenAI rejects for non-object root schemas. Snapshots go back to prompt instructions, as on main. Catalogued aliases keep `constrained: 'all'`. Adds wire tests: snapshots send no `response_format` and carry the format instructions; constrained aliases send `json_schema`.
The base-id matcher only caught `<model>-NNN` and `<model>:` forms, so `davinci`, `davinci-instruct-beta`, `text-similarity-*`, `text-search-*` and `text-davinci-edit-001`, which main hid, were listed as chat models again. Any babbage, curie or davinci segment, an ada completion id and the similarity and search families are now hidden. `text-embedding-ada-002` stays listed as an embedder.
…mini snapshot - Anchor the babbage/curie/davinci discovery filter to the start of the id, so custom ids such as llama-3-davinci and marie-curie-7b on a compatible host stay listed. - Drop the gpt-4o-mini-2024-07-18 catalog entry so it takes gpt-4o-mini's info without constrained output, like every other dated snapshot.
hilariie
left a comment
There was a problem hiding this comment.
LGTM with some inline comments
…advertising toolChoice A live dated snapshot now takes all of its alias's info, so JSON output sends json_schema and strict works. OpenAI chat models report toolChoice: false because the request path sends no tool_choice.
What's new
Behaviour changes
openAI.model()refs now carry catalog info, soinfo.stageis set andinfo.supportsis model-specific.gpt-live-transcribeandgpt-realtime-whisper, which main listed as transcription.ft:id is classified by its base model, so atts-helperfine-tune of gpt-4.1 is a chat model.constrained: 'all', so JSON output sendsresponse_format: json_schemainstead of prompt instructions.json_schema, andtoolChoiceis false.Catalog
stage: 'deprecated'on announced shutdowns: gpt-4o, gpt-4o-mini, gpt-4.1, gpt-4.1-mini, gpt-5, gpt-5-mini, gpt-5-nano, o3, gpt-5.1 and gpt-5.4-nano.supports.toolsis false for gpt-6-astra, gpt-6.1-sol and gpt-5-search-api; gpt-5-search-api also getsmedia: false.samples/js-openaiuse current models.Part of #5898.
Why
22 of 39 catalogued chat models are shut down and GPT-6 was missing. Listing showed Realtime, moderation, legacy completions and gpt-image-2 as chat models, and a fine-tune suffix could hide or misroute a model. gpt-5.4 and later take function tools on Chat Completions only at
reasoning_effort: 'none':Tests
tests/openai_test.ts: stages, supports flags, snapshot info,openAI.model()kind and info, fine-tune classification, table-driven listing; wire tests that snapshots and constrained aliases sendjson_schema, and thatstrict: trueworks on a snapshot.tests/openai_listing_fixture.json: every id classed as chat, hidden or other, including misleading fine-tune suffixes and every legacy completion family.pnpm check,pnpm build, Prettier and copyright pass./v1/modelslists 59 of 99 (main 98), none of the hidden ids a chat model; Generate passes on 27 chat models with JSON and media (run before snapshots tookconstrained); tools pass, and the API rejects them for the three no-tools models; streaming matches main; web search, embedder, TTS and transcription pass.Not in this PR
stage, so the Dev UI andgeneratedon't show it yet ([JS] Model stage is dropped from registered model actions, so the deprecation warning never fires #7221).400 Unknown parameter: 'response_format', as on main ([JS] compat-oai: gpt-image-2 / gpt-image-2.5 routed to Chat Completions; other GPT image models send unsupported response_format #6887).raw.tool_choice. Not sent, so catalogued OpenAI models reporttoolChoice: false; uncatalogued ids keep the generictoolChoice: true. Sending it on all compat hosts is a follow-up.noneis recorded, not enforced.llama-3-davincistays listed on a compatible host butdavinci-7bis hidden. An exact match would need an allowlist.