How to run DeepSeek-OCR on a cloud GPU

Rent a GPU on Deploy, then open a terminal in JupyterLab or over SSH. Clone the official deepseek-ai/DeepSeek-OCR repository, install the stack the README prints, download the weights that file names, and run the transformers call or the vLLM route it prints. Copy the text and the files the scripts write before you destroy the instance, because destroying the instance deletes its disk.

The model id in the transformers snippet, the vLLM snippet, and config.py is deepseek-ai/DeepSeek-OCR. A document OCR model whose README prints no GPU GB figure is How to run GOT-OCR 2.0 on a cloud GPU. A PDF pipeline whose README says at least 12 GB of GPU RAM is How to convert PDFs to text with olmOCR on a cloud GPU. A document OCR pipeline whose docs print no GPU GB figure is How to run PaddleOCR on a cloud GPU. A converter whose README states 8 GB+ VRAM on two standard rows is How to convert PDFs to Markdown with MinerU on a cloud GPU. A converter whose README prints no GPU GB figure is How to convert PDFs to Markdown with Marker on a cloud GPU. Docling’s README also prints no minimum GPU GB figure: How to convert PDFs and documents with Docling on a cloud GPU. A vision model whose 4.7 doc loads openbmb/MiniCPM-V-4.7-35B-A3B is How to run MiniCPM-V on a cloud GPU. A vision-language server whose README prints a transformers minimum table is How to serve Qwen2.5-VL with vLLM on a cloud GPU. A general vLLM install is How to serve an OpenAI-compatible API with vLLM on a cloud GPU. If the process runs out of memory: How to fix CUDA out of memory on a cloud GPU. If the process raises no kernel image on an RTX 5090: How to fix CUDA no kernel image on an RTX 5090. The download helper this site prints is How to download a Hugging Face model. The tunnel is How to use SSH port forwarding on a cloud GPU.

The repository LICENSE file is the MIT License. The copyright line is Copyright (c) 2025 DeepSeek. The model card front matter says license: mit. On 2026-11-14 the model API reported gated false. That license text is not a CloudGPU price.

The commands below are copied from the upstream files named in each step. They were not run on a CloudGPU instance for this page. Anything this page adds around them is marked.

What the docs say about memory

The README and the model card print no GPU GB figure for the weights. The pdf bullet names an A100-40G inside a throughput sentence. This page does not copy that throughput figure and does not treat the sentence as a vram_gb value. config.py sets MAX_CROPS = 6 with the comment “max:9; If your GPU memory is small, it is recommended to set it to 6.” It sets MIN_CROPS = 2. It sets MAX_CONCURRENCY = 100 with the comment “If you have limited GPU memory, lower the concurrency count.” It sets NUM_WORKERS = 64. None of those lines print a GB figure.

GET /v1/public/compute-capabilities does not list GPUs. It returns feature flags. The memory column is vram_gb from gpu-prices.json, updated_at 2026-11-14T03:12:17.736Z. GET /v1/public/gpu-catalog the same day (generated_at 2026-11-14T03:12:18.737Z) listed the same names and the same vram_gb values, plus Ascend 910B at 64, which is not in gpu-prices.json and is not listed here. The catalog response also includes an availability field. This page does not copy it. Every prices row has gpu_count 1. Every catalog row has min_gpu_count 1. Which listing you can start is on Deploy. Catalog A100 40G is 40. That is the catalog number only.

The catalog template list had no DeepSeek-OCR template. It did have ms-deepseek-r1-7b, ms-deepseek-r1-14b, and ms-deepseek-r1-32b, named as DeepSeek-R1 distill templates. This page does not treat those templates as DeepSeek-OCR.

