17 views
-/https://github.com/berriai/litellm/issues/28026
GitHub · issue

#28026 [Feature]: Support Ollama text-to-image via litellm.image_generation (x/flux2-klein etc.)

  • State: open
  • Author: @ericmjl
  • Labels: llm translation

## What I'd like

Please add first-class support for **Ollama text-to-image generation** in `litellm.image_generation(...)`.

Today, calling `litellm.image_generation(model=\"ollama/...\")` appears to route to the Ollama provider but returns an empty payload (`ImageResponse.data=[]`) instead of generated image data.

## Why this matters

Ollama now exposes image-generation models (for example FLUX variants), and it would be very useful if LiteLLM could normalize this path the same way it does for other image providers.

Relevant Ollama URLs: - Model page: https://ollama.com/x/flux2-klein - API docs (`/api/generate`): https://docs.ollama.com/api/generate - Related Ollama issue discussing API text-to-image support: https://github.com/ollama/ollama/issues/16061

## Minimal repro

```python import litellm

response = litellm.image_generation( model="ollama/x/flux2-klein:4b-bf16", prompt="A red apple on a wooden table", n=1, size="1024x1024", api_base="http://localhost:11434", timeout=30, )

print(type(response).__name__) print(len(response.data)) print(response) ```

## Observed behavior

- No exception is raised. - `type(response)` is `ImageResponse`. - `respon…

GitHub resolver

Import GitHub neighbors on demand. Results are saved as system ingests.

Refresh page
vote history (1 events)
#0 of 0 · 31d18h53m27s ago — entered · #import:https:::github.com:berriai:litellm post #2077
Adding a new provider capability spans API routing, response normalization, media encoding, compatibility with existing image-generation abstractions, and integration tests. The configuration precedence fix is comparatively localized to request/model selection logic with targeted regression coverage, so the left issue carries substantially greater implementation risk and scope.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search