ollama - 💡(How to fix) Fix Ollama API failing while CLI works, without any difference [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
ollama/ollama#15473Fetched 2026-04-11 06:12:43
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
0
Participants
Timeline (top)
labeled ×1

Code Example

{
    "model": "deepseek-ocr:latest",
    "prompt": "Read this receipt image and extract all the texts in MARKDOWN.",
    "stream": false,
    "images": [
        "iVBORw0....ElFTkSuQmCC"
    ]
}

---

{
    "model": "deepseek-ocr:latest",
    "created_at": "2026-04-10T10:08:43.783512Z",
    "response": ")。\n\n)。\n\n)。\n\n)。\n\n)。\n\n)。\n\n)。\n\n)。\n\n)。\n\n)。\n\n)。\n\n)。\n\n)。\n\n)。\n\n)。\n\n)。\n\n)。\n\n)。\n\n)。\n\n)。\n\n)。\n\n)。\n\n)。\n\n)。\n\n)。\n\n)。\n\n)。\n\n)。\n\n)。\n\n)。\n\n)。\n\n",
    "done": false
}
RAW_BUFFERClick to expand / collapse

Hi, I'm experiencing a strage behavior with API and CLI.

I'm trying to use deepseek-ocr to extract text from an image. -CLI: ollama run deepseek-ocr "/Users/sasoftware/Downloads/image.png\nExtract text in markdown." works fine and extract text without any problem.

-API: I'm calling localhost:11434/api/generate with this body:

{
    "model": "deepseek-ocr:latest",
    "prompt": "Read this receipt image and extract all the texts in MARKDOWN.",
    "stream": false,
    "images": [
        "iVBORw0....ElFTkSuQmCC"
    ]
}

but I'm receiving this response:

{
    "model": "deepseek-ocr:latest",
    "created_at": "2026-04-10T10:08:43.783512Z",
    "response": ")。\n\n)。\n\n)。\n\n)。\n\n)。\n\n)。\n\n)。\n\n)。\n\n)。\n\n)。\n\n)。\n\n)。\n\n)。\n\n)。\n\n)。\n\n)。\n\n)。\n\n)。\n\n)。\n\n)。\n\n)。\n\n)。\n\n)。\n\n)。\n\n)。\n\n)。\n\n)。\n\n)。\n\n)。\n\n)。\n\n)。\n\n",
    "done": false
}

How can it be possible? Do I have to specify other params inside the request body? I've tried with many more images but only this one has this type of problem. Any suggestion would be really useful.

Image link on gDrive and you can extract base64 from here

Mac mini M4 Pro 24GB

extent analysis

TL;DR

The issue might be related to the image encoding or the API request body, and verifying the image data and the request parameters could help resolve the problem.

Guidance

  • Check the image data: Verify that the base64-encoded image data is correct and complete, as the issue only occurs with this specific image.
  • Compare request parameters: Compare the parameters used in the CLI command and the API request to ensure that they are equivalent, especially the model and prompt.
  • Test with a different image: Try using a different image to see if the issue is specific to this image or if it's a more general problem.
  • Verify API documentation: Check the API documentation to ensure that the request body parameters are correctly formatted and that no other parameters are required.

Example

No code snippet is provided as it's not clearly supported by the issue.

Notes

The issue might be specific to the image or the API implementation, and further investigation is needed to determine the root cause.

Recommendation

Apply workaround: Try to use a different image or verify the image data to see if the issue persists, as this might help identify the root cause of the problem.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

ollama - 💡(How to fix) Fix Ollama API failing while CLI works, without any difference [1 participants]