Skip to content

feat(go/plugins/compat_oai): refresh OpenAI model catalog and listing - #7202

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

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

Conversation

@cabljac

@cabljac cabljac commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

What's new

Behaviour changes

  • Generate on a deprecated model (gpt-4o, gpt-4o-mini, gpt-4.1, gpt-4.1-mini, gpt-5, gpt-5-mini, gpt-5-nano, o3, gpt-5.1, gpt-5.4-nano and snapshots) logs a deprecation warning. A Models entry with Stage: ai.ModelStageStable silences it (README). JS doesn't warn yet ([JS] Model stage is dropped from registered model actions, so the deprecation warning never fires #7221).
  • Tools on gpt-6-astra, gpt-6.1-sol and gpt-5-search-api, and image input on gpt-5-search-api, fail locally instead of at OpenAI.
  • Shut-down ids (o1, o3-mini, o4-mini, gpt-4, gpt-4-turbo, gpt-3.5-turbo, gpt-4.1-nano, gpt-4o-2024-05-13) leave the catalog and take the dynamic defaults. On a compat proxy, gpt-4, gpt-4-turbo and gpt-3.5-turbo now advertise media, tool choice and strict json_schema (was json_object plus prompt instructions); o3-mini gains media and tool choice. A Models entry restores the old capabilities.
  • ListActions hides non-chat and Responses-only ids (54 of 99 live) and OpenAI's legacy completion ids, matched at the start of the id so custom ids such as llama-3-davinci stay listed. gpt-audio* stays listed. Fine-tunes are judged by their base. Hidden ids still resolve by name.
  • A failed listing warns once, then logs at debug until one succeeds, for every compat_oai provider. A cancelled listing logs at debug only.

Catalog

  • Adds gpt-6-astra, gpt-6-sol, gpt-6-luna, gpt-6.1-sol, gpt-6.1-terra and gpt-5-search-api.
  • A dated snapshot takes its curated model's options and stage, and keeps native json_schema as on main (JS and Python snapshots use prompt instructions).
  • Shut-down ids lose curated labels and versions; snapshots gain labels and versions: [self]; curated stage is "stable", was "".
  • Live tests move to gpt-5.6-luna and gpt-5.2.
// before: tools reach OpenAI and get a 400. after: fails locally, no request sent
genkit.Generate(ctx, g, ai.WithModel(oai.ModelRef("gpt-6-astra", nil)), ai.WithTools(weather))

// before: no log. after: "model is deprecated and may be removed in a future release"
genkit.Generate(ctx, g, ai.WithModel(oai.ModelRef("gpt-4o", nil)), ai.WithPrompt("hi"))

Part of #5898.

Why

Main stops at GPT-5.6, registers seven shut-down models and marks no shutdowns. gpt-6* ids advertise tools via the dynamic defaults, but gpt-6-astra and gpt-6.1-sol call tools only through Responses:

Function tools with reasoning_effort are not supported for gpt-6-astra in /v1/chat/completions. To use function tools, use /v1/responses or set reasoning_effort to 'none'.

Listing showed all 99 /v1/models ids as chat models, and a failed listing logged nothing.

Tests

  • openai/openai_test.go: shut-down ids, stages, tools and media flags, snapshots, fine-tunes, isChatModel, the listing fixture, a Models entry silencing the warning.
  • compat_oai_test.go: one warning per failing streak, reset after success, none on cancel.
  • go test -race ./plugins/compat_oai/... (157 pass, 8 skip), go vet, gofmt.
  • Live: real /v1/models lists 45, hides 54 (all non-chat); Generate passes on 17 curated models; tools pass at effort none where advertised; streaming text, tools and JSON match main; GENKIT_LIVE=1 45 pass, 2 skip.

Not in this PR

The OpenAI catalog drops shut-down models and adds gpt-6-astra,
gpt-6-sol, gpt-6-luna, gpt-6.1-sol, gpt-6.1-terra, the gpt-5.6 models
and gpt-5-search-api. Astra, the 6.1 models and gpt-5-search-api
advertise no tools. gpt-5.4, gpt-5.5, the gpt-5.6 models, gpt-6-sol and
gpt-6-luna take tools in Chat Completions only at reasoning_effort none.
Every model with an announced shutdown is deprecated but stays
registered and listed. Dated snapshots and fine-tunes take their base
model's options and stage.

Listing hides ids Chat Completions can't serve (image, audio, realtime,
embedding, moderation, legacy completions and Responses-only ids). Ids
outside OpenAI's naming pass. The OpenAI plugin filters the listed
actions after ListModelActions returns. listActions warns on the first
listing failure and logs repeats at debug until a listing succeeds. A
unit test checks the listing against a shared fixture of OpenAI model
ids.

Live tests move to gpt-5.6-luna at effort none and gpt-5.2.

Breaking changes:
- Shut-down ids (gpt-4.1-nano, gpt-4o-2024-05-13, o4-mini, o3-mini, o1,
  gpt-4-turbo, gpt-4, gpt-3.5-turbo and their snapshots) are no longer
  registered. They still resolve by name with the dynamic defaults.
- Deprecated models log a warning on each Generate call.
- The Dev UI no longer lists non-chat, audio or Responses-only ids.
@github-actions github-actions Bot added docs Improvements or additions to documentation go 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 updates the OpenAI compatible plugin's model catalog to support the GPT-6 and GPT-5 lines, marks deprecated models, and filters out non-chat models from the listing. It also introduces a mechanism to log model listing failures as a warning only once, falling back to debug logs for subsequent failures. Feedback on the changes suggests replacing strings.SplitSeq with strings.Split to maintain compatibility with Go versions prior to 1.24.

Comment thread go/plugins/compat_oai/openai/openai.go Resolved

@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 Why section and the "before" example don't match Go main. Main has no gpt-6 entries, and an uncurated id gets the dynamic defaults with tools on, so gpt-6-sol with tools reaches the API rather than failing with ErrUnsupportedByModel.

The doc comments at go/plugins/compat_oai/openai/openai.go lines 76 and 251 are stale now that snapshots and known-base fine-tunes take curatedModels entries.

Comment thread go/plugins/compat_oai/openai/openai.go Resolved
Comment thread go/plugins/compat_oai/openai/openai.go Resolved
Comment thread go/plugins/compat_oai/openai/openai.go Resolved
Chat Completions serves gpt-audio*, and the live suite sends audio input
through gpt-audio-1.5, so the listing shows them. Realtime and
transcription ids stay hidden through their own markers.
…ic defaults

A fine-tune no longer takes its base model's curated options and stage.
It resolves with the generic defaults, as before this branch. The
listing still judges a fine-tune by its base model, and dated snapshots
keep their alias's entry.
gpt-6.1-terra calls tools in Chat Completions at reasoning_effort none,
like gpt-6-sol and gpt-6-luna. gpt-6-astra and gpt-6.1-sol still reject
tools there.
gpt-5-search-api ignores image input: the reply misreads the image and
prompt tokens do not grow with it. It does take json_schema. It now has
its own capability set with no tools and no media, and its dated
snapshot takes the same set.
@cabljac

cabljac commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

@hilariie the Why section and the before example are rewritten against main: gpt-6-astra took the dynamic defaults with tools on, and OpenAI returned the 400 now quoted in the body. The doc comments at lines 76 and 251 are updated in 88050f8.

- do not warn when a model listing is cancelled
- show in the README how a Models entry silences a deprecation warning, and that hidden ids still resolve by name
- pin text-moderation ids in the chat filter and the warning override in tests
- move fineTuneBase next to isChatModel
- use gpt-5.4 in doc examples and trim comments that restate code
- keep only the fixture fields the listing test reads
The listing still showed bare davinci, curie, ada and babbage,
curie-instruct-beta, and the text-/code- completion, edit, similarity
and search ids as chat models. Chat Completions serves none of them, so
the filter now drops them on every host. IDs that only contain a legacy
name as part of a longer word stay listed.
Anchor the babbage/curie/davinci discovery filter to the start of the id.
The unanchored form hid custom ids such as llama-3-davinci and
marie-curie-7b on a compatible host, which isChatModel promises to keep
listed.
Comment thread go/plugins/compat_oai/openai/openai.go Resolved
Comment thread go/plugins/compat_oai/openai/openai.go Resolved
Comment thread go/plugins/compat_oai/openai/openai.go Resolved
Comment thread go/plugins/compat_oai/compat_oai.go Resolved
Comment thread go/plugins/compat_oai/compat_oai.go Resolved
…omment, fix legacy ID docs

Only a cancelled listing logs at debug level; a passed deadline warns. Restore the descriptor cache comment.
Document that IDs named after OpenAI's legacy completion models are left out of the listing on any host.

@adesinah adesinah 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.

Thanks, all addressed in 0d5cfdc. The compat_oai tests pass locally.

@cabljac
cabljac merged commit e4aa44a into main Nov 30, 2026
24 checks passed
@cabljac
cabljac deleted the feat/compat-oai-go-openai-catalog branch November 30, 2026 17:03
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 go

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants