FoundationAgents/OpenManus · error · ValueError
Model {self.model} does not support images. Use a model from
Error message
Model {self.model} does not support images. Use a model from {MULTIMODAL_MODELS} What it means
Raised by LLM.ask_with_images() when self.model is not in the MULTIMODAL_MODELS allowlist. The method attaches image_url content parts, which text-only models reject or silently mishandle, so it refuses up front. The allowlist is a module-level constant in this package, not provider capability discovery.
Source
Thrown at app/llm.py:519
images: List of image URLs or image data dictionaries
system_msgs: Optional system messages to prepend
stream (bool): Whether to stream the response
temperature (float): Sampling temperature for the response
Returns:
str: The generated response
Raises:
TokenLimitExceeded: If token limits are exceeded
ValueError: If messages are invalid or response is empty
OpenAIError: If API call fails after retries
Exception: For unexpected errors
"""
try:
# For ask_with_images, we always set supports_images to True because
# this method should only be called with models that support images
if self.model not in MULTIMODAL_MODELS:
raise ValueError(
f"Model {self.model} does not support images. Use a model from {MULTIMODAL_MODELS}"
)
# Format messages with image support
formatted_messages = self.format_messages(messages, supports_images=True)
# Ensure the last message is from the user to attach images
if not formatted_messages or formatted_messages[-1]["role"] != "user":
raise ValueError(
"The last message must be from the user to attach images"
)
# Process the last user message to include images
last_message = formatted_messages[-1]
# Convert content to multimodal format if needed
content = last_message["content"]
multimodal_content = (View on GitHub (pinned to 52a13f2a57)
Solutions
- Use a model from MULTIMODAL_MODELS, e.g. set model="gpt-4o" in config before calling ask_with_images()
- If your model truly supports vision but isn't listed, add it to MULTIMODAL_MODELS in the module (or upgrade the package)
- Branch your code: call ask() for text-only models and ask_with_images() only for vision models
Example fix
# before
llm = LLM(model="gpt-3.5-turbo")
await llm.ask_with_images("describe", [img]) # ValueError
# after
llm = LLM(model="gpt-4o")
await llm.ask_with_images("describe", [img]) Defensive patterns
Strategy: type-guard
Validate before calling
from app.llm import MULTIMODAL_MODELS
def model_supports_images(model: str) -> bool:
return model in MULTIMODAL_MODELS Type guard
from typing import TypeGuard
from app.llm import MULTIMODAL_MODELS
def is_vision_model(model: object) -> TypeGuard[str]:
return isinstance(model, str) and model in MULTIMODAL_MODELS Try / catch
try:
out = await llm.ask_with_images("describe", images)
except ValueError as e:
if "does not support images" in str(e):
out = await llm.ask("describe (images omitted)") # degrade to text
else:
raise Prevention
- Gate vision code paths behind a MULTIMODAL_MODELS membership check
- Pin vision-capable models in config for any feature that sends images
- After package upgrades, re-check the MULTIMODAL_MODELS list before adding new models
When it happens
Trigger: Constructing LLM with a text-only model (e.g. "gpt-3.5-turbo" or a non-vision fine-tune) then calling ask_with_images(); model name casing/alias mismatch causing the string to miss the allowlist; new vision model not yet added to MULTIMODAL_MODELS in this version.
Common situations: Switching the [llm] config to a cheaper text model and forgetting a code path calls ask_with_images; using a custom/local model name that is vision-capable but absent from the constant; version lag where a newly released vision model isn't in the list.
Related errors
- Unsupported image format: {image}
- The last message must be from the user to attach images
- No response received from the LLM
- Request may exceed input token limit (Current: {self.total_i
- Empty or invalid response from LLM
AI-assisted analysis of FoundationAgents/OpenManus@52a13f2a57 (2026-08-15).
Data as JSON: /api/errors/4600a02b423e4206.
Report an issue: GitHub.