Catalog name vram_gb
RTX 2080 8
RTX 3080 10
RTX 2080 Ti 11
RTX 3080 Ti 12
V100 16G 16
A30 24
RTX 3090 24
RTX 4090 24
RTX 4090D 24
RTX 4080 SUPER 32G 32
RTX 5090 32
RTX 5090D 32
V100 32G 32
A100 40G 40
A800 40G 40
A40 48
RTX 4090 48G 48
RTX 4090D 48G 48
RTX A6000 48
NVIDIA RTX PRO 5000 72G 72
RTX PRO 5000 72G 72
A100 80G 80
A800 80G 80
H800 80
RTX 6000D 83
H20 96G 96
RTX PRO 6000 96G 96
RTX PRO 6000 Max-Q 96
H20-3e 141G 141

Install

The README at commit 09eaf526153e7a01ed16c9dea8c96282aaea29c0 (committed 2026-01-27T03:45:14Z) says the environment is cuda11.8+torch2.6.0. The release line dated 2026/01/27 says “We present DeepSeek-OCR2” and links https://github.com/deepseek-ai/DeepSeek-OCR-2. This page follows deepseek-ai/DeepSeek-OCR. It does not clone that other repository.

The install block, copied. Step 1 says “Clone this repository and navigate to the DeepSeek-OCR folder.” The clone block does not print cd.

git clone https://github.com/deepseek-ai/DeepSeek-OCR.git

The block below is added on this page. Without it, pip install -r requirements.txt reads a requirements file in the starting directory, and the later cd DeepSeek-OCR-master/... lines do not resolve. This page did not run it.

# Added on this page. The README says to navigate into the folder and does not print cd.
cd DeepSeek-OCR
conda create -n deepseek-ocr python=3.12.9 -y
conda activate deepseek-ocr
pip install torch==2.6.0 torchvision==0.21.0 torchaudio==2.6.0 --index-url https://download.pytorch.org/whl/cu118
pip install vllm-0.8.5+cu118-cp38-abi3-manylinux1_x86_64.whl
pip install -r requirements.txt
pip install flash-attn==2.7.3 --no-build-isolation

The README says to download the vllm-0.8.5 wheel from the vLLM release tagged v0.8.5. That release, published 2025-04-28T21:13:09Z, includes an asset named vllm-0.8.5+cu118-cp38-abi3-manylinux1_x86_64.whl. requirements.txt pins transformers==4.46.3 and tokenizers==0.20.3. The note under the install says that if you want the vLLM and transformers code in the same environment, you do not need to worry about an error like vllm 0.8.5+cu118 requires transformers>=4.51.1. This page did not run the install and did not choose a transformers version past that note.

The torch line passes --index-url. The pip install page says packages are found on PyPI, or on the index given as --index-url. The next three commands are separate. They do not pass that index. The model card’s usage section repeats torch==2.6.0, transformers==4.46.3, and flash-attn==2.7.3, and it says the requirements were tested on python 3.12.9 + CUDA11.8.

Download the weights

The transformers snippet sets model_name = 'deepseek-ai/DeepSeek-OCR' and calls from_pretrained with trust_remote_code=True. The README does not print hf download. The block below is added on this page. How to download a Hugging Face model prints pip install -U "huggingface_hub" and hf download. This page did not download the repository.

# Added on this page. The README loads the id with from_pretrained.
pip install -U "huggingface_hub"
hf download deepseek-ai/DeepSeek-OCR

On 2026-11-14, GET https://huggingface.co/api/models/deepseek-ai/DeepSeek-OCR reported gated false, cardData.license mit, pipeline_tag image-text-to-text, lastModified 2025-11-04T02:36:12.000Z, and sha 9f30c71f441d010e5429c532364a86705536c53a.

Resolution modes and prompts

The README’s support-modes list, copied in the parts this page keeps. Each line in the file is marked with a check. Gundam’s line does not print a vision-token count.

  • Tiny: 512×512 (64 vision tokens)
  • Small: 640×640 (100 vision tokens)
  • Base: 1024×1024 (256 vision tokens)
  • Large: 1280×1280 (400 vision tokens)
  • Gundam: n×640×640 + 1×1024×1024

