[GH-ISSUE #20634] issue: OpenRouter image generation Chunk too big error #34770

Closed
opened 2026-04-25 08:56:51 -05:00 by GiteaMirror · 11 comments
Owner

Originally created by @eniraa on GitHub (Jan 13, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/20634

Check Existing Issues

  • I have searched for any existing and/or related issues.
  • I have searched for any existing and/or related discussions.
  • I have also searched in the CLOSED issues AND CLOSED discussions and found no related items (your issue might already be addressed on the development branch!).
  • I am using the latest version of Open WebUI.

Installation Method

Docker

Open WebUI Version

v0.7.2

Ollama Version (if applicable)

No response

Operating System

Debian 13.0

Browser (if applicable)

No response

Confirmation

  • I have read and followed all instructions in README.md.
  • I am using the latest version of both Open WebUI and Ollama.
  • I have included the browser console logs.
  • I have included the Docker container logs.
  • I have provided every relevant configuration, setting, and environment variable used in my setup.
  • I have clearly listed every relevant configuration, custom setting, environment variable, and command-line option that influences my setup (such as Docker Compose overrides, .env values, browser settings, authentication configurations, etc).
  • I have documented step-by-step reproduction instructions that are precise, sequential, and leave nothing to interpretation. My steps:
  • Start with the initial platform/version/OS and dependencies used,
  • Specify exact install/launch/configure commands,
  • List URLs visited, user input (incl. example values/emails/passwords if needed),
  • Describe all options and toggles enabled or changed,
  • Include any files or environmental changes,
  • Identify the expected and actual result at each stage,
  • Ensure any reasonably skilled user can follow and hit the same issue.

Expected Behavior

Image generation succeeds and the image is displayed

Actual Behavior

A Chunk too big error is displayed

Steps to Reproduce

  1. Set the API endpoint to OpenRouter
  2. Start a new chat
  3. Select Google: Nano Banana Pro (Gemini 3 Pro Image Preview)
  4. Ask to generate an image

Logs & Screenshots

Image

Docker log

Additional Information

I have tested with these environment variables both set and unset, all with the same issue.

CHAT_STREAM_RESPONSE_CHUNK_MAX_BUFFER_SIZE=20971520
ENABLE_CHAT_RESPONSE_BASE64_IMAGE_URL_CONVERSION=true
Originally created by @eniraa on GitHub (Jan 13, 2026). Original GitHub issue: https://github.com/open-webui/open-webui/issues/20634 ### Check Existing Issues - [x] I have searched for any existing and/or related issues. - [x] I have searched for any existing and/or related discussions. - [x] I have also searched in the CLOSED issues AND CLOSED discussions and found no related items (your issue might already be addressed on the development branch!). - [x] I am using the latest version of Open WebUI. ### Installation Method Docker ### Open WebUI Version v0.7.2 ### Ollama Version (if applicable) _No response_ ### Operating System Debian 13.0 ### Browser (if applicable) _No response_ ### Confirmation - [x] I have read and followed all instructions in `README.md`. - [x] I am using the latest version of **both** Open WebUI and Ollama. - [x] I have included the browser console logs. - [x] I have included the Docker container logs. - [x] I have **provided every relevant configuration, setting, and environment variable used in my setup.** - [x] I have clearly **listed every relevant configuration, custom setting, environment variable, and command-line option that influences my setup** (such as Docker Compose overrides, .env values, browser settings, authentication configurations, etc). - [x] I have documented **step-by-step reproduction instructions that are precise, sequential, and leave nothing to interpretation**. My steps: - Start with the initial platform/version/OS and dependencies used, - Specify exact install/launch/configure commands, - List URLs visited, user input (incl. example values/emails/passwords if needed), - Describe all options and toggles enabled or changed, - Include any files or environmental changes, - Identify the expected and actual result at each stage, - Ensure any reasonably skilled user can follow and hit the same issue. ### Expected Behavior Image generation succeeds and the image is displayed ### Actual Behavior A `Chunk too big` error is displayed ### Steps to Reproduce 1. Set the API endpoint to OpenRouter 2. Start a new chat 3. Select `Google: Nano Banana Pro (Gemini 3 Pro Image Preview)` 4. Ask to generate an image ### Logs & Screenshots <img width="2082" height="962" alt="Image" src="https://github.com/user-attachments/assets/db53fc41-16f7-49bd-bb3e-64cc51bb71bf" /> [Docker log](https://mystb.in/d8554a3aa24e4c8cca) ### Additional Information I have tested with these environment variables both set and unset, all with the same issue. ``` CHAT_STREAM_RESPONSE_CHUNK_MAX_BUFFER_SIZE=20971520 ENABLE_CHAT_RESPONSE_BASE64_IMAGE_URL_CONVERSION=true ```
GiteaMirror added the bug label 2026-04-25 08:56:51 -05:00
Author
Owner

@owui-terminator[bot] commented on GitHub (Jan 13, 2026):

🔍 Similar Issues Found

I found some existing issues that might be related to this one. Please check if any of these are duplicates or contain helpful solutions:

  1. #19019 issue: Image generation doesn't work with OpenRouter
    by vladkvit • Nov 07, 2025 • bug

  2. #19522 feat: open router image create/edit
    by davidpede • Nov 26, 2025 • bug

  3. #19816 issue: duplicated images when using openrouter
    by M0n7y5 • Dec 08, 2025 • bug

  4. #19800 issue: "Chunk too big" error when using "perplexity/sonar-deep-research:online" in open router
    by mahdikohan • Dec 07, 2025 • bug

  5. #20436 issue: image generation cannot finish normally
    by lywbh • Jan 07, 2026 • bug

Show 1 more related issues
  1. #20361 Issue: Large-scale model setting-related functionality fails.
    by shentong0722 • Jan 04, 2026 • bug

💡 Tips:

  • If this is a duplicate, please consider closing this issue and adding any additional details to the existing one
  • If you found a solution in any of these issues, please share it here to help others

This comment was generated automatically by a bot. Please react with a 👍 if this comment was helpful, or a 👎 if it was not.

<!-- gh-comment-id:3742094353 --> @owui-terminator[bot] commented on GitHub (Jan 13, 2026): 🔍 **Similar Issues Found** I found some existing issues that might be related to this one. Please check if any of these are duplicates or contain helpful solutions: 1. [#19019](https://github.com/open-webui/open-webui/issues/19019) **issue: Image generation doesn't work with OpenRouter** *by vladkvit • Nov 07, 2025 • `bug`* 2. [#19522](https://github.com/open-webui/open-webui/issues/19522) **feat: open router image create/edit** *by davidpede • Nov 26, 2025 • `bug`* 3. [#19816](https://github.com/open-webui/open-webui/issues/19816) **issue: duplicated images when using openrouter** *by M0n7y5 • Dec 08, 2025 • `bug`* 4. [#19800](https://github.com/open-webui/open-webui/issues/19800) **issue: "**Chunk too big**" error when using "perplexity/sonar-deep-research:online" in open router** *by mahdikohan • Dec 07, 2025 • `bug`* 5. [#20436](https://github.com/open-webui/open-webui/issues/20436) **issue: image generation cannot finish normally** *by lywbh • Jan 07, 2026 • `bug`* <details> <summary>Show 1 more related issues</summary> 6. [#20361](https://github.com/open-webui/open-webui/issues/20361) **Issue: Large-scale model setting-related functionality fails.** *by shentong0722 • Jan 04, 2026 • `bug`* </details> --- 💡 **Tips:** - If this is a duplicate, please consider closing this issue and adding any additional details to the existing one - If you found a solution in any of these issues, please share it here to help others *This comment was generated automatically by a bot.* Please react with a 👍 if this comment was helpful, or a 👎 if it was not.
Author
Owner

@eniraa commented on GitHub (Jan 13, 2026):

This version is after #19073 was merged, so I don't think the previous issues are in the same situation. I have also attached a screenshot from the network tab:

Image
<!-- gh-comment-id:3742118459 --> @eniraa commented on GitHub (Jan 13, 2026): This version is after #19073 was merged, so I don't think the previous issues are in the same situation. I have also attached a screenshot from the network tab: <img width="1378" height="898" alt="Image" src="https://github.com/user-attachments/assets/e167832a-5ac0-42e5-a1f2-b3689658bd39" />
Author
Owner

@Classic298 commented on GitHub (Jan 13, 2026):

try with larger buffer size. gemini 3 pro can create 4k images

<!-- gh-comment-id:3742632010 --> @Classic298 commented on GitHub (Jan 13, 2026): try with larger buffer size. gemini 3 pro can create 4k images
Author
Owner

@eniraa commented on GitHub (Jan 13, 2026):

Tried with 34359738368, which is significantly larger than the suggestions I've seen in the closed issues; same problem. Do you have any recommendations for how high I should set it?

NB I've also tried on Gemini 2.5 and encountered the same problem, so I am a little skeptical that it's due to the size that I've set. There's a chance that my docker-compose.yml is not configured correctly, so to get that out of the way, I'll paste it below:

services:
  open-webui:
    image: ghcr.io/open-webui/open-webui:main
    restart: unless-stopped
    volumes:
      - open-webui:/app/backend/data
    networks:
      - traefik
    labels:
      - traefik.enable=true
      - traefik.http.routers.openwebui.rule=Host(`[…]`)
      - traefik.http.routers.openwebui.entrypoints=websecure
      - traefik.http.routers.openwebui.tls.certresolver=letsencrypt
      - traefik.http.services.openwebui.loadbalancer.server.port=8080
    environment:
      CHAT_STREAM_RESPONSE_CHUNK_MAX_BUFFER_SIZE: 34359738368
volumes:
  open-webui: null
networks:
  traefik:
    external: true
<!-- gh-comment-id:3742759857 --> @eniraa commented on GitHub (Jan 13, 2026): Tried with `34359738368`, which is significantly larger than the suggestions I've seen in the closed issues; same problem. Do you have any recommendations for how high I should set it? NB I've also tried on Gemini 2.5 and encountered the same problem, so I am a little skeptical that it's due to the size that I've set. There's a chance that my `docker-compose.yml` is not configured correctly, so to get that out of the way, I'll paste it below: ``` services: open-webui: image: ghcr.io/open-webui/open-webui:main restart: unless-stopped volumes: - open-webui:/app/backend/data networks: - traefik labels: - traefik.enable=true - traefik.http.routers.openwebui.rule=Host(`[…]`) - traefik.http.routers.openwebui.entrypoints=websecure - traefik.http.routers.openwebui.tls.certresolver=letsencrypt - traefik.http.services.openwebui.loadbalancer.server.port=8080 environment: CHAT_STREAM_RESPONSE_CHUNK_MAX_BUFFER_SIZE: 34359738368 volumes: open-webui: null networks: traefik: external: true ```
Author
Owner

@Classic298 commented on GitHub (Jan 13, 2026):

are you using two different config syntax types?

<!-- gh-comment-id:3743502766 --> @Classic298 commented on GitHub (Jan 13, 2026): are you using two different config syntax types?
Author
Owner

@eniraa commented on GitHub (Jan 13, 2026):

I have tested both the environment key in a docker-compose.yml and having an external .env. Neither of these worked to resolve the problem.

<!-- gh-comment-id:3745734671 --> @eniraa commented on GitHub (Jan 13, 2026): I have tested both the `environment` key in a `docker-compose.yml` and having an external `.env`. Neither of these worked to resolve the problem.
Author
Owner

@Classic298 commented on GitHub (Jan 14, 2026):

cc @ShirasawaSama

<!-- gh-comment-id:3749302359 --> @Classic298 commented on GitHub (Jan 14, 2026): cc @ShirasawaSama
Author
Owner

@ShirasawaSama commented on GitHub (Jan 14, 2026):

Have you tried a smaller value? For example: 31457280

<!-- gh-comment-id:3749429513 --> @ShirasawaSama commented on GitHub (Jan 14, 2026): Have you tried a smaller value? For example: 31457280
Author
Owner

@PVBLIC-F commented on GitHub (Jan 16, 2026):

I use OpenRouter too. I worked around this by turning off streaming for the models I’m using to generate images.

<!-- gh-comment-id:3761538140 --> @PVBLIC-F commented on GitHub (Jan 16, 2026): I use OpenRouter too. I worked around this by turning off streaming for the models I’m using to generate images.
Author
Owner

@ShirasawaSama commented on GitHub (Jan 23, 2026):

Have you tried manually cloning the repository to use OpenWebUI instead of using Docker? Would you still encounter issues this way?

<!-- gh-comment-id:3791336808 --> @ShirasawaSama commented on GitHub (Jan 23, 2026): Have you tried manually cloning the repository to use OpenWebUI instead of using Docker? Would you still encounter issues this way?
Author
Owner

@Classic298 commented on GitHub (Feb 6, 2026):

cannot reproduce even with many tries as long as the env vars are correctly configured

<!-- gh-comment-id:3862649720 --> @Classic298 commented on GitHub (Feb 6, 2026): cannot reproduce even with many tries as long as the env vars are correctly configured
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#34770