[GH-ISSUE #11535] qwen2.5vl:7b Not support restful /api/generate #54125

Closed
opened 2026-04-29 05:15:10 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @spwang84 on GitHub (Jul 26, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/11535

What is the issue?

Hi team,

I found the restful API does not seem to work for the qwen2.5vl series

    ocr_data = {
        # "model": "gemma3:27b",
        "model": "qwen2.5vl:7b",
        "prompt": ocr_prompt,
        "images": [img_b64],
        "stream": False
    }

Always get the below result from any prompt, such as: identify the content or extract all words from the image.

<|im_start|>

Thank you.

Relevant log output


OS

No response

GPU

No response

CPU

No response

Ollama version

No response

Originally created by @spwang84 on GitHub (Jul 26, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/11535 ### What is the issue? Hi team, I found the restful API does not seem to work for the qwen2.5vl series ocr_data = { # "model": "gemma3:27b", "model": "qwen2.5vl:7b", "prompt": ocr_prompt, "images": [img_b64], "stream": False } Always get the below result from any prompt, such as: identify the content or extract all words from the image. <|im_start|> Thank you. ### Relevant log output ```shell ``` ### OS _No response_ ### GPU _No response_ ### CPU _No response_ ### Ollama version _No response_
GiteaMirror added the macosbug labels 2026-04-29 05:15:11 -05:00
Author
Owner

@rick-github commented on GitHub (Jul 27, 2025):

#!/usr/bin/env python3

import requests
import base64
import sys

ocr_prompt = "identify the content or extract all words from the image."

with open(sys.argv[1], "rb") as f:
    img_data = f.read()
    img_b64 = base64.b64encode(img_data).decode('utf-8')

ocr_data = {
    # "model": "gemma3:27b",
    "model": "qwen2.5vl:7b",
    "prompt": ocr_prompt,
    "images": [img_b64],
    "stream": False
}

response = requests.post("http://localhost:11434/api/generate", json=ocr_data)
print(response.text)
$ convert -size 300x100 xc:white -pointsize 20 -fill black -gravity center -annotate +0+0 "hello world" hello_world.jpg
$ ./11535.py hello_world.jpg | jq -r .response
The content of the image is:

```
hello world
```

Server logs may aid in debugging.

<!-- gh-comment-id:3124103467 --> @rick-github commented on GitHub (Jul 27, 2025): ```python #!/usr/bin/env python3 import requests import base64 import sys ocr_prompt = "identify the content or extract all words from the image." with open(sys.argv[1], "rb") as f: img_data = f.read() img_b64 = base64.b64encode(img_data).decode('utf-8') ocr_data = { # "model": "gemma3:27b", "model": "qwen2.5vl:7b", "prompt": ocr_prompt, "images": [img_b64], "stream": False } response = requests.post("http://localhost:11434/api/generate", json=ocr_data) print(response.text) ``` ````console $ convert -size 300x100 xc:white -pointsize 20 -fill black -gravity center -annotate +0+0 "hello world" hello_world.jpg $ ./11535.py hello_world.jpg | jq -r .response The content of the image is: ``` hello world ``` ```` [Server logs](https://github.com/ollama/ollama/blob/main/docs/troubleshooting.md#how-to-troubleshoot-issues) may aid in debugging.
Author
Owner

@spwang84 commented on GitHub (Jul 28, 2025):

@rick-github

Very appreciate your reply.

I found the problem.

This issue only happens when the model qwen2.5vl series is running on Mac via Ollama, the NVIDIA GPU can work smoothly.

If I switch to other models, such as Gemma3 or Mistral, they are both OK on Mac.

I'm using Ollama 0.9.6 and did not try other Ollama versions.

<!-- gh-comment-id:3125231881 --> @spwang84 commented on GitHub (Jul 28, 2025): @rick-github Very appreciate your reply. I found the problem. This issue only happens when the model qwen2.5vl series is running on **Mac** via Ollama, the NVIDIA GPU can work smoothly. If I switch to other models, such as Gemma3 or Mistral, they are both OK on Mac. I'm using Ollama 0.9.6 and did not try other Ollama versions.
Author
Owner

@rick-github commented on GitHub (Jul 28, 2025):

Server logs may aid in debugging.

<!-- gh-comment-id:3125237748 --> @rick-github commented on GitHub (Jul 28, 2025): [Server logs](https://github.com/ollama/ollama/blob/main/docs/troubleshooting.md#how-to-troubleshoot-issues) may aid in debugging.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#54125