[Bug] Randomly Getting "Invalid base64 value" When Valid MCP Image Returns
Issue
Randomly the llama server decides that the returned base64 value is invalid, causing the entire context window to get reprocessed, even though the MCP tool says the image has returned and also the image is embedded (shown) correctly in the chat so clearly the image returned has the correct data. A lot of times the returned MCP images get processed properly but then there are random times where it has these errors even though they are returned correctly via the same tools.
After the error happens with the returned MCP image, the entire context window gets reprocessed and then the image that was returned that invoked the error initially is then processed normally and it continues so there might be an issue with how MCP images are sent for processing.
Llama Server Logs
601.41.327.150 W srv operator(): got exception: {"error":{"code":500,"message":"Invalid base64 value","type":"server_error"}}Environment
Where are you using Unsloth?
- Unsloth desktop application
- Unsloth web UI (
unsloth studio) - Unsloth CLI
- Python package or notebook
- Colab or Kaggle
Operating system and version: Ubuntu 26
GPU model(s) and accelerator backend: NVIDIA CUDA
Versions: Unsloth Version GitHub Main Package Version 2026.9.11
What happened?
Sometimes when MCP images are returned, deep in the context, there are "Invalid base64 value" errors in logs and the entire context window gets reprocessed, even though the images show in chat properly so they have valid data.
Model and operation involved: Model: https://huggingface.co/AtomicChat/Qwen3.8-Flash-Next-GGUF/tree/main/Qwen3.8-Flash-Next-AD-5.00bpw-Q5_K_M-M64
Source: unslothai/unsloth