PhotoSort

PhotoSort

Privacy-first AI for your photo and video library.

Sort photos, screenshots and videos into folders, gather the ones from "the birthday party last Sunday", find anything with a plain-language search, and recognize the people in them, all with AI models running on your own machines. Nothing is sent to a cloud AI.

What it does

Sort into categories

Classify photos, screenshots and videos into bucket folders you configure (people, food, nature, receipts, chat screenshots, memes…), across a whole tree of subfolders into one flat set of buckets.

Gather by request

Ask in plain language, for example "birthday party on last Sunday". Matching photos and videos go into one folder; everything else stays where it is. Dates come from the files' capture time, not a guess.

Search and browse

Each file gets a local caption and embedding, so "receipt from the hardware store" or "kids on the boat" finds it. Browse results as thumbnails, and carry the index to another PC with export and import.

Tag and discover faces

Match people in photos and videos against a few reference pictures per person, with no training. Don't have references? faces-discover groups the faces in a folder into one folder per person for you to name.

Desktop dashboard

Run jobs with live progress, browse a media gallery, review every past run, watch the model cluster and privacy checks, and edit settings in a checked editor.

Safe and reversible

Preview first, then apply exactly what the preview found. Every move is journaled and can be undone, even after Ctrl+C. Files are moved byte-for-byte: never re-encoded, resized or stripped.

How it works

  1. Your PC Photos stay in your folders (OneDrive or local). PhotoSort reads them and sends work only to 127.0.0.1.
  2. NVIDIA PAIR proxy The Personal AI Router's Ollama endpoint on 127.0.0.1:11434 spreads requests across your GPU machines.
  3. Your LAN GPUs Vision model gemma4:12b sorts and captions; qwen3-embedding:8b powers search. Face detection (InsightFace) runs on LAN workers over SSH.

Videos are read as 8 evenly spread keyframes per request (faces use every keyframe). Audio is never used.

Privacy by design

  • No cloud AI, enforced in code. Model requests may only go to a loopback address; system proxies are ignored; cloud models (…-cloud names, or ones PAIR reports as remote) are refused before any photo is sent.
  • Face workers stay on your LAN. A worker on a public address is refused. Images travel through an SSH tunnel and are decoded in memory.
  • The search index is yours. Captions and embeddings live in a local file outside OneDrive and outside the repo.
  • Reports show counts, not names. Per-file lines go to a log you keep; finish reports carry only totals, durations and per-bucket counts.
  • Locked-down dashboard. Loopback-only server with a token and strict CSP; its window blocks every request outside the dashboard and can hide itself from screen capture.

Measured on a home cluster

~100images/min sorted, sustained (gemma4:12b, 0 malformed replies in 205 calls)
~75images/min captioned for search (12 requests in flight)
~3,660images/min face-tagged on one DGX Spark worker
22/22birthday-party photos found by group in a public test set

Your numbers depend on your GPUs and network. Details and methods are in the benchmark.

Get started

You need

  • Windows with Python 3.12 (a Miniconda env named utils)
  • NVIDIA PAIR (Personal AI Router) on this PC, serving a vision model (gemma4:12b) and an embedding model (qwen3-embedding:8b) from your machines
  • For faces: a Linux or macOS machine on your LAN with SSH

Try it

git clone https://github.com/canvito/PhotoSort.git
cd PhotoSort
conda create -n utils python=3.12
conda run -n utils pip install -r requirements.txt

.\photosort.cmd check
.\photosort.cmd sort "<folder>" --action report   # preview
.\photosort.cmd sort "<folder>"                   # move into buckets
.\photosort.cmd undo "<folder>\_photosort_journal.jsonl"

.\photosort.cmd group "<folder>" "birthday party on last Sunday"
.\photosort.cmd index "<folder>"
.\photosort.cmd search "kids on the boat"

.\dashboard.ps1                                  # desktop dashboard

Full setup, every option and troubleshooting: the operator guide.