Bug: Ollama serializer rejects remote image URLs and uppercase data URLs
Author: FanouZeng-TTCreated Sep 28, 2026Updated Sep 28, 2026
Browser Use Version
4cbe921673b48a488f5415d9159249afd12a625b (current main)
Bug Description, Steps to Reproduce, Screenshots
ImageURL documents that url may contain either a remote image URL or base64 image data. The Ollama serializer currently forwards non-lowercase-data values to ollama.Image as strings and assumes the SDK will download remote URLs.
The Ollama SDK does not download HTTP(S) strings: it treats them as local file paths or raw base64. As a result:
- A remote URL ending in
.pngfails during request serialization withValueError: File http://.../image.png does not exist. - An uppercase
DATA:image/...URL misses the case-sensitivedata:branch and fails withValueError: Invalid image data, expected base64 string or path to image file.
Both failures occur before the request reaches Ollama.
Failing Python Code
from browser_use.llm.messages import ContentPartImageParam, ImageURL, UserMessage
from browser_use.llm.ollama.serializer import OllamaMessageSerializer
for url in (
"https://example.com/image.png",
"DATA:image/png;base64,aGVsbG8=",
):
message = UserMessage(
content=[ContentPartImageParam(image_url=ImageURL(url=url))]
)
OllamaMessageSerializer.serialize(message).model_dump(mode="json")LLM Model
Any multimodal model through ChatOllama.
Operating System & Browser Versions
macOS; provider-independent serializer failure.
Full DEBUG Log Output
ValueError: File https://example.com/image.png does not exist
ValueError: Invalid image data, expected base64 string or path to image fileSource: browser-use/browser-use