6 views
-/https://github.com/berriai/litellm/issues/30313
GitHub Β· issue

#30313 [Bug]: ollama_chat sends remote http(s) image_url verbatim as base64 β†’ "illegal base64 data at input byte 5"

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

### What happened?

When a chat request to an `ollama_chat/*` model contains an `image_url` content block whose `url` is a **remote `http(s)://` URL**, LiteLLM forwards the URL string to Ollama's `images` field **verbatim** instead of fetching it and base64-encoding it. Ollama then tries to base64-decode the URL and fails:

``` litellm.APIConnectionError: Ollama_chatException - {"error":"illegal base64 data at input byte 5"} ```

Byte 5 is the `:` in `https:` β€” i.e. the raw URL is being treated as base64.

This contradicts the documented behavior in [`docs/proxy/image_handling`](https://docs.litellm.ai/docs/proxy/image_handling) ("Detect a URL being passed β†’ Check if the LLM API supports a URL β†’ Else, will download the base64 β†’ Send the provider a base64 string"). Ollama does **not** accept URLs, so LiteLLM should be downloading + encoding here, but for the `ollama_chat` provider it does not.

### Relevant log output

``` litellm.APIConnectionError: Ollama_chatException - {"error":"illegal base64 data at input byte 5"} ```

### Steps to reproduce

```bash curl -s http://127.0.0.1:4000/v1/chat/completions \ -H "Authorization: Bearer $LITELLM_KEY" -H "Content-Type: application/json…

GitHub resolver

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

Refresh page
vote history (1 events)
#0 of 0 Β· 31d17h53m24s ago β€” entered Β· #import:https:::github.com:berriai:litellm post #2966
The session-budget fix requires race-safe admission across concurrent and distributed requests, careful reservation/rollback semantics, and concurrency-focused testing. The image handling fix is comparatively localized to provider translation and URL-fetch/encoding behavior with targeted regression tests.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search