Repository navigation
feat(py/openai): refresh the OpenAI model catalog - #128
Conversation
The chat catalog now lists only models that Chat Completions serves: gpt-5.4 to gpt-5.6 (sol, terra, luna), the GPT-6 family, chat-latest and gpt-5-search-api are in, and shut-down and Responses-only ids are out. Models with an announced shutdown carry stage 'deprecated'. gpt-5.4, gpt-5.4-mini, gpt-5.4-nano, gpt-5.5, gpt-5.6-sol/terra/luna, gpt-6-sol and gpt-6-luna declare tools, which need reasoning_effort='none' on Chat Completions. gpt-5-search-api declares no tools. The image catalog adds gpt-image-2.5/2.6 Sunburst and Flare and a deprecated gpt-image-2. OpenAIGptImageConfig.quality accepts low, medium, high, xhigh, max and auto. gpt-transcribe is registered with text output only. Discovery lists only ids the plugin can call. It hides realtime, live, audio, moderation, diarize, pro, codex, cyber (except gpt-6-cyber), daybreak, Rosalind and legacy completion ids, and DALL-E. chatgpt-image-latest is an image model. Dated snapshots take their alias's info and stage, and ft: fine-tunes take their base model's. A shared fixture drives the discovery tests. Breaking changes: - KnownGpt drops the shut-down ids (gpt-4-turbo, gpt-3.5-turbo, o1, o3-mini, o4-mini, gpt-5-chat-latest, gpt-5.2-chat, gpt-oss and others), plus dall-e-3 and gpt-image-1. - Removed ids leave init() and the Dev UI list. They still resolve by name with their old supports through a private map. - gpt-transcribe no longer advertises json output.
…t-image already covers
…e-latest deprecated
… 2.6 Sunburst and Flare models
…of a retired-supports table
|
@hilariie softened instead: the breaking-changes section is gone. Nothing public changes. |
- hide gpt-3.5-turbo-instruct and the Responses-only gpt-oss ids from discovery - name the extra override in the image quality error - say in the README that the discovery filter applies on any host and hidden ids resolve by name - pin every catalog stage, the o3 and gpt-5-search-api supports, schema-less JSON on gpt-4 and a dated gpt-6-cyber id in tests - fix a stale docstring and a misplaced comment - keep only the fixture fields the discovery test reads
…ional hosts Compatible hosts skipped the discovery filter entirely, so realtime, moderation, Sora and legacy completion ids were listed as chat models on proxies such as LiteLLM. babbage, davinci, codex and -pro ids, hidden on every host on main, were listed again. Split the filter. Ids no host serves through this plugin's endpoints are hidden everywhere. Ids OpenAI serves only on other APIs (Responses-only, -audio, DALL-E, gpt-image-1) are hidden only on api.openai.com and its regional subdomains, so us.api.openai.com and eu.api.openai.com are filtered too. Dated snapshots of retired aliases, such as o4-mini-2025-04-16, now take the alias's legacy info instead of generic info. Pin the legacy supports with literal values: replacing o1's supports previously left the suite green.
The handler looked up the action's id in SUPPORTED_OPENAI_MODELS to check config.model. Ids moved to the legacy catalog, dated snapshots, fine-tunes and other uncataloged ids raised KeyError, so generate returned finish_reason=failed. The handler now takes the info the plugin resolved.
A dated snapshot took its alias's constrained=ALL, so Genkit dropped the JSON format instructions from the prompt and relied on response_format json_schema alone. Older snapshots can predate their alias's structured output support, and compatible hosts may not enforce it. Snapshots now take their alias's supports and stage without constrained output, which keeps the prompt they sent before.
…very The realtime and moderation filter matched anywhere in the id, so custom models such as my-realtime-llama on Ollama or vLLM were hidden from list_actions. Match only OpenAI's gpt-*realtime* and omni-/text-moderation ids.
The legacy completion filter matched only ada, babbage, curie and davinci with a -NNN suffix, so davinci, davinci-instruct-beta, text-similarity-davinci-001 and text-search-* ids were listed as chat. Match babbage, curie and davinci as any id segment, as main did, and the old text-/code- similarity and search families. text-embedding-ada-002 stays listed.
OpenAI's id is gpt-5.2-chat-latest, which the gpt-5.2-chat key never matched, so it resolved with generic info. Add it next to gpt-5.2-chat, which stays for callers that use that name.
|
Some screenshots from live tests: Note: found a bug when you send audio from the Dev UI playground, it adds a text part that is one space (" ") to the message. The plugin uses any message text as the transcription prompt. So in the Dev UI, diarize always fails, and gpt-4o-transcribe gets worse. Will fix separately. |
Remove the legacy capabilities table. A chat id that OpenAI has shut down now resolves by name with generic info, as the JS, Go and Dart plugins do. Genkit core acts only on `constrained` at runtime and does not enforce the tools and media flags, so the request still goes out. A dated snapshot takes its alias's info only when the alias is in the catalog. gpt-4o-2024-05-13 is shut down and gets generic info, not the live gpt-4o info. On a compatible host that still serves gpt-4, schema-less JSON output now sends response_format json_object instead of text.
Snapshots drop constrained output, and shut-down snapshots such as gpt-4o-2024-05-13 get generic capabilities.
huangjeff5
left a comment
There was a problem hiding this comment.
Verified against a fake OpenAI server: gpt-image-2 + xhigh comes back failed with no request, extra sends it, discovery lists 71 ids on api/eu and 106 on a custom host, chat-latest sends max_completion_tokens. The failed-response shape for image quality and generic info for shut-down ids both look right to me. Comments inline, none blocking.
nit: the body says shut-down ids resolve generically "as in JS, Go and Dart". That holds once genkit-ai/genkit#7201, genkit-ai/genkit#7202 and genkit-ai/genkit-dart#748 land; today JS and Go still register gpt-4 with text-only info, so schema-less JSON sends text there and json_object here. Maybe "as in the pending JS, Go and Dart PRs".
- Anchor the babbage/curie/davinci discovery filter so compatible-host ids like llama-3-davinci and marie-curie-7b stay listed. - Deny xhigh/max quality only on GPT Image models known to reject it, so new models such as gpt-image-3 are not refused locally. - Drop the gpt-4o-mini-2024-07-18 catalog key so it derives its info from gpt-4o-mini like every other dated snapshot. - Clarify the quality error: move the value into extra to send it. - Remove the handler's version check. No catalog entry sets versions, so it never raised, and its catalog lookup failed for ids resolved by name. - README: split the usage notes into Tools on reasoning models, Model discovery and Image quality sections.
|
@huangjeff5 thanks! The body now says "as in the pending JS, Go and Dart PRs". |
# Conflicts: # packages/genkit-openai/README.md # packages/genkit-openai/src/genkit_openai/_openai_plugin.py
- Add a test that Mistral catalog and unknown ids get Mistral's label and supports, and that get_model_info returns them. - Use the action's info for supports at call time. OpenAIModel reads only supports.output, which listed and default Mistral supports share.




What's new
Behaviour changes
json_object, nottext, and the Dev UI shows generic flags.chat-latestsendsmax_output_tokensasmax_completion_tokens, notmax_tokens.qualitygainsauto, plusxhighandmaxon gpt-image-2.5, 2.6 and newer models. On gpt-image-2, gpt-image-1.x and chatgpt-image-latestxhighandmaxreturn a failed response (INVALID_ARGUMENT, no API call) instead of raising, and the error names theextra={'quality': ...}override. DALL-E is unchanged.my-realtime-llamastay listed. Onapi.openai.comand regional hosts it also hides Responses-only (including gpt-oss), codex,-pro, DALL-E, gpt-image-1 and-audioids (the plugin returns no audio). Hidden ids still resolve by name.resolve, soft:gpt-4o-mini:org:tts-x:idis chat, not TTS.Catalog
deprecatedon announced shutdowns: gpt-4o, gpt-4.1, o3, gpt-5, gpt-5.1, gpt-5.4-nano, TTS, older STT, gpt-image-2, gpt-image-1.5, gpt-image-1-mini and chatgpt-image-latest.constrained, so JSON keeps prompt instructions, as onmain. Snapshots of shut-down aliases and gpt-4o-2024-05-13 get generic info.Part of genkit-ai/genkit#5898.
Why
16 of 31 registered chat models and both image models were shut down, discovery listed realtime and moderation ids as chat, and valid image values failed:
Tests
tests/discovery_test.py: per-host filtering (8 base URLs, 3 config sources), custom names stay listed.tests/openai_plugin_test.py: catalog, stages, generic info for shut-down ids and snapshots, fine-tunes,json_objectfor generic ids.tests/openai_generate_config_test.py:config={'model': ...}outside the catalog; snapshot vs alias prompt.tests/image_model_test.py: stages, per-model quality enum, the local error,extra.packages/genkit-openai: 908 passed. ruff and pyright pass./v1/modelslists 68 of 99 (main 88); chat, tools, JSON and streaming pass on every catalog model; shut-down ids 404; every image model and quality works; TTS and STT work, diarize included.Not in this PR
qualityraise should checkresponse.error.json_schema, as onmain(OpenAI-compatible plugins: output schemas with a non-object root return 400 genkit#7238).