Files
ht-docker-ai/readme.md

384 lines
12 KiB
Markdown
Raw Permalink Normal View History

# @host.today/ht-docker-ai 🚀
2026-01-16 01:51:57 +00:00
Production-ready Docker images for state-of-the-art AI Vision-Language Models. Run powerful multimodal AI locally with GPU acceleration—**no cloud API keys required**.
2026-01-19 11:51:23 +00:00
> 🔥 **Three VLMs, one registry.** From high-performance document OCR to GPT-4o-level vision understanding—pick the right tool for your task.
2026-01-16 01:51:57 +00:00
## Issue Reporting and Security
2026-01-16 01:51:57 +00:00
For reporting bugs, issues, or security vulnerabilities, please visit [community.foss.global/](https://community.foss.global/). This is the central community hub for all issue reporting. Developers who sign and comply with our contribution agreement and go through identification can also get a [code.foss.global/](https://code.foss.global/) account to submit Pull Requests directly.
2026-01-16 01:51:57 +00:00
2026-01-19 11:51:23 +00:00
---
## 🎯 What's Included
2026-01-16 01:51:57 +00:00
| Model | Parameters | Best For | API | Port | VRAM |
|-------|-----------|----------|-----|------|------|
| **MiniCPM-V 4.5** | 8B | General vision understanding, multi-image analysis | Ollama-compatible | 11434 | ~9GB |
| **Nanonets-OCR2-3B** | ~3B | Document OCR with semantic markdown, LaTeX, flowcharts | OpenAI-compatible | 8000 | ~12-16GB |
| **Qwen3-VL-30B** | 30B (A3B) | Advanced visual agents, code generation from images | Ollama-compatible | 11434 | ~20GB |
2026-01-19 11:51:23 +00:00
---
2026-01-16 01:51:57 +00:00
2026-01-19 11:51:23 +00:00
## 📦 Quick Reference: All Available Images
2026-01-16 01:51:57 +00:00
```
code.foss.global/host.today/ht-docker-ai:<tag>
```
| Tag | Model | Runtime | Port | VRAM |
|-----|-------|---------|------|------|
| `minicpm45v` / `latest` | MiniCPM-V 4.5 | Ollama | 11434 | ~9GB |
| `nanonets-ocr` | Nanonets-OCR2-3B | vLLM | 8000 | ~12-16GB |
| `qwen3vl` | Qwen3-VL-30B-A3B | Ollama | 11434 | ~20GB |
---
## 🖼️ MiniCPM-V 4.5
2026-01-19 11:51:23 +00:00
A GPT-4o level multimodal LLM from OpenBMB—handles image understanding, OCR, multi-image analysis, and visual reasoning across **30+ languages**.
2026-01-16 01:51:57 +00:00
### ✨ Key Features
- 🌍 **Multilingual:** 30+ languages supported
- 🖼️ **Multi-image:** Analyze multiple images in one request
- 📊 **Versatile:** Charts, documents, photos, diagrams
-**Efficient:** Runs on consumer GPUs (9GB VRAM)
### Quick Start
2026-01-16 01:51:57 +00:00
```bash
docker run -d \
--name minicpm \
--gpus all \
-p 11434:11434 \
-v ollama-data:/root/.ollama \
code.foss.global/host.today/ht-docker-ai:minicpm45v
```
> 💡 **Pro tip:** Mount the volume to persist downloaded models (~5GB). Without it, models re-download on every container start.
2026-01-16 01:51:57 +00:00
### API Examples
2026-01-16 01:51:57 +00:00
**List models:**
2026-01-16 01:51:57 +00:00
```bash
curl http://localhost:11434/api/tags
```
**Analyze an image:**
2026-01-16 01:51:57 +00:00
```bash
curl http://localhost:11434/api/generate -d '{
"model": "minicpm-v",
"prompt": "What do you see in this image?",
"images": ["<base64-encoded-image>"]
}'
```
**Chat with vision:**
2026-01-16 01:51:57 +00:00
```bash
curl http://localhost:11434/api/chat -d '{
"model": "minicpm-v",
"messages": [{
"role": "user",
"content": "Describe this image in detail",
"images": ["<base64-encoded-image>"]
}]
2026-01-16 01:51:57 +00:00
}'
```
### Hardware Requirements
2026-01-16 01:51:57 +00:00
| Mode | VRAM Required |
|------|---------------|
| int4 quantized | ~9GB |
| Full precision (bf16) | ~18GB |
---
## 🔍 Nanonets-OCR2-3B
2026-01-19 11:51:23 +00:00
The **latest Nanonets document OCR model** (October 2025 release)—based on Qwen2.5-VL-3B, fine-tuned specifically for document extraction with significant improvements over the original OCR-s.
2026-01-19 11:51:23 +00:00
### ✨ Key Features
2026-01-19 11:51:23 +00:00
- 📝 **Semantic output:** Tables → HTML, equations → LaTeX, flowcharts → structured markup
2026-01-19 11:51:23 +00:00
- 🌍 **Multilingual:** Inherits Qwen's broad language support
- 📄 **30K context:** Handle large, multi-page documents
2026-01-19 11:51:23 +00:00
- 🔌 **OpenAI-compatible:** Drop-in replacement for existing pipelines
- 🎯 **Improved accuracy:** Better semantic tagging and LaTeX equation extraction vs. OCR-s
2026-01-19 11:51:23 +00:00
### Quick Start
```bash
docker run -d \
--name nanonets \
--gpus all \
-p 8000:8000 \
-v hf-cache:/root/.cache/huggingface \
code.foss.global/host.today/ht-docker-ai:nanonets-ocr
```
### API Usage
```bash
curl http://localhost:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "nanonets/Nanonets-OCR2-3B",
2026-01-19 11:51:23 +00:00
"messages": [{
"role": "user",
"content": [
{"type": "image_url", "image_url": {"url": "data:image/png;base64,<base64>"}},
{"type": "text", "text": "Extract the text from the above document as if you were reading it naturally. Return the tables in html format. Return the equations in LaTeX representation."}
]
}],
"temperature": 0.0,
"max_tokens": 4096
}'
```
### Output Format
Nanonets-OCR2-3B returns markdown with semantic tags:
2026-01-19 11:51:23 +00:00
| Element | Output Format |
|---------|---------------|
| Tables | `<table>...</table>` (HTML) |
| Equations | `$...$` (LaTeX) |
| Images | `<img>description</img>` |
| Watermarks | `<watermark>OFFICIAL COPY</watermark>` |
| Page numbers | `<page_number>14</page_number>` |
| Flowcharts | Structured markup |
2026-01-19 11:51:23 +00:00
### Hardware Requirements
2026-01-19 11:51:23 +00:00
| Config | VRAM |
|--------|------|
| 30K context (default) | ~12-16GB |
| Speed | ~3-8 seconds per page |
2026-01-19 11:51:23 +00:00
---
## 🧠 Qwen3-VL-30B-A3B
The **most powerful** Qwen vision model—30B parameters with 3B active (MoE architecture). Handles complex visual reasoning, code generation from screenshots, and visual agent capabilities.
### ✨ Key Features
2026-01-19 11:51:23 +00:00
- 🚀 **256K context** (expandable to 1M tokens!)
- 🤖 **Visual agent capabilities** — can plan and execute multi-step tasks
- 💻 **Code generation from images** — screenshot → working code
- 🎯 **State-of-the-art** visual reasoning
### Quick Start
```bash
docker run -d \
--name qwen3vl \
--gpus all \
-p 11434:11434 \
-v ollama-data:/root/.ollama \
code.foss.global/host.today/ht-docker-ai:qwen3vl
```
Then pull the model (one-time, ~20GB):
```bash
docker exec qwen3vl ollama pull qwen3-vl:30b-a3b
```
### API Usage
```bash
curl http://localhost:11434/api/chat -d '{
"model": "qwen3-vl:30b-a3b",
"messages": [{
"role": "user",
"content": "Analyze this screenshot and write the code to recreate this UI",
"images": ["<base64-encoded-image>"]
}]
}'
```
### Hardware Requirements
| Requirement | Value |
|-------------|-------|
| VRAM | ~20GB (Q4_K_M quantization) |
| Context | 256K tokens default |
---
## 🐳 Docker Compose
2026-01-16 01:51:57 +00:00
2026-01-19 11:51:23 +00:00
Run multiple VLMs together for maximum flexibility:
2026-01-16 01:51:57 +00:00
```yaml
services:
# General vision tasks
2026-01-16 01:51:57 +00:00
minicpm:
image: code.foss.global/host.today/ht-docker-ai:minicpm45v
ports:
- "11434:11434"
volumes:
- ollama-data:/root/.ollama
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
restart: unless-stopped
2026-01-19 11:51:23 +00:00
# Document OCR with semantic output
nanonets:
image: code.foss.global/host.today/ht-docker-ai:nanonets-ocr
ports:
- "8000:8000"
2026-01-19 11:51:23 +00:00
volumes:
- hf-cache:/root/.cache/huggingface
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
restart: unless-stopped
2026-01-16 01:51:57 +00:00
volumes:
ollama-data:
hf-cache:
2026-01-16 01:51:57 +00:00
```
---
## ⚙️ Environment Variables
2026-01-19 11:51:23 +00:00
### MiniCPM-V 4.5 & Qwen3-VL (Ollama-based)
| Variable | Default | Description |
|----------|---------|-------------|
| `MODEL_NAME` | `minicpm-v` | Ollama model to pull on startup |
| `OLLAMA_HOST` | `0.0.0.0` | API bind address |
| `OLLAMA_ORIGINS` | `*` | Allowed CORS origins |
### Nanonets-OCR (vLLM-based)
| Variable | Default | Description |
|----------|---------|-------------|
| `MODEL_NAME` | `nanonets/Nanonets-OCR2-3B` | HuggingFace model ID |
2026-01-19 11:51:23 +00:00
| `HOST` | `0.0.0.0` | API bind address |
| `PORT` | `8000` | API port |
| `MAX_MODEL_LEN` | `30000` | Maximum sequence length |
2026-01-19 11:51:23 +00:00
| `GPU_MEMORY_UTILIZATION` | `0.9` | GPU memory usage (0-1) |
2026-01-16 01:51:57 +00:00
---
## 🏗️ Architecture Notes
### Dual-VLM Consensus Strategy
2026-01-19 11:51:23 +00:00
For production document extraction, consider using multiple models together:
1. **Pass 1:** MiniCPM-V visual extraction (images → JSON)
2. **Pass 2:** Nanonets-OCR semantic extraction (images → markdown → JSON)
3. **Consensus:** If results match → Done (fast path)
4. **Pass 3+:** Additional visual passes if needed
This dual-VLM approach catches extraction errors that single models miss.
2026-01-19 11:51:23 +00:00
### Why Multi-Model Works
2026-01-19 11:51:23 +00:00
- **Different architectures:** Independent models cross-validate each other
- **Specialized strengths:** Nanonets-OCR2-3B excels at document structure; MiniCPM-V handles general vision
2026-01-19 11:51:23 +00:00
- **Native processing:** All VLMs see original images—no intermediate structure loss
### Model Selection Guide
| Task | Recommended Model |
|------|-------------------|
| General image understanding | MiniCPM-V 4.5 |
| Document OCR with structure preservation | Nanonets-OCR2-3B |
2026-01-19 11:51:23 +00:00
| Complex visual reasoning / code generation | Qwen3-VL-30B |
| Multi-image analysis | MiniCPM-V 4.5 |
| Visual agent tasks | Qwen3-VL-30B |
| Large documents (30K+ tokens) | Nanonets-OCR2-3B |
2026-01-19 11:51:23 +00:00
---
## 🔧 Building from Source
```bash
# Clone the repository
git clone https://code.foss.global/host.today/ht-docker-ai.git
cd ht-docker-ai
# Build all images
./build-images.sh
# Run tests
pnpm test
2026-01-19 11:51:23 +00:00
```
---
## 🔍 Troubleshooting
### Model download hangs
```bash
docker logs -f <container-name>
```
2026-01-19 11:51:23 +00:00
Model downloads can take several minutes (~5GB for MiniCPM-V, ~20GB for Qwen3-VL).
### Out of memory
2026-01-19 11:51:23 +00:00
- **GPU:** Use a lighter model variant or upgrade VRAM
- **CPU:** Increase container memory: `--memory=16g`
### API not responding
1. Check container health: `docker ps`
2. Review logs: `docker logs <container>`
3. Verify port: `curl localhost:11434/api/tags` or `curl localhost:8000/health`
### Enable NVIDIA GPU support on host
```bash
# Install NVIDIA Container Toolkit
curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg
curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | \
sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \
sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
sudo apt-get update && sudo apt-get install -y nvidia-container-toolkit
sudo nvidia-ctk runtime configure --runtime=docker
sudo systemctl restart docker
```
2026-01-19 11:51:23 +00:00
### GPU Memory Contention (Multi-Model)
When running multiple VLMs on a single GPU:
- vLLM and Ollama both need significant GPU memory
- **Single GPU:** Run services sequentially (stop one before starting another)
- **Multi-GPU:** Assign each service to a different GPU via `CUDA_VISIBLE_DEVICES`
---
## License and Legal Information
This repository contains open-source code licensed under the MIT License. A copy of the license can be found in the [LICENSE](./LICENSE) file.
**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.
### Trademarks
This project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH or third parties, and are not included within the scope of the MIT license granted herein.
Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines or the guidelines of the respective third-party owners, and any usage must be approved in writing. Third-party trademarks used herein are the property of their respective owners and used only in a descriptive manner, e.g. for an implementation of an API or similar.
### Company Information
Task Venture Capital GmbH
Registered at District Court Bremen HRB 35230 HB, Germany
For any legal inquiries or further information, please contact us via email at hello@task.vc.
2026-01-16 01:51:57 +00:00
By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.