Skip to main content

Installation Guide

Chunkr runs as a collection of Docker services orchestrated with Docker Compose. This guide covers installation for GPU-accelerated deployments, CPU-only systems, and Mac ARM devices.

Prerequisites

1

Install Docker

Install Docker Desktop or Docker Engine:Verify installation:
2

Install NVIDIA Container Toolkit (GPU Only)

For GPU acceleration, install the NVIDIA Container Toolkit:
Skip this step if you’re using CPU-only or Mac ARM deployment.
Full installation guide
3

Verify GPU Access (GPU Only)

Test that Docker can access your GPU:
You should see your GPU information.

Quick Installation

1

Clone the Repository

2

Set Up Environment

3

Configure LLM Models

Edit models.yaml with your LLM configuration. See LLM Configuration below.
4

Start Services

First startup downloads several GB of models and may take 10-15 minutes.
5

Verify Installation

Check that all services are running:
All services should show “Up” status. Access:

LLM Configuration

Chunkr requires at least one LLM for vision-language model processing. You can configure multiple models with fallbacks. The models.yaml file supports multiple LLM providers with advanced options:
models.yaml
  • Exactly one model must have default: true
  • Exactly one model must have fallback: true (can be the same as default)
  • Use id to reference models in API requests
  • rate-limit is optional and sets requests per minute cap

Using Environment Variables (Basic)

For simple single-LLM setups, use environment variables in .env:
.env
Environment variables are overridden by models.yaml. If you use models.yaml, remove or comment out the LLM__* variables.

Common LLM Providers

Get API Key | Documentation

Service Architecture

Chunkr consists of multiple containerized services:
  • server: Main API server (Rust/Actix-Web) on port 8000
  • task: Background worker pool (30 replicas for GPU, 10 for CPU)
  • web: React-based UI on port 5173
  • postgres: Database for metadata and task state
  • redis: Queue and cache for job processing
  • minio: S3-compatible object storage for files
  • segmentation: YOLO-based layout detection (6 replicas)
    • GPU: Uses NVIDIA GPU acceleration
    • CPU: Optimized for multi-core processing
  • ocr: DocTR OCR engine (3 replicas)
    • GPU: CUDA-accelerated inference
    • CPU: Uses smaller model variant
  • keycloak: Authentication and user management (port 8080)
  • adminer: Database admin UI (port 8082)
  • nginx: Load balancer for processing services

Port Mappings

GPU vs CPU Performance

Performance comparison for a typical 10-page PDF:
GPU acceleration provides 3-4x speedup for segmentation and OCR operations.

Scaling Configuration

Adjusting Worker Replicas

Edit compose.yaml to scale processing:
compose.yaml

Resource Limits

For production, add resource constraints:

Stopping and Managing Services

Troubleshooting

Check Docker daemon:
View startup errors:
Common issues:
  • Port conflicts (8000, 5173, etc. already in use)
  • Insufficient memory (requires 16GB+ for full stack)
  • Missing .env or models.yaml files
Verify GPU access:
Check NVIDIA Container Toolkit:
Restart Docker after toolkit install:
Reduce worker replicas in compose.yaml:
Use CPU deployment if GPU memory is limited:
Monitor resource usage:
Test LLM endpoint manually:
Check models.yaml syntax:
View server logs:
Ensure using Mac compose override:
Reduce concurrent tasks:
  • Decrease replicas for task, segmentation-backend, ocr-backend
  • Process documents sequentially instead of parallel
Allocate more resources to Docker Desktop:
  • Open Docker Desktop → Settings → Resources
  • Increase CPUs to 8+ and Memory to 16GB+

Production Deployment

The default configuration is designed for development. For production:
  1. Enable authentication: Configure Keycloak properly
  2. Use HTTPS: Set up reverse proxy with SSL/TLS
  3. Secure secrets: Use Docker secrets or environment encryption
  4. Configure backups: Back up PostgreSQL and MinIO data
  5. Monitor resources: Set up alerts for CPU, memory, disk usage
  6. Rate limiting: Configure per-model rate limits in models.yaml
  7. Task expiration: Set appropriate expires_in values

Environment Variables Reference

Key configuration options in .env:

Next Steps

Quickstart

Make your first API request

API Reference

Explore the complete API

Configuration

Advanced configuration options

Examples

Code examples and use cases