[Tracker]
Update Summary: Models supporting image generation are not detected
Short Description: Models supporting image generation are not detected
Check-in Date: 12/16/2025
Metadata is used by the AI Tracker. Docs and additional fields here.
[/Tracker]

In my LLM instance, when using model/info we can see several keys indicating the operation supported by the models

"mode": "image_generation",
"supports_system_messages": null,
"supports_response_schema": null,
"supports_vision": null,
"supports_function_calling": null,
"supports_tool_choice": null,
"supports_assistant_prefill": null,
"supports_prompt_caching": null,
"supports_audio_input": null,
"supports_audio_output": null,
"supports_pdf_input": null,
"supports_embedding_image_input": null,
"supports_native_streaming": null,
"supports_web_search": null,
"supports_url_context": null,
"supports_reasoning": null,
"supports_computer_use": null,

Actual code detects imageInput and imageOutput differently than than the output of the API

 public static function createFromResponse(\stdClass $response): self {
    $model_info = $response->model_info;
    return new self(
      $response->model_name,
      $model_info->supports_image_input ?? FALSE,
      $model_info->supports_image_output ?? FALSE,
      $model_info->supports_audio_input ?? FALSE,
      $model_info->supports_audio_output ?? FALSE,
      $model_info->supports_video_output ?? FALSE,
      ($model_info->mode ?? NULL) === 'embedding',
      ($model_info->mode ?? NULL) === 'chat',
      $model_info->supports_moderation ?? FALSE,
      $model_info->supported_openai_params ?? [],
    );
  }

- supports_image_input is under supports_vision
- supports_image_output is under mode: "image_generation"

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

heyyo created an issue. See original summary.

heyyo’s picture

Issue summary: View changes

heyyo’s picture

Status: Active » Needs review
nikro’s picture

Assigned: Unassigned » nikro

I'll pick this up and will test against our providers - I wonder if this fix will auto-magically work through-out everywhere.

nikro’s picture

Issue summary: View changes
nikro’s picture

Assigned: nikro » Unassigned
Status: Needs review » Reviewed & tested by the community

This works well (I know it's a small change, but I never tested LiteLLM with image generation).
I proxied openai/gpt-image-1-mini as:

  - model_name: gpt-image
    litellm_params:
      model: openai/gpt-image-1-mini
      api_key: os.environ/OPENAI_API_KEY

It worked well.

dan2k3k4’s picture

Status: Reviewed & tested by the community » Needs work

I did a refactor in the `ai_provider_amazeeio` which uses LiteLLM under the hood, so the code for `ai_provider_litellm` can use the same code

https://git.drupalcode.org/project/ai_provider_amazeeio/-/blob/fd79f50e4...

dan2k3k4’s picture

Status: Needs work » Needs review
nikro’s picture

Assigned: Unassigned » nikro

I'll check the 17th MR, it's a bit wider scope but I totally welcome larger scope :)

credevator’s picture

Assigned: nikro » Unassigned
Status: Needs review » Reviewed & tested by the community

I reviewed the MR !16 and it fixes the issue of missing models in Text-to-Image. We should go ahead with changes in MR !16, It will unblock the image generation capability for users who use this provider.

MR!17 has lot many changes but using that change, I still do not get the model listed in Text-To-Image.

dan2k3k4’s picture

Status: Reviewed & tested by the community » Fixed

Merged MR 16

We can do MR 17 in a follow-up

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

dan2k3k4’s picture

Status: Fixed » Closed (fixed)