siglip2-toolkit
Local-first toolkit around Google's SigLIP 2 models: text/image embeddings, zero-shot and fine-tuned classification, incremental corpus export, and retrieval math.
It is not a vector database: it produces embeddings and portable exports, and stays agnostic about where you store or search your vectors.
Co-developed by GIA-UH and Syalia S.R.L..
Installation
pip install siglip2-toolkit # library + CLI
pip install "siglip2-toolkit[server]" # + REST server (FastAPI)
Model management (the toolkit's own cache)
Models live in the toolkit's own cache, independent from HuggingFace's
cache. The only command that uses the network is models download;
everything else works with what you already have locally.
siglip2 models # your cache (★ model in use, origin, size)
siglip2 models --hf # SigLIP-2 catalog on HuggingFace: ✓ have it / ☁ downloadable
siglip2 models current # the model in use (+ path, origin; --json)
siglip2 models use <id> # set the model in use (persistent)
siglip2 models download <org/name> [--revision REV] # into the toolkit cache (network)
siglip2 models import <path> [--name ALIAS] # copy a local model into the cache
siglip2 models delete <id> # delete from the cache (refuses the model in use)
Configuration lives in <home>/config.json (default home
~/.local/share/siglip2-toolkit/, created on first use):
{
"cache_dir": "~/.local/share/siglip2-toolkit/models",
"current": "google/siglip2-base-patch16-naflex",
"device": "auto"
}
cache_dir: where the cache lives; change it to relocate it (e.g. another disk).current: the model in use.device:auto(CUDA → MPS → CPU), orcuda,cpu,mps,cuda:1, … Any command's--deviceoverrides it for that run.
There are no environment variables; for non-default installations pass
--home DIR (global option, before the command).
--model accepts either an identifier from your cache or a path to a local
model directory. The implicit default is
google/siglip2-base-patch16-naflex: on a machine that does not have it yet,
the first command tells you the exact models download to run. The toolkit
never picks a model for you.
Incremental exports refuse to run when the existing export was produced by a different model: mixing embedding spaces would silently corrupt the vectors.
Three ways to use it
1. As a library (primary interface)
from siglip2_toolkit import Embedder, models
# Resolve from your cache (download/import first) or pass a local path.
resolved = models.resolve_model("google/siglip2-base-patch16-naflex")
embedder = Embedder(model=resolved.path, model_id=resolved.identifier, device="auto")
vectors = embedder.embed_texts(["a wedding at sunset"])
results = embedder.classify(["photo.jpg"], labels=["beach", "mountain", "wedding"])
from siglip2_toolkit.filters import field, matches
matches({"width": 2400}, field("width") >= 2000) # -> True
2. As a CLI
siglip2 models download google/siglip2-base-patch16-naflex
siglip2 models use google/siglip2-base-patch16-naflex
siglip2 export -i /path/to/photos -o embeddings.jsonl --incremental
siglip2 classify --image photo.jpg --labels "beach,mountain,wedding"
3. As a REST service (optional extra)
pip install "siglip2-toolkit[server]"
siglip2 serve --host 0.0.0.0 --port 8000
Endpoints: /v1/embed/text, /v1/embed/image, /v1/classify, /v1/health, /v1/info.
Highlights
- Library-first design: the CLI and the REST server are thin adapters over the same public API.
- Zero-shot classification: prompt-based labels using the model's calibrated SigLIP logits, plus fine-tuned classification heads (
ImageClassifier). - Own model cache: downloads and imports live in the toolkit cache (independent from HuggingFace's); only
models downloaduses the network. - GPU-ready:
device: "auto"picks CUDA when available (FP16; FP32 on CPU); override per command with--device. - Incremental export: new, modified and deleted files are detected (modification detection requires metadata).
- Resumable runs: interrupted exports continue where they left off.
- Optional metadata: rich file metadata (EXIF, dimensions, timestamps, thumbnails) — or ids and vectors only, your choice.
- Versioned export format (
jsonl/pkl) with an embedding-space manifest. - Retrieval math: top-k scoring, RRF fusion, similarity-drop filtering and serializable metadata filters, composable with any store.
Status: first preview (0.0.1, October 2026). The public API and the export format may still change before 1.0; pin the version you depend on.
License
MIT — see LICENSE.
Metadata
Release files for siglip2-toolkit 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| siglip2_toolkit-0.0.1.tar.gz | 184.7 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| siglip2_toolkit-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 225.1 kB
Release files / siglip2_toolkit-0.0.1.tar.gz
| Download URL | siglip2_toolkit-0.0.1.tar.gz |
|---|---|
| Size | 184.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c267f46a70cbbaaf3276f615e83d2de546289111a489b9b64f34a86dfd736c5c
|
|
BLAKE2b-256 checksum How to use checksums |
32c8248d72b247ffdae73b47aaaed0f230dc0cc71b801f737c7b5e24deac8a02
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.2
|
Release files / siglip2_toolkit-0.0.1-py3-none-any.whl
| Download URL | siglip2_toolkit-0.0.1-py3-none-any.whl |
|---|---|
| Size | 40.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
12f725b10a13533515c20c59c94d9279c19e88b24ffe6725549f9699ec314224
|
|
BLAKE2b-256 checksum How to use checksums |
11c2cb294faa255be38e5b274e9bd8b81d3fe4b281e280780f12b5abc43396cb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.2
|
Security for siglip2-toolkit 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.