2026-01-19 21:05:51 +00:00
|
|
|
# Nanonets-OCR2-3B Vision Language Model
|
|
|
|
|
# Based on Qwen2.5-VL-3B, fine-tuned for document OCR (Oct 2025 release)
|
|
|
|
|
# Improvements over OCR-s: better semantic tagging, LaTeX equations, flowcharts
|
|
|
|
|
# ~12-16GB VRAM with 30K context, outputs structured markdown with semantic tags
|
2026-01-18 15:54:16 +00:00
|
|
|
#
|
2026-01-19 21:05:51 +00:00
|
|
|
# Build: docker build -f Dockerfile_nanonets_vllm_gpu_VRAM10GB -t nanonets-ocr .
|
2026-01-18 15:54:16 +00:00
|
|
|
# Run: docker run --gpus all -p 8000:8000 -v ht-huggingface-cache:/root/.cache/huggingface nanonets-ocr
|
|
|
|
|
|
|
|
|
|
FROM vllm/vllm-openai:latest
|
|
|
|
|
|
|
|
|
|
LABEL maintainer="Task Venture Capital GmbH <hello@task.vc>"
|
2026-01-19 21:05:51 +00:00
|
|
|
LABEL description="Nanonets-OCR2-3B - Document OCR optimized Vision Language Model"
|
2026-01-18 15:54:16 +00:00
|
|
|
LABEL org.opencontainers.image.source="https://code.foss.global/host.today/ht-docker-ai"
|
|
|
|
|
|
|
|
|
|
# Environment configuration
|
2026-01-19 21:05:51 +00:00
|
|
|
ENV MODEL_NAME="nanonets/Nanonets-OCR2-3B"
|
2026-01-18 15:54:16 +00:00
|
|
|
ENV HOST="0.0.0.0"
|
|
|
|
|
ENV PORT="8000"
|
2026-01-19 21:05:51 +00:00
|
|
|
ENV MAX_MODEL_LEN="30000"
|
2026-01-18 15:54:16 +00:00
|
|
|
ENV GPU_MEMORY_UTILIZATION="0.9"
|
|
|
|
|
|
|
|
|
|
# Expose OpenAI-compatible API port
|
|
|
|
|
EXPOSE 8000
|
|
|
|
|
|
|
|
|
|
# Health check - vLLM exposes /health endpoint
|
|
|
|
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=120s --retries=5 \
|
|
|
|
|
CMD curl -f http://localhost:8000/health || exit 1
|
|
|
|
|
|
2026-01-19 21:05:51 +00:00
|
|
|
# Start vLLM server with Nanonets-OCR2-3B model
|
|
|
|
|
CMD ["--model", "nanonets/Nanonets-OCR2-3B", \
|
2026-01-18 15:54:16 +00:00
|
|
|
"--trust-remote-code", \
|
2026-01-19 21:05:51 +00:00
|
|
|
"--max-model-len", "30000", \
|
2026-01-18 15:54:16 +00:00
|
|
|
"--host", "0.0.0.0", \
|
|
|
|
|
"--port", "8000"]
|