DeepSeek-OCR-2 model card only documents two prompts.
Remove image/figure/describe modes carried over from v1.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Switch back to nightly vLLM, add addict + matplotlib deps
DeepSeek-OCR-2 is not in stable vLLM 0.15.1 yet (only nightly).
The nightly x86_64 builds are back (dev142). Also add addict and
matplotlib which the model's custom code requires.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use stable vLLM (>=0.15.1) instead of nightly for DeepSeek-OCR-2
DeepSeek-OCR-2 support is in stable vLLM 0.15.1 (released Feb 5, 2026).
The nightly index currently only has ARM wheels, breaking x86_64 Jobs.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add DeepSeek-OCR-2 vLLM script (rewrite from fixed v1 pattern)
Rewrites the broken draft (base64/llm.chat/resolution modes) to use the
proven v1 pattern: llm.generate() with PIL images + NGramPerReqLogitsProcessor.
Key v2 change: limit_mm_per_prompt={"image": 1} for the new architecture.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Rewrote inference core to match the official vLLM DeepSeek-OCR recipe:
- llm.generate() with PIL images instead of llm.chat() with base64
- Added NGramPerReqLogitsProcessor to prevent repetition loops
- Added enable_prefix_caching=False, mm_processor_cache_gb=0
- Added skip_special_tokens=False and ngram/window sampling params
- Removed resolution modes (only apply to transformers API, not vLLM)
- Removed deprecated HF_XET_HIGH_PERFORMANCE env var
- Bumped script_version to 2.0.0
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Update nanonets-ocr.py HF Jobs syntax and add smoke test notes
- Replace deprecated `hfjobs run` with current `hf jobs uv run` syntax
- Add OCR smoke test dataset design notes to CLAUDE.md
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace fragile git dep with stable transformers>=5.1.0 for GLM-OCR
GLM-OCR support landed in transformers v5.1.0. The previous unpinned git
dependency could break at any commit. Also updated docstring to note vLLM
nightly was re-verified on 2026-02-12.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
GLM-OCR SDK sets max_tokens=16384 but our max_model_len is 8192.
vLLM silently caps generation, making the high default misleading.
Align default to 8192 and document the SDK discrepancy.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove `[hf_transfer]` extra from PEP 723 dependencies (5 scripts)
- Replace `HF_HUB_ENABLE_HF_TRANSFER=1` with `HF_XET_HIGH_PERFORMANCE=1` (4 scripts)
- Hub now uses Xet storage backend; hf_transfer is deprecated
Ref: https://huggingface.co/docs/huggingface_hub/package_reference/environment_variables#hfxethighperformance
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Standardizing metadata tags across uv-scripts organization
for better discoverability of HF Jobs-compatible scripts.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Revert to using nightly wheels (required for LightOnOCR-2 support)
- Add known issue note about image processor loading failure
- Update CLAUDE.md with detailed status and test commands
- vLLM nightly broke between v0.15.0rc2.dev73 and dev81
The script was working before the nightly update. Error:
"OSError: Can't load image processor for lightonai/LightOnOCR-2-1B"
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Fix vLLM version constraint - v0.15.0 not on PyPI yet
The vLLM nightly had a regression causing image processor loading
to fail. Using stable release for reliability.
Removed:
- triton-kernels git dependency (not needed for stable)
- nightly wheel index
- prerelease allow setting
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The enable_prefix_caching=False parameter causes vLLM to fail with:
'OSError: Can't load image processor for lightonai/LightOnOCR-2-1B'
Keeping only the max_tokens change (6144 -> 4096) to fix repetition.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The mm_processor_kwargs parameter caused vLLM to fail with OSError
when loading the image processor. Keeping other fixes:
- max_tokens=4096 (recommended by model card)
- enable_prefix_caching=False (recommended by model card)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Fix LightOnOCR-2 repetition issues and configuration
- Change max_tokens default from 6144 to 4096 (as recommended by model card)
- Add enable_prefix_caching=False (recommended by model card)
- Add mm_processor_kwargs with cache_gb=0 to disable multimodal processor caching
- Replace deprecated hf_transfer extra with hf-xet package
These changes align with the official vLLM serve recommendations:
vllm serve lightonai/LightOnOCR-2-1B \
--limit-mm-per-prompt '{"image": 1}' \
--mm-processor-cache-gb 0 \
--no-enable-prefix-caching
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Pin pyarrow>=17.0.0,<18.0.0 to avoid PyExtensionType issue.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add LightOnOCR-2-1B support (next-gen OCR with RLVR)
davanstrien+1: Claude Sonnet 4.5 (1M context)HF Staff
0b3448a
Key improvements over v1:
- 7.5× faster: 42.8 vs 5.71 pages/sec on H100
- +7.1% accuracy: 83.2% vs 76.1% on OlmOCR-Bench
- RLVR training eliminates repetition loops
- Simpler: single model (no vocabulary variants)
Critical fix: Removed empty text prefix from message format
to match official LightOnOCR-2 implementation.
Co-Authored-By: Claude Sonnet 4.5 (1M context) <noreply@anthropic.com>
Fix: Remove pyarrow, use huggingface-hub without extras, pin datasets>=4.0.0