# ============== ENVIRONMENT VARIABLES for marker-api ========================
#
# Copy to .env and edit as needed:
#   cp .env.example .env
#
# All variables can also be passed via K8s ConfigMap/Secret,
# podman --env, or docker-compose environment.

# -----------------------------------
# Authentication
# -----------------------------------
API_KEY=                           # API key for X-API-Key auth (empty = disabled)
SELF_URL=http://localhost:8001      # Public URL for file download/upload links

# -----------------------------------
# OCR Backend
# -----------------------------------
OCR_BACKEND=marker                 # "marker" (marker-pdf) or "deepseek" (deepseek-ocr via ollama)

# -----------------------------------
# DeepSeek OCR (via Ollama)
# -----------------------------------
DEEPSEEK_OLLAMA_HOST=http://localhost:11434
DEEPSEEK_OCR_MODEL=deepseek-ocr:latest
DEEPSEEK_OCR_PROMPT=<|grounding|>Free OCR.

# -----------------------------------
# Ollama (LLM correction)
# -----------------------------------
OLLAMA_HOST=http://localhost:11434
DEESEEK_OCR_MODEL=deepseek-ocr

USE_LLM=false                      # Use an LLM to improve conversion accuracy
LLM_SERVICE=marker.services.ollama.OllamaService

OPENAI_BASE_URL=                   # For OpenAI-compatible LLM API
OPENAI_API_KEY=                    # API key for OpenAI-compatible service
OPENAI_MODEL=                      # Model name for OpenAI-compatible service

# -----------------------------------
# AMD GPU (set to true on AMD/ROCm systems)
# -----------------------------------
AMD_COMPUTE=false                  # set to "true" to enable ROCm
TORCH_DEVICE=                      # override PyTorch device ("rocm", "cuda", "cpu")
MODEL_DTYPE=float32                # "float32" or "bfloat16" (bfloat16 on capable GPUs)

# -----------------------------------
# Application
# -----------------------------------
PORT=8001
HOST=0.0.0.0
FLASK_APP=app
FLASK_DEBUG=0

# -----------------------------------
# Gunicorn (production)
# -----------------------------------
GUNICORN_WORKERS=3
GUNICORN_THREADS=4
GUNICORN_TIMEOUT=600
GUNICORN_LOGLEVEL=info

# -----------------------------------
# Paths
# -----------------------------------
RESULTS_DIR=/app/conversion_results
UPLOAD_DIR=/app/uploads
