TheaterFire

Deepseek OCR on Apple Silicon - anyone ?

Posted by olddoglearnsnewtrick@reddit | LocalLLaMA | View on Reddit | 18 comments

I tried to get it running on my M4 machine but am chasing error after error in an endless sequence. Anyone succeeding and sharing the recipe? Thank you

Reply to Post

18 Comments

Traditional_Chart970@reddit

I have it working on my M3 Macbook Air. You can check it here: [https://github.com/erdemozkan/mini-pengin](https://github.com/erdemozkan/mini-pengin) You can ask me whatever you need..
View on Reddit #73902873

Different-Effect-724@reddit

Model and instructions on DeepSeek-OCR GGUF on CPU or GPU: [https://huggingface.co/NexaAI/DeepSeek-OCR-GGUF](https://huggingface.co/NexaAI/DeepSeek-OCR-GGUF)
View on Reddit #71035418

olddoglearnsnewtrick@reddit (OP)

I feel soooooo dumb :) As per the instructions I've installed the Nexa SDK and from the command line launch .nexa infer NexaAI/DeepSeek-OCR-GGUF' which opens its prompt and if I feed it an image filename with the path it decodes well. But how in heaven do I launch this over the 100 approx files I have in the same directory ??? Thanks a lot.
View on Reddit #71087158

olddoglearnsnewtrick@reddit (OP)

Figured it out :) import json, pathlib, requests DIR = pathlib.Path("/Volumes/2TBWDB/code/NexaAI\_DeepSeek-OCR-GGUF\_Q4\_0") MODEL = "NexaAI/DeepSeek-OCR-GGUF" URL = "http://127.0.0.1:18181/v1/chat/completions" for img in DIR.glob("\*.png"): payload = { "model": MODEL, "messages": \[{ "role": "user", "content": \[ {"type":"text", "text":"Extract all text from this image. Return plain text only."}, {"type":"image\_url", "image\_url": {"url": str(img.resolve())}} \] }\], "stream": False } r = requests.post(URL, json=payload, timeout=300) r.raise\_for\_status() text = r.json()\["choices"\]\[0\]\["message"\]\["content"\] img.with\_suffix(".txt").write\_text(text, encoding="utf-8") print(f"Wrote {img.with\_suffix('.txt')}")
View on Reddit #71088061

olddoglearnsnewtrick@reddit (OP)

Thanks a lot will try
View on Reddit #71053980

Excellent_Produce146@reddit

He is still struggling. [https://x.com/Prince\_Canuma/status/1980755467119804721](https://x.com/Prince_Canuma/status/1980755467119804721) Due to non standard inference code and lack of examples as it seems.
View on Reddit #69439607

giovannyvelezalt@reddit

Finally he merged it 🎉🎉🎉
View on Reddit #69822574

olddoglearnsnewtrick@reddit (OP)

Sorry to hear. I am no expert but gave up after a day of trying ....
View on Reddit #69452479

Natural-Marsupial903@reddit

2 months ago I was in the same situation with dots.ocr. So I made this [https://github.com/jason-ni/app.dots.ocr.runner](https://github.com/jason-ni/app.dots.ocr.runner) It's just a lot slower than fresh new Deepseek OCR and PaddleOCR-VL. But I can promise it can run in any Mac with Apple Silicon. The good news is MLX-VLM community is working on Deepseek OCR and llama.cpp community is working on PaddleOCR-VL. And I'm working on supporting PDF in my dots.ocr.runner. Our MacOS will be more powerful soon.
View on Reddit #69683031

olddoglearnsnewtrick@reddit (OP)

Interesting. TY
View on Reddit #69735580

Natural-Marsupial903@reddit

good news: [https://www.reddit.com/r/LocalLLaMA/comments/1ofu15a/i\_rebuilt\_deepseeks\_ocr\_model\_in\_rust\_so\_anyone/](https://www.reddit.com/r/LocalLLaMA/comments/1ofu15a/i_rebuilt_deepseeks_ocr_model_in_rust_so_anyone/)
View on Reddit #69738046

Natural-Marsupial903@reddit

2 months ago I was in the same situation with dots.ocr. So I made this [https://github.com/jason-ni/app.dots.ocr.runner](https://github.com/jason-ni/app.dots.ocr.runner) It's just a lot slower than fresh new Deepseek OCR and PaddleOCR-VL. But I can promise it can run in any Mac with Apple Silicon. The good news is MLX-VLM community is working on Deepseek OCR and llama.cpp community is working on PaddleOCR-VL. And I'm working on supporting PDF in my dots.ocr.runner. Our MacOS will be more powerful soon.
View on Reddit #69683013

1911z@reddit

Yes, working on my M1 pro 32GB 1) clone this branch [https://huggingface.co/deepseek-ai/DeepSeek-OCR/discussions/6](https://huggingface.co/deepseek-ai/DeepSeek-OCR/discussions/6) 2) install deps 3) add a test.png to the project folder 4) add/run this snippet [https://github.com/deepseek-ai/DeepSeek-OCR/issues/10#issuecomment-3435975352](https://github.com/deepseek-ai/DeepSeek-OCR/issues/10#issuecomment-3435975352)
View on Reddit #69517570

olddoglearnsnewtrick@reddit (OP)

do you happen to have a working pyproject.toml with the right prereqs? I am tied in a dependency conflict forever :( Thanks a lot this is my (non working) file so far: [build-system] requires = ["setuptools", "wheel"] build-backend = "setuptools.build_meta" [project] name = "deepseek-ocr" version = "0.1.0" description = "DeepSeek OCR project" requires-python = ">=3.12" dependencies = [ "torch==2.6.0", "transformers==4.46.3", "tokenizers==0.20.3", "einops", "addict", "easydict", "xformers", ]
View on Reddit #69520213

1911z@reddit

I do not, I am sorry. The following is what I did (python 3.9) on a new machine pip install torch==2.6.0 pip install transformers==4.46.3 pip install tokenizers==0.20.3 pip install einops==0.8.1 pip install addict==2.4.0 pip install easydict==1.13 xformers wasn't needed
View on Reddit #69520565

Excellent_Produce146@reddit

Seems the "MLX king" is still working on it: [https://x.com/Prince\_Canuma/status/1980170857411408238](https://x.com/Prince_Canuma/status/1980170857411408238) Seems that he could not download it yesterday due to the AWS fuu. [https://x.com/Prince\_Canuma/status/1980260077454893479](https://x.com/Prince_Canuma/status/1980260077454893479)
View on Reddit #69353084

christianweyer@reddit

You mean the prince 😁
View on Reddit #69354101

olddoglearnsnewtrick@reddit (OP)

Thanks, Great news.
View on Reddit #69353693