DeepSeek-OCR-hf/run_dpsk_ocr.py maps those names to arguments: Tiny is base_size = 512, image_size = 512, crop_mode = False. Small is 640 and 640, crop off. Base is 1024 and 1024, crop off. Large is 1280 and 1280, crop off. Gundam is base_size = 1024, image_size = 640, crop_mode = True. The call the README prints uses the Gundam arguments, save_results = True, and test_compress = True.

The prompt examples are in the next code block, copied from the README. They contain tokens in angle brackets. This page keeps them inside the fence so the renderer does not drop them as HTML tags.

# document: <image>\n<|grounding|>Convert the document to markdown.
# other image: <image>\n<|grounding|>OCR this image.
# without layouts: <image>\nFree OCR.
# figures in document: <image>\nParse the figure.
# general: <image>\nDescribe this image in detail.
# rec: <image>\nLocate <|ref|>xxxx<|/ref|> in the image.
# '先天下之忧而忧'

config.py sets PROMPT to the document line, and comments the without-layouts line. BASE_SIZE = 1024, IMAGE_SIZE = 640, CROP_MODE = True.

Transformers and vLLM

The transformers path, copied in the parts this page keeps. It sets CUDA_VISIBLE_DEVICES to 0, loads with _attn_implementation='flash_attention_2', then model.eval().cuda().to(torch.bfloat16). The active prompt in that block is the document prompt. output_path = 'your/output/dir'. The README also says you can cd DeepSeek-OCR-master/DeepSeek-OCR-hf and run python run_dpsk_ocr.py. That cd is relative to the clone, after the added cd DeepSeek-OCR above. This page did not read the filenames infer() writes. It did not run the call.

The README’s own vLLM section says to edit INPUT_PATH, OUTPUT_PATH, and the other settings in DeepSeek-OCR-master/DeepSeek-OCR-vllm/config.py, then change into that directory. The cd is relative to the clone:

cd DeepSeek-OCR-master/DeepSeek-OCR-vllm
python run_dpsk_ocr_image.py
python run_dpsk_ocr_pdf.py

The image script writes OUTPUT_PATH/result_ori.mmd, OUTPUT_PATH/result.mmd, and OUTPUT_PATH/result_with_boxes.jpg when save_results is set and the prompt contains the image token. It writes OUTPUT_PATH/geo.jpg only inside a branch that checks for line_type in the output. The pdf script writes files whose names replace the input pdf name with _det.mmd, .mmd, and _layouts.pdf, plus OUTPUT_PATH/images/. This page did not run those scripts.

The README also prints an upstream vLLM snippet dated 2025/10/23. It says that until the v0.11.1 release you install vLLM from the nightly index:

uv venv
source .venv/bin/activate
uv pip install -U vllm --pre --extra-index-url https://wheels.vllm.ai/nightly

The snippet then constructs LLM(model="deepseek-ai/DeepSeek-OCR", enable_prefix_caching=False, mm_processor_cache_gb=0) and a SamplingParams with temperature=0.0, max_tokens=8192, ngram_size=30, window_size=90, and whitelist_token_ids {128821, 128822}. The comment on those ids names two markup tags. This page does not repeat that comment outside the upstream file. skip_special_tokens=False. The prompt in that snippet is the without-layouts prompt.

The live recipe page https://docs.vllm.ai/projects/recipes/en/latest/DeepSeek/DeepSeek-OCR.html returned HTTP 200 on 2026-11-14. Its banner says the markdown guides are a historical reference and names recipes.vllm.ai. This page quotes the markdown that URL still served. It did not copy a command from recipes.vllm.ai. The install block on that markdown page is not the nightly line. It is:

uv venv
source .venv/bin/activate
uv pip install -U vllm --torch-backend auto

The serve command on that page, copied:

vllm serve deepseek-ai/DeepSeek-OCR --logits_processors vllm.model_executor.models.deepseek_ocr:NGramPerReqLogitsProcessor --no-enable-prefix-caching --mm-processor-cache-gb 0

