[GH-ISSUE #13834] issue: task models error when base64 text content is present (images) #17046

Closed
opened 2026-04-19 22:49:19 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @almajo on GitHub (May 13, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/13834

Check Existing Issues

  • I have searched the existing issues and discussions.
  • I am using the latest version of Open WebUI.

Installation Method

Git Clone

Open WebUI Version

v0.6.9

Ollama Version (if applicable)

No response

Operating System

linux

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 listed steps to reproduce the bug in detail.

Expected Behavior

Task models like title and tag generation should work without images or other base64 content for quick and cheap responses.

Actual Behavior

As embedded images are simply text, they use a lot of tokens and thereby surpass context lengths which leads to chats being called "New Chat".

Steps to Reproduce

  1. Create a large image with any model so that it is present in the chat (e.g. the gpt-image-1 function)

Logs & Screenshots

Image

Additional Information

I already added a fix in the latest release for some use cases but forgot about the embedded image case. This should be an easy add-on in the implementation.

Originally created by @almajo on GitHub (May 13, 2025). Original GitHub issue: https://github.com/open-webui/open-webui/issues/13834 ### Check Existing Issues - [x] I have searched the existing issues and discussions. - [x] I am using the latest version of Open WebUI. ### Installation Method Git Clone ### Open WebUI Version v0.6.9 ### Ollama Version (if applicable) _No response_ ### Operating System linux ### 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 listed steps to reproduce the bug in detail. ### Expected Behavior Task models like title and tag generation should work without images or other base64 content for quick and cheap responses. ### Actual Behavior As embedded images are simply text, they use a lot of tokens and thereby surpass context lengths which leads to chats being called "New Chat". ### Steps to Reproduce 1. Create a large image with any model so that it is present in the chat (e.g. the gpt-image-1 function) ### Logs & Screenshots <img width="380" alt="Image" src="https://github.com/user-attachments/assets/5839cbc6-699a-4836-99ac-41c4fdfa45f5" /> ### Additional Information I already added a fix in the latest release for some use cases but forgot about the embedded image case. This should be an easy add-on in the implementation.
GiteaMirror added the bug label 2026-04-19 22:49:19 -05:00
Author
Owner

@tjbck commented on GitHub (May 16, 2025):

Should be addressed by 528a2cf96a, testing wanted here!

<!-- gh-comment-id:2886860383 --> @tjbck commented on GitHub (May 16, 2025): Should be addressed by 528a2cf96a8bef32fd9f8fdc8467908b52895a3a, testing wanted here!
Author
Owner

@almajo commented on GitHub (May 19, 2025):

Hey, as far as I see, this doesn't fix the issue.

The use case I described is especially important for Functions which create images and show them to the user via markdown. Hereby, they simply emit the picture as a string, hence the content would be as string in message['content'].

A fix would be

if isinstance(content, str):
    patterns = [r"<details\b[^>]*>.*?<\/details>", "r"!\[.*?\]\(data:image\/[a-zA-Z]+;base64,[A-Za-z0-9+/=]+\)"]
    for p in patterns:
      content = re.sub(
          p,
          "",
          content,
          flags=re.S | re.I,
      ).strip()

The base64 pattern should be verified

<!-- gh-comment-id:2889680603 --> @almajo commented on GitHub (May 19, 2025): Hey, as far as I see, this doesn't fix the issue. The use case I described is especially important for Functions which create images and show them to the user via markdown. Hereby, they simply emit the picture as a string, hence the content would be as string in `message['content']`. A fix would be ```python if isinstance(content, str): patterns = [r"<details\b[^>]*>.*?<\/details>", "r"!\[.*?\]\(data:image\/[a-zA-Z]+;base64,[A-Za-z0-9+/=]+\)"] for p in patterns: content = re.sub( p, "", content, flags=re.S | re.I, ).strip() ``` The base64 pattern should be verified
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#17046