Local-first image similarity search.
日本語 · Install · Quick Start · Models · Development
picvec is an open-source CLI for visual similarity search. It runs vision models locally via ONNX Runtime, stores image embeddings in a local libsql database, and ranks matches with cosine distance.
Built by Arcnem AI, picvec reflects how we like to ship applied AI tools: local-first, inspectable, and useful without a cloud control plane.
- Local embeddings and local storage. Your images stay on your machine.
- Simple CLI workflow.
init,embed,search, andlistare enough to get useful results quickly. - No external vector database. Similarity search runs from a local libsql database.
- Practical model choices. Start with CLIP for speed or switch to SigLIP2 for stronger retrieval quality.
Download a release asset from GitHub Releases, or install with Go:
go install github.com/arcnem-ai/picvec@latestTo build from source:
git clone https://github.com/arcnem-ai/picvec.git
cd picvec
go build -o picvecRelease archives are currently published for macOS (arm64) and Linux (amd64).
picvec init
picvec embed test_images/cat1.jpg
picvec search test_images/cat1.jpg
picvec listpicvec init downloads ONNX Runtime, creates ~/.picvec/, initializes the local database, and fetches the default model.
| Command | What it does |
|---|---|
init |
Download ONNX Runtime and the default model |
embed [image] |
Embed an image and store it |
search [image] |
Find similar images |
list |
List embedded images |
set-model [name] |
Set the default embedding model |
config |
Show current configuration |
clean |
Remove all picvec data |
Global flag:
-v, --verboseenables extra runtime output
Embed images:
picvec embed photo.jpg
picvec embed photo.jpg -m siglip2If an embedding for the same path and model already exists, picvec skips it.
Search for similar images:
picvec search photo.jpg
picvec search photo.jpg -k 10
picvec search photo.jpg -m siglip2Results are sorted by cosine distance. If the query image already exists in the database, it is excluded from the results.
| Flag | Description | Default |
|---|---|---|
-k, --limit |
Number of results | 5 |
-m, --model |
Model to use | Config default |
List indexed images:
picvec list
picvec list -m clip
picvec list -k 20| Flag | Description | Default |
|---|---|---|
-k, --limit |
Max images to show | All |
-m, --model |
Filter by model | All |
Change the default model:
picvec set-model siglip2| Name | Architecture | Embedding Dim | Notes |
|---|---|---|---|
clip |
CLIP ViT-B/32 | 512 | Default. Fast and good for general-purpose similarity search. |
siglip2 |
SigLIP2 Base Patch16 | 768 | Higher-quality embeddings with a larger vector size. |
Both models use 224x224 inputs and quantized ONNX weights from Hugging Face.
- Images are resized and normalized with the selected model's preprocessing config.
- The selected vision model runs via ONNX Runtime and produces an embedding vector.
- Multi-token outputs are mean-pooled, then L2-normalized.
- Embeddings are stored as binary blobs in a local libsql database.
- Search uses
vector_distance_cos()for cosine similarity ranking.
All runtime data lives in ~/.picvec/:
~/.picvec/
config.json # Configuration such as the default model
picvec.db # libsql database
models/ # Downloaded ONNX model files
lib/ # ONNX Runtime shared library
Use picvec clean to remove everything.
cmd/Cobra commands and user-facing outputcore/Model registry, preprocessing, runtime setup, downloads, and embedding pipelinestore/Schema migration, inserts, listing, and vector search queriesconfig/~/.picvecpath helpers and config bootstrappingtest_images/Sample assets for manual testing
| OS | Published Release | Hardware Acceleration |
|---|---|---|
| macOS | arm64 |
CoreML when available |
| Linux | amd64 |
CPU |
The runtime setup includes paths for additional architectures, but GitHub Releases currently publish the targets above because the project depends on CGO-backed libraries that need native builds.
ONNX Runtime 1.24.3 is downloaded automatically on first run.
go test ./...
go build -o picvecSee CONTRIBUTING.md for contribution workflow and AGENTS.md for repo-specific agent instructions.
Built by Arcnem AI.