That command does not pass --port. The client on the same page sets base_url to http://localhost:8000/v1, api_key to EMPTY, and model to deepseek-ai/DeepSeek-OCR. The message text on that client is Free OCR. The client also prints elapsed seconds. This page does not copy that print. How to use SSH port forwarding on a cloud GPU is how a program on your computer reaches port 8000. This page does not add an ssh command.

PyPI vllm info.version on 2026-11-14 was 0.33.0. That string is not the README’s v0.8.5 wheel and it is not the README’s “until v0.11.1” clause. This page does not treat those three as the same install. The recipe page also prints an AMD section. This page does not copy it. Those cards are not in the catalog table above.

When it fails

CUDA out of memory. The README and the model card print no GPU GB figure for the weights. config.py says to lower MAX_CROPS and MAX_CONCURRENCY when GPU memory is small, and it prints no GB figure. If the process raises CUDA out of memory, use how to fix CUDA out of memory on a cloud GPU.

“CUDA error: no kernel image is available for execution on the device” on an RTX 5090. The install line pins torch==2.6.0 on the cu118 index. The README does not name compute capability 12.0. The RTX 5090 guide says that card is compute capability 12.0 (sm_120) and that PyTorch 2.7 and later, on a build for CUDA 12.8 or newer, is the line that announced support. This page did not install a torch wheel and did not re-test this model on an RTX 5090. Catalog RTX 5090 and RTX 5090D are 32. That is the catalog number only.

transformers and the v0.8.5 wheel. The README prints both transformers==4.46.3 in requirements.txt and the note that vllm 0.8.5+cu118 requires transformers>=4.51.1. This page does not pick a version past that note.

What to copy off, then destroy

The transformers call passes output_path and save_results=True. The vLLM image script writes result_ori.mmd, result.mmd, and result_with_boxes.jpg under OUTPUT_PATH in the branch described above. The pdf script writes the .mmd files and _layouts.pdf next to OUTPUT_PATH. Copy those files, and the hf download directory if you passed --local-dir, before you destroy the instance. Save your work before you destroy a cloud GPU is the checklist. The terms say data on local instance storage is permanently deleted when the instance is destroyed.

The pricing page FAQ states the billing rule in these words:

Per-minute options have a 1-minute minimum; unused prepaid minutes are refunded when you destroy the instance. Some configurations use whole-hour billing with a 1-hour minimum; unused time within a charged hour is not refunded on voluntary stop. The billing period, minimum charge and initial prepayment are shown before confirmation. No subscription.

Prices are not copied here.

Frequently asked questions

What memory figure do the README and the model card print?

The README and the model card print no GPU GB figure for the weights. The pdf bullet names an A100-40G inside a throughput sentence. This page does not copy that throughput figure and does not treat the sentence as vram_gb. config.py says to lower MAX_CROPS and MAX_CONCURRENCY when GPU memory is small and prints no GB figure. This page does not mark a catalog row as enough. Which listing you can start is on https://cloudgpu.app/deploy.

Which model id and install lines does the README print?

The model id in the transformers snippet, the vLLM snippet, and config.py is deepseek-ai/DeepSeek-OCR. The environment line is cuda11.8+torch2.6.0. The conda line is python=3.12.9. The torch line pins torch==2.6.0 torchvision==0.21.0 torchaudio==2.6.0 on the cu118 index. The wheel name is vllm-0.8.5+cu118-cp38-abi3-manylinux1_x86_64.whl. requirements.txt pins transformers==4.46.3. The note says vllm 0.8.5+cu118 requires transformers>=4.51.1. The numbered install step says to navigate to the DeepSeek-OCR folder. The clone block does not print cd. This page adds cd DeepSeek-OCR before the requirements install. This page did not run the install. Model API cardData.license was mit and gated was false on 2026-11-14.

Which resolution modes and which serving route do the docs print?

The README lists Tiny 512×512 (64 vision tokens), Small 640×640 (100 vision tokens), Base 1024×1024 (256 vision tokens), Large 1280×1280 (400 vision tokens), and Gundam as n×640×640 plus 1×1024×1024. The transformers call uses base_size 1024, image_size 640, and crop_mode True, with save_results True. The live vLLM recipe serve command is vllm serve deepseek-ai/DeepSeek-OCR with --no-enable-prefix-caching and --mm-processor-cache-gb 0. That command does not pass --port. The client sets base_url to http://localhost:8000/v1. The README still prints a nightly vLLM install line. This page did not start the server.

What license does the file print?

The DeepSeek-OCR LICENSE file is the MIT License. The copyright line is Copyright (c) 2025 DeepSeek. The model card front matter says license mit. That license text is not a CloudGPU price.

Sources (read 2026-11-14, Asia/Shanghai)

  • deepseek-ai/DeepSeek-OCR README (model id deepseek-ai/DeepSeek-OCR, cuda11.8+torch2.6.0, conda python=3.12.9, cu118 torch line, vllm 0.8.5 wheel, flash-attn==2.7.3, resolution modes, prompt examples, transformers infer arguments, nightly vLLM line, DeepSeek-OCR2 release line): commit 09eaf526153e7a01ed16c9dea8c96282aaea29c0, committed 2026-01-27T03:45:14Z. pushed_at 2026-01-27T03:45:14Z. LICENSE: MIT, Copyright © 2025 DeepSeek. GitHub license field MIT
  • requirements.txt (transformers==4.46.3, tokenizers==0.20.3): same commit
  • DeepSeek-OCR-master/DeepSeek-OCR-hf/run_dpsk_ocr.py (mode arguments, Gundam call): same commit
  • DeepSeek-OCR-master/DeepSeek-OCR-vllm/config.py (MODEL_PATH, MAX_CROPS 6, MIN_CROPS 2, MAX_CONCURRENCY 100, NUM_WORKERS 64, PROMPT): same commit
  • DeepSeek-OCR-master/DeepSeek-OCR-vllm/run_dpsk_ocr_image.py (result_ori.mmd, result.mmd, result_with_boxes.jpg, geo.jpg): same commit
  • DeepSeek-OCR-master/DeepSeek-OCR-vllm/run_dpsk_ocr_pdf.py (_det.mmd, .mmd, _layouts.pdf, images/): same commit
  • vLLM release v0.8.5 asset vllm-0.8.5+cu118-cp38-abi3-manylinux1_x86_64.whl, published 2025-04-28T21:13:09Z
  • Hugging Face model card and model API deepseek-ai/DeepSeek-OCR: license: mit, gated false, pipeline_tag image-text-to-text, library_name transformers, lastModified 2025-11-04T02:36:12.000Z, sha 9f30c71f441d010e5429c532364a86705536c53a. The card repeats the transformers and nightly vLLM blocks and prints no GPU GB figure
  • vLLM recipe page https://docs.vllm.ai/projects/recipes/en/latest/DeepSeek/DeepSeek-OCR.html (HTTP 200 on 2026-11-14; banner calls the markdown a historical reference; install uv pip install -U vllm --torch-backend auto; vllm serve command; client http://localhost:8000/v1). This page does not copy the AMD section or the client’s elapsed-seconds print. PyPI vllm info.version the same day was 0.33.0
  • pip install, finding packages (--index-url replaces the default index): https://pip.pypa.io/en/stable/cli/pip_install/#finding-packages, read 2026-11-14
  • Public GPU memory: https://cloudgpu.app/gpu-prices.json (updated_at 2026-11-14T03:12:17.736Z) and https://cloudgpu.app/v1/public/gpu-catalog (generated_at 2026-11-14T03:12:18.737Z). GET /v1/public/compute-capabilities returned feature flags and no GPU list. The catalog templates ms-deepseek-r1-7b, ms-deepseek-r1-14b, and ms-deepseek-r1-32b are not treated as DeepSeek-OCR

Cards you can start are on the Deploy page. Prices are on https://cloudgpu.app/pricing and are not repeated here.

Last updated: 2026-11-14 (Asia/Shanghai).