[GH-ISSUE #13252] How can I use deepseek-ocr:3b from the API? #70819

Closed
opened 2026-05-04 23:06:08 -05:00 by GiteaMirror · 5 comments
Owner

Originally created by @TkachenkoAV on GitHub (Nov 26, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/13252

What is the issue?

I tried different methods, but they don't work.

Relevant log output


OS

No response

GPU

No response

CPU

No response

Ollama version

No response

Originally created by @TkachenkoAV on GitHub (Nov 26, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/13252 ### What is the issue? I tried different methods, but they don't work. ### Relevant log output ```shell ``` ### OS _No response_ ### GPU _No response_ ### CPU _No response_ ### Ollama version _No response_
GiteaMirror added the bug label 2026-05-04 23:06:08 -05:00
Author
Owner

@rick-github commented on GitHub (Nov 26, 2025):

Python:

#!/usr/bin/env python3

import ollama
import sys

model = 'deepseek-ocr:3b-bf16'
image = sys.argv[1] if len(sys.argv) > 1 else "puppy.jpg"

response = ollama.chat(
    model=model,
    messages=[{
        'role': 'user',
        'content': '\n<|grounding|>Describe this image.',
        'images': [image]
    }],
    stream=True
)

for r in response:
  print(r['message']['content'], end='')
print("")
$ ./docr-image-grounding.py puppy.jpg
<|ref|>White Maltese puppy<|/ref|><|det|>[[113, 184, 800, 759]]<|/det|> sitting on <|ref|>a stone<|/ref|><|det|>[[0, 434, 997, 996]]<|/det|>

Curl:

$ echo '{
    "model":"deepseek-ocr:3b-bf16",
    "messages":[{"role":"user","content":"\n<|grounding|>Describe this image.",
    "images":["'"$(base64 -w0 ./puppy.png)"'"]}],
    "stream":false
}' | curl -s localhost:11434/api/chat -d @- | jq -r .message.content
<|ref|>White Maltese puppy<|/ref|><|det|>[[113, 184, 799, 759]]<|/det|> sitting on <|ref|>a stone<|/ref|><|det|>[[0, 434, 997, 996]]<|/det|>
<!-- gh-comment-id:3581517443 --> @rick-github commented on GitHub (Nov 26, 2025): Python: ```python #!/usr/bin/env python3 import ollama import sys model = 'deepseek-ocr:3b-bf16' image = sys.argv[1] if len(sys.argv) > 1 else "puppy.jpg" response = ollama.chat( model=model, messages=[{ 'role': 'user', 'content': '\n<|grounding|>Describe this image.', 'images': [image] }], stream=True ) for r in response: print(r['message']['content'], end='') print("") ``` ```console $ ./docr-image-grounding.py puppy.jpg <|ref|>White Maltese puppy<|/ref|><|det|>[[113, 184, 800, 759]]<|/det|> sitting on <|ref|>a stone<|/ref|><|det|>[[0, 434, 997, 996]]<|/det|> ``` Curl: ```console $ echo '{ "model":"deepseek-ocr:3b-bf16", "messages":[{"role":"user","content":"\n<|grounding|>Describe this image.", "images":["'"$(base64 -w0 ./puppy.png)"'"]}], "stream":false }' | curl -s localhost:11434/api/chat -d @- | jq -r .message.content <|ref|>White Maltese puppy<|/ref|><|det|>[[113, 184, 799, 759]]<|/det|> sitting on <|ref|>a stone<|/ref|><|det|>[[0, 434, 997, 996]]<|/det|> ```
Author
Owner

@TkachenkoAV commented on GitHub (Nov 29, 2025):

The model is completely unstable. It periodically returns complete nonsense on the same file...

<!-- gh-comment-id:3591582465 --> @TkachenkoAV commented on GitHub (Nov 29, 2025): The model is completely unstable. It periodically returns complete nonsense on the same file...
Author
Owner

@rick-github commented on GitHub (Nov 29, 2025):

The model is very sensitive to variations of input. Recommended prompts can be found here.

<!-- gh-comment-id:3591585637 --> @rick-github commented on GitHub (Nov 29, 2025): The model is very sensitive to variations of input. Recommended prompts can be found [here](https://github.com/deepseek-ai/DeepSeek-OCR?tab=readme-ov-file#prompts-examples).
Author
Owner

@iJonyDev commented on GitHub (Dec 2, 2025):

@TkachenkoAV I saw the request api just works when we call to chat endpoint. If we call to /generate endpoint does not work. Simple app to consume the model:
https://github.com/MAMISHO/deepseek-ocr-app

<!-- gh-comment-id:3601155193 --> @iJonyDev commented on GitHub (Dec 2, 2025): @TkachenkoAV I saw the request api just works when we call to chat endpoint. If we call to /generate endpoint does not work. Simple app to consume the model: https://github.com/MAMISHO/deepseek-ocr-app
Author
Owner

@rick-github commented on GitHub (Dec 2, 2025):

The generate endpoint does work.

$ echo '{
    "model":"deepseek-ocr:3b-bf16",
    "prompt":"\n<|grounding|>Describe this image.",
    "images":["'"$(base64 -w0 ./puppy.png)"'"],
    "stream":false
}' | curl -s localhost:11434/api/generate -d @- | jq -r .response
<|ref|>White Maltese puppy<|/ref|><|det|>[[113, 184, 799, 759]]<|/det|> sitting on <|ref|>a stone<|/ref|><|det|>[[0, 434, 997, 996]]<|/det|>
<!-- gh-comment-id:3601231505 --> @rick-github commented on GitHub (Dec 2, 2025): The generate endpoint does work. ```console $ echo '{ "model":"deepseek-ocr:3b-bf16", "prompt":"\n<|grounding|>Describe this image.", "images":["'"$(base64 -w0 ./puppy.png)"'"], "stream":false }' | curl -s localhost:11434/api/generate -d @- | jq -r .response <|ref|>White Maltese puppy<|/ref|><|det|>[[113, 184, 799, 759]]<|/det|> sitting on <|ref|>a stone<|/ref|><|det|>[[0, 434, 997, 996]]<|/det|> ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#70819