case file · 08 / ML / data eng · 2026 · active
Specimen
Specimen is a self-hosted cataloging system for a 20,000-file font hoard — it discovers, dedupes, and deeply analyzes every font, with CLIP visual embeddings powering similarity search and duplicate detection.
the engineering move
Hand-rolled a torch-free CLIP inference path — exported ViT-B/32 to ONNX and reimplemented open_clip's exact image preprocessing (bicubic resize, center-crop, channel normalization) in raw NumPy/PIL to escape a torch dependency conflict — then tuned the ONNX Runtime session (disabled memory arena/pattern growth, capped intra-op threads) to keep RSS bounded inside a hard container memory limit.
brief
Specimen is a self-hosted font cataloging system built to tame a 20,000+ file font hoard on a home NAS. A Postgres-backed pipeline (no Redis, no Celery — the database is the queue) discovers, dedupes, and deeply analyzes every font: OpenType table parsing, glyph outline extraction, and CLIP ViT-B/32 visual embeddings for similarity search and duplicate detection via pgvector cosine KNN. A Next.js frontend exposes a polished dark-themed catalog with tagging, family grouping, style-pairing suggestions, and an admin triage queue. Shipped in 4 weeks across 144 commits and 10 build phases, live on the homelab.
artifacts
scale
- font corpus
- 20K+
- commits
- 144
- to ship
- ~4 wks
stack
- Python
- FastAPI
- SQLAlchemy 2.0 async
- PostgreSQL 16
- pgvector
- ONNX Runtime
- CLIP ViT-B/32
- Next.js 15
- Docker Compose