I've been getting `unexpected_error` for about the last 2 hours calling Llama-3.2-11B-Vision-Instruct

I just tried the new Llama 4 model in the sandbox, and it’s working perfectly. However, I’m still having no luck using it or any of the other vision models via API.

Can you try using this CURL command, which passes in a simple red square as the image in base64 to see if it works for you? I have tried it with different API keys under my original account, and also set up a new account, just to see if that was the issue, and none of these tests worked.

curl -H “Authorization: Bearer [API-KEY]”
-H “Content-Type: application/json”
-d ‘{
“stream”: true,
“model”: “Llama-4-Maverick-17B-128E-Instruct”,
“messages”: [
{
“role”: “user”,
“content”: [
{
“type”: “text”,
“text”: “What do you see in this image”
},
{
“type”: “image_url”,
“image_url”: {
“url”: “data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAA/0lEQVR4nO3YMQ7DIBREQe5/6SpKEQpoBY/xepoxJRXiT3C2nTHGR54zxrjva6037WVjzLq2xuxnnfOHemfOqwvw8wMCBAjIjO2dt9a6DX08f3fefPqz39/+BBAgIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgIBoTHe/cCBAgQIECAAAECBAgQIECAgMTY+P/p7xAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQICA2NjdC3xrfv3pT0CAAAECYmPjng8IECDA76EAn58QIECAAAECBLwBwFKDATXS/CoAAAAASUVORK5CYII=”
}
}
]
}
]
}’
-X POST https://api.sambanova.ai/v1/chat/completions

hey @edward.cruz, I tried your curl command and, like you said, it didn’t work and was curious to see if it was the image.

I changed the base64 image with the one below (blue 64x64 square) and it worked well! Could your base64 be malformed?

"url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAIAAAAlC+aJAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAdnJLH8AAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAAuIwAALiMBeKU/dgAAAAd0SU1FB+kEEQcZHR3zpZQAAABQSURBVGje7c9BDQAwCASwY3rwbw9U7EHSOmh1Jpe9HCcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICDw3wKb0wGrRDaRPgAAAABJRU5ErkJggg=="
1 Like

Hey @neks , thanks for trying that. I tried this with my CURL script and it worked initially, but now it’s not again… Can you try it again and let me know if it is working for you or not still?

OK, I finally got to the bottom of this: you cannot include a system section in the prompt – that blows it up every time. And if you strip that out, it works great.

The confusion or concern for me was that gpt-4o-mini (which in my app is a fallback) has no problem with the system prompt being there.

Not sure if this is something that can be addressed with tuning or if it’s a known limitation of the Llama models, but at least now there is a clear cause for the problem and an easy workaround.

1 Like

I just tested this on fireworks.ai with their Llama 4 implementation via API, and image processing works fine both with and without the system content. So it must be something specific to the implementation here.

@edward.cruz I think I ran into the same issue when I was trying to use Samba’s API using OpenAI API’s specs. I realized it’s closer to DeepSeek’s API specs where if you had multiple messages and content objects at the same time it would fail.

Correct me if I’m wrong but you’re trying to send a call with the message like this and fails:

  "messages": [
    { "role": "system", "content": "You are a helpful VLM" },
    { "role": "user", "content": [
        { "type": "text",  "text": "What do you see in this image" },
        { "type": "image_url", "image_url": {  "url": "..." } }
    ]}]

I realized that with Samba’s API they don’t allow an array of content parts if there’s a system prompt (or another message object). Since vision requires that array inside content, I’m not sure how do to both the system and image at the same time with Samba’s API :confused:

3 Likes

@omkar.gangan , @coby.adams, just wanted to make sure this issue was on your radar. I really like what I’m seeing with the new Llama 4 model, so I hope this can be addressed there.

@edward.cruz and @neks I am diving into this

-Coby

2 Likes

Thanks @coby.adams! Let me know if you need more information from my end to reproduce the issue that I encountered.

Yes currently Llama-4-Maverick-17B-128E-Instruct does not support system prompt, we have raised it to our Engineering Team and We are working on it.

We apologize for the inconvenience and appreciate your understanding.
Thanks

Best regards,
Omkar

2 Likes

Hello @neks , @edward.cruz , We would like to inform you that the system prompt issue has been resolved. Can you please proceed to test the functionality from your end at your convenience.
Please let us know if everything is working as expected or if you encounter any further issues. We’ll be happy to assist further if needed.
Thank you for your patience and continued support.
Regards,
Omkar

1 Like

Thanks @omkar.gangan! Using the message from my post from above, I can confirm this works for images and texts on Llama Scout.

2 Likes

Hi, when will Llama-4-Maverick-17B-128E-Instruct be moved from preview to production for higher capacity? It’s the only vision model that’s supported now, correct?