Repository navigation
feat(go/plugins/compat_oai): refresh OpenAI model catalog and listing - #7202
Conversation
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.
There was a problem hiding this comment.
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.
hilariie
left a comment
There was a problem hiding this comment.
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.
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.
- 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.
…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.
What's new
Behaviour changes
Generateon 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. AModelsentry withStage: ai.ModelStageStablesilences it (README). JS doesn't warn yet ([JS] Model stage is dropped from registered model actions, so the deprecation warning never fires #7221).json_schema(wasjson_objectplus prompt instructions); o3-mini gains media and tool choice. AModelsentry restores the old capabilities.ListActionshides 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 asllama-3-davincistay listed. gpt-audio* stays listed. Fine-tunes are judged by their base. Hidden ids still resolve by name.compat_oaiprovider. A cancelled listing logs at debug only.Catalog
json_schemaas on main (JS and Python snapshots use prompt instructions).versions; snapshots gain labels andversions: [self]; curated stage is"stable", was"".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:
Listing showed all 99
/v1/modelsids 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, aModelsentry 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./v1/modelslists 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=145 pass, 2 skip.Not in this PR
Models["gpt-4o"]doesn't reachgpt-4o-2024-11-20.generate/audio_input. Fails on main too.json_schema(OpenAI-compatible plugins: output schemas with a non-object root return 400 #7238). Widened only for gpt-4, gpt-4-turbo and gpt-3.5-turbo on compat hosts.Stop.llama-3-davincistays listed on a compatible host butdavinci-7bis hidden. An exact match would need an allowlist.