Photo Sorting Pipeline with Ollama-Routed Review States
Built custom photo ingest, dedupe, and search infrastructure with worker-local Ollama classification, ordered model fallback, and confidence-based routing into review states.
Overview
Started as a custom system for turning unsorted photos into structured, searchable records. The pipeline now classifies locally with Ollama, routes low-confidence outputs for review, and uses PhotoPrism for the primary library/frontend in the current runtime guidance.
Context & Role
Built the ingest pipeline, worker/app topology, deploy path, and current runtime boundary.
Problem
Raw photo dumps are hard to search, duplicate-heavy, and too noisy for fully automatic classification.
Objectives
Process unsorted photos, classify them locally, and keep low-confidence results reviewable.
Product Decisions
Ollama stays on the worker VM with ordered fallback models. Confidence thresholds route outputs into published (≥0.80), needs review (≥0.50), or rejected states. Current runtime guidance uses PhotoPrism on the worker VM as the primary library/frontend.
Solution
Worker pipeline computes hashes, skips duplicates, runs image classification through worker-local Ollama, writes sidecar JSON and DB metadata, then exposes search/review flows via FastAPI + SQLite FTS5. Current runtime guidance keeps local Ollama and uses PhotoPrism for the primary library/frontend.
Architecture
Ingest request → worker pipeline → hash dedupe → Ollama classification (qwen2.5vl:3b with llava:7b fallback) → confidence routing → metadata store/search UI or PhotoPrism runtime.
Metrics & Impact
Deployed smoke checks passed for the app and worker services. Low-confidence outputs are explicitly routed for human review instead of silently accepted. The runtime was simplified around the higher-memory worker VM.
Evidence
Worker fallback logs, confidence-gating tests, deployment verification docs, and active PhotoPrism/Ollama runtime documentation.
Challenges & Trade-offs
NFS between app and worker hosts was environment-sensitive, and local-model reliability required fallback handling.
Lessons
Current runtime guidance keeps Ollama on the worker VM and PhotoPrism as the primary library/frontend.