Project
Phokus
A local-first desktop media library for Windows with on-device CLIP semantic search, local AI tagging, visual clustering, and duplicate clean-up.
Stack
Like a lot of developers, designers, and 3D artists, my local drives had slowly turned into an unsearchable digital junkyard. Between camera dumps, reference collections, generative AI renders, and random asset folders, I had tens of thousands of files scattered everywhere with names like DSC_0492.JPG and reference_concept_v2_final.
Finding anything meant manually clicking through directories or waiting for Windows Explorer to freeze while indexing.
I looked at the existing tools and hit three main walls:
Cloud galleries: Great search, but they want you to upload hundreds of gigabytes of media over the network, pay recurring storage fees, and surrender your privacy.
Traditional asset managers: They either lock you into proprietary library containers where moving a file breaks the whole database, or they hit you with monthly subscriptions.
Local viewers: Fast at opening a single file, but completely blind to what is actually inside your images.
I wanted a snappy, native-feeling desktop app that leaves files where they already live on disk, watches for changes in real time, and brings on-device AI search directly to local hardware without a single byte ever touching the internet.
So I built Phokus.
What It Does
1. Search by Meaning, Not Filenames
Phokus runs a local CLIP embedding model via Rust (using Hugging Face’s Candle framework). Instead of relying on perfect filenames, you search by mood, object, or concept:
Type
/s seasideand Phokus returns breaking waves, coastal cliffs, shells, and sand dunes.Search
/s brutalist concrete building at duskto pull up matching architectural references.Select a crop box inside any photo to run a region-similarity search across your entire library.
Filter by dominant color swatches when you only remember "it had a lot of teal and orange".
Everything runs 100% on-device and works completely offline.
2. Zero-Import, Live Filesystem Tracking
Phokus doesn't copy files into a hidden vault. You point it at existing folders on your SSDs or external drives, and the Rust backend indexes them into a local SQLite database.
A filesystem watcher keeps everything in sync as you work:
New files appear in the gallery within milliseconds.
Renaming or moving files across indexed folders updates the database in place — preserving ratings, custom tags, and existing embeddings without triggering expensive re-scans.
Missing drives or unplugged USBs are safely flagged without deleting records or corrupting the index.
3. Explore Views & Visual Clustering
When you don't know what you're looking for, traditional grids fail. Phokus includes several discovery modes:
Explore View: Clusters your entire library into interactive visual groups based on embedding similarity, so you can wander through themes and visual aesthetics.
Tag Cloud: Surfaces recurring tags across the whole collection with interactive co-occurrence graphs (showing tags that frequently appear together).
EXIF Timeline: A fast, chronological scrubber organized by the actual date taken.
4. On-Device AI Tagging
For deep categorization, Phokus bundles optional local tagger models (WD Tagger for illustration/anime, and JoyTag for photography) running on ONNX Runtime with DirectML or CUDA acceleration.
Tagging runs in small, throttled GPU bursts with customizable confidence thresholds so your PC stays completely usable while processing.
5. Safe Duplicate & Near-Duplicate Cleanups
Exact Duplicates: A 3-stage scanning pipeline (file size → partial header hash → full SHA-256) groups identical files with configurable keeper rules (preferring primary drives over backup dumps).
Near-Duplicates: A dedicated review mode flags recompressed, cropped, or slightly adjusted variants, providing side-by-side comparisons and animated visual diff overlays so you can cull space safely.
Architecture & How It’s Built
Phokus is built with Tauri v2, combining a low-overhead Rust backend with a React 19 + TypeScript frontend.
The Strict-Priority Worker Pipeline
Running thumbnail generation, video decoding, vector embedding, and AI tagging concurrently on tens of thousands of media files will saturate disk I/O, peg all CPU cores, and lock SQLite tables.
To solve this, the Rust backend uses a strict sequential priority pipeline:
Thumbnails & EXIF first — so the gallery grid is instantly browsable.
Video probing & keyframe extraction — handled via a bundled FFmpeg sidecar.
Visual embeddings — processed in batches through Candle.
AI Tagging — throttled background inference with per-folder pause controls.
60 FPS on 100,000+ Items
Rendering tens of thousands of image tiles in the DOM causes instant browser tab crashes. The gallery uses row-virtualized rendering with @tanstack/react-virtual, unmounting off-screen DOM nodes and recycling image buffers so memory consumption stays flat even during aggressive fast-scrolling.
Fast Vector Search with sqlite-vec & HNSW
Visual embeddings (512-dimensional vectors) are stored in SQLite using sqlite-vec alongside an in-memory HNSW index. This gives sub-10ms similarity queries across thousands of vectors without needing a standalone vector database daemon.
The "UI Lab" Secret Weapon
Desktop development cycles can be slow if you have to recompile Rust for every UI spacing tweak. I built a browser-only mock environment called UI Lab (pnpm dev:ui). It mocks all Tauri IPC invoke commands and background event streams, providing synthetic media libraries, fake tagging progress, and mock filesystem events in a plain browser tab with instant Vite hot-reloading. This made iterating on complex UI components 10x faster.
Current Status & What's Next
Phokus shipped its first public releases (v0.1.0 and v0.2.0) with full support for Windows 10/11 (CPU/DirectML and dedicated CUDA builds).
The next milestone is turning Phokus from a curator into a creative studio:
Reference Boards: PureRef-style freeform visual canvases populated directly from your library with color swatches and spatial grouping.
Local Generation Bridges (ComfyUI): Connecting the indexed library to generative AI workflows — using curated albums, palettes, and cropped regions as direct inputs for local generation recipes with visual genealogy tracking.