"""
OCR Provenance MCP System - Python Workers

This package provides:
- GPU utilities for CUDA device validation and VRAM monitoring
- OCR worker (Marker-pdf) for local document processing
- VLM worker (Chandra) for local image description
- Embedding worker for local inference with nomic-embed-text-v1.5
- Reranker worker for cross-encoder passage reranking

CRITICAL DESIGN PRINCIPLES:
- CP-004: Local Inference - ALL processing runs locally on CUDA GPU
- No data leaves the local machine
- CUDA-only: No MPS, no CPU fallback. Fails fast without NVIDIA GPU.

Module Structure:
- gpu_utils: GPU verification, VRAM monitoring, CUDA validation
- ocr_worker_local: Marker-pdf OCR (daemon mode)
- vlm_worker_local: Chandra VLM image description (daemon mode)
- embedding_worker: nomic-embed-text-v1.5 inference (per-call)
- reranker_worker: cross-encoder reranking (per-call)
"""

__version__ = "1.0.0"
__author__ = "OCR Provenance MCP System"

from .embedding_worker import (
    DEFAULT_BATCH_SIZE,
    DEFAULT_DEVICE,
    EMBEDDING_DIM,
    MODEL_NAME,
    # Constants
    MODEL_PATH,
    MODEL_VERSION,
    PREFIX_DOCUMENT,
    PREFIX_QUERY,
    # Data classes
    EmbeddingResult,
    QueryEmbeddingResult,
    embed_chunks,
    embed_query,
    embed_with_oom_recovery,
    generate_embeddings,
    generate_query_embedding,
    # Core functions
    load_model,
)
from .gpu_utils import (
    EmbeddingModelError,
    # Error classes
    GPUError,
    # Type definitions
    GPUInfo,
    GPUNotAvailableError,
    GPUOutOfMemoryError,
    ModelInfo,
    VRAMUsage,
    clear_gpu_memory,
    get_vram_usage,
    test_embedding_generation,
    # Core functions
    verify_gpu,
    verify_model_loading,
)

__all__ = [
    # Constants (from embedding_worker)
    "DEFAULT_BATCH_SIZE",
    "DEFAULT_DEVICE",
    "EMBEDDING_DIM",
    "MODEL_NAME",
    "MODEL_PATH",
    "MODEL_VERSION",
    "PREFIX_DOCUMENT",
    "PREFIX_QUERY",
    # Error classes (from gpu_utils)
    "EmbeddingModelError",
    "GPUError",
    "GPUNotAvailableError",
    "GPUOutOfMemoryError",
    # Data classes (from embedding_worker)
    "EmbeddingResult",
    "QueryEmbeddingResult",
    # Type definitions (from gpu_utils)
    "GPUInfo",
    "ModelInfo",
    "VRAMUsage",
    # Version
    "__version__",
    # Embedding functions (from embedding_worker)
    "embed_chunks",
    "embed_query",
    "embed_with_oom_recovery",
    "generate_embeddings",
    "generate_query_embedding",
    "load_model",
    # GPU utilities (from gpu_utils)
    "clear_gpu_memory",
    "get_vram_usage",
    "test_embedding_generation",
    "verify_gpu",
    "verify_model_loading",
]
