Skip to content

feat(js/plugins/compat-oai): refresh OpenAI model catalog - #7201

Merged
cabljac merged 17 commits into
mainfrom
feat/compat-oai-openai-catalog
Nov 30, 2026
Merged

cabljac merged 17 commits into
mainfrom
feat/compat-oai-openai-catalog

Conversation

@cabljac

@cabljac cabljac commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

What's new

Behaviour changes

  • 22 shut-down ids are no longer registered. They resolve by name with generic info, on any host.
  • openAI.model() refs now carry catalog info, so info.stage is set and info.supports is model-specific.
  • Listing hides 39 ids the chat path can't serve: moderation, Realtime, Live, audio, Responses-only, legacy completions and unserved image ids, including gpt-live-transcribe and gpt-realtime-whisper, which main listed as transcription.
  • An ft: id is classified by its base model, so a tts-helper fine-tune of gpt-4.1 is a chat model.
  • gpt-4.1, gpt-4.1-mini, o3, gpt-5-search-api, gpt-6-sol, gpt-6-luna, gpt-6.1-sol and gpt-6.1-terra are now constrained: 'all', so JSON output sends response_format: json_schema instead of prompt instructions.
  • Live dated snapshots (e.g. gpt-4o-2024-08-06, gpt-4.1-2025-04-14) take their alias's info instead of generic info: JSON output sends json_schema, and toolChoice is false.

Catalog

  • Adds gpt-4.1, gpt-4.1-mini, gpt-5-search-api, gpt-6-sol, gpt-6-luna, gpt-6.1-sol and gpt-6.1-terra.
  • 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.tools is false for gpt-6-astra, gpt-6.1-sol and gpt-5-search-api; gpt-5-search-api also gets media: false.
  • A live dated snapshot takes its alias's info. gpt-4o-2024-05-13 and fine-tunes get generic info.
  • README, testapp and samples/js-openai use current models.
// before
openAI.model('gpt-4o').info.stage;              // undefined
openAI.model('ft:gpt-4.1:acme:tts-helper:abc'); // speech model ref
openAI.model('gpt-6.1-sol').info.supports.tools; // true (generic info)

// after
openAI.model('gpt-4o').info.stage;              // 'deprecated'
openAI.model('ft:gpt-4.1:acme:tts-helper:abc'); // chat model ref
openAI.model('gpt-6.1-sol').info.supports.tools; // false

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':

400 Function tools with reasoning_effort are not supported

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 send json_schema, and that strict: true works 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.
  • jest 427/427. pnpm check, pnpm build, Prettier and copyright pass.
  • Live: real /v1/models lists 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 took constrained); 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

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.
@github-actions github-actions Bot added docs Improvements or additions to documentation js sample labels Nov 13, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 hilariie left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread js/plugins/compat-oai/README.md Resolved
…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.
@cabljac

cabljac commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

@hilariie not intended, thanks. a7859f5 restores both flows on gpt-5-search-api with web_search_options. They return real search answers. One catch: annotations comes back undefined, because core loses the provider raw before it builds the GenerateResponse. That's on main too, and it's listed under Not in this PR.

@cabljac
cabljac marked this pull request as ready for review November 16, 2026 17:32
- 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 hilariie left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with some inline comments

Comment thread js/plugins/compat-oai/src/openai/gpt.ts Resolved
Comment thread js/plugins/compat-oai/src/openai/gpt.ts Resolved
…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.
@cabljac
cabljac merged commit 43e6d06 into main Nov 30, 2026
23 of 24 checks passed
@cabljac
cabljac deleted the feat/compat-oai-openai-catalog branch November 30, 2026 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation js sample

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants