• Stefy Lanza (nextime / spora )'s avatar
    Add dedicated OCR subsystem + finalize multi-engine backends · 2485403f
    Stefy Lanza (nextime / spora ) authored
    OCR (v0.1.85): new codai/ocr/ subsystem — dedicated OCR engines (NOT a VLM):
    - docTR (in-process, GPU) + PaddleOCR & Surya (isolated-venv subprocess workers
      via codai/ocr/workers/ocr_worker.py to avoid opencv-contrib/pillow<11 clashes;
      paddle-gpu bundles its own CUDA so a cu12x wheel runs on newer-CUDA hosts).
    - /v1/ocr, /v1/ocr/batch, /v1/ocr/schemas CRUD; `ocr` pipeline step.
    - Data-driven, user-extensible extraction schemas (named files + inline + auto),
      built-in seeds (italian_sentenza/generic_document/invoice); optional JSON Schema
      validation. Structured extraction via an existing coderai text model.
    - Configurable stamp/signature detection (off|layout|detector|both); bundled
      signature YOLO default; layout markers EN+IT (timbro/sigillo/firma).
    - Admin OCR card: engines/instances/detect/extraction + schema picker/raw-JSON/
      field-builder + isolated-venv build trigger (background build + status).
    - Isolated venvs resolve baked(/opt) > /cache mount (persistent) > ~/.coderai.
    - Deps: pypdfium2 in base requirements; requirements-ocr(.txt/-paddle.txt);
      requirements-surya.txt; build.sh --ocr.
    
    Also lands the multi-engine backend work: colibri multi-family (GLM/DeepSeek/Kimi),
    kimi-k3-in-c (k3), ktransformers (kt) — per-model selectable via resolve_engine_backend;
    plus a deferred vLLM backend design note (docs/vllm.md).
    Co-Authored-By: 's avatarClaude Opus 4.8 <noreply@anthropic.com>
    Claude-Session: https://claude.ai/code/session_01Mw2KQiswmD69T45fTfjKwW
    2485403f