fix(imagegen): prefill image models the providers still serve (#2904)

* fix(imagegen): prefill image models the providers still serve

The OpenAI image provider prefilled gpt-image-1, which OpenAI retired on 2026-10-23, and OpenRouter prefilled google/gemini-2.5-flash-image-preview, which OpenRouter no longer lists, so a user who kept the prefill got a failing first request. They now prefill gpt-image-2 and google/gemini-3.1-flash-image.

* fix(imagegen): prefill gpt-image-2.6-flare instead of gpt-image-2

OpenAI shuts gpt-image-2 down on 2027-02-10 and names gpt-image-2.6-flare or -sunburst as the replacement; its image guide recommends the 2.6 models for new integrations. Flare is the general, fast-iteration model and uses the same Images API, so the OpenAI prefill moves to it now instead of to another retiring model.
This commit is contained in:
iQuantum
2026-12-01 04:24:22 +01:00
committed by GitHub
parent b5fb281a3e
commit 984260b3f5
2 changed files with 31 additions and 2 deletions

View File

@@ -612,7 +612,7 @@ IMAGEGEN_PROVIDERS: dict[str, GenerationProviderSpec] = {
"openai": GenerationProviderSpec(
label="OpenAI",
default_api_base="https://api.openai.com/v1",
default_model="gpt-image-1",
default_model="gpt-image-2.6-flare",
),
"xai": GenerationProviderSpec(
label="xAI (Grok Imagine)",
@@ -635,7 +635,7 @@ IMAGEGEN_PROVIDERS: dict[str, GenerationProviderSpec] = {
label="OpenRouter",
default_api_base="https://openrouter.ai/api/v1",
adapter="chat_completions",
default_model="google/gemini-2.5-flash-image-preview",
default_model="google/gemini-3.1-flash-image",
),
"azure_openai": GenerationProviderSpec(
label="Azure OpenAI",

View File

@@ -0,0 +1,29 @@
"""Image-generation Settings prefills must name models the provider still serves.
OpenAI retired gpt-image-1 on 2026-10-23 (dall-e-2 and dall-e-3 on 2026-05-12) and
shuts gpt-image-2 down on 2027-02-10, naming gpt-image-2.6-flare or -sunburst:
https://platform.openai.com/docs/deprecations. OpenRouter no longer lists
google/gemini-2.5-flash-image-preview.
"""
from deeptutor.services.config.provider_runtime import IMAGEGEN_PROVIDERS
RETIRED = {
"openai": {"gpt-image-2", "gpt-image-1", "dall-e-3", "dall-e-2"},
"openrouter": {"google/gemini-2.5-flash-image-preview"},
}
def test_openai_prefill_is_a_served_image_model() -> None:
spec = IMAGEGEN_PROVIDERS["openai"]
assert spec.default_model == "gpt-image-2.6-flare"
assert spec.default_model not in RETIRED["openai"]
def test_openrouter_prefill_is_a_listed_image_model() -> None:
spec = IMAGEGEN_PROVIDERS["openrouter"]
assert spec.default_model == "google/gemini-3.1-flash-image"
assert spec.default_model not in RETIRED["openrouter"]
assert spec.adapter == "chat_completions"