Models¶
siglip2_toolkit.models ¶
Toolkit model cache: the toolkit's own store of models.
Everything the toolkit uses lives here, or is a local path you provide. The
HuggingFace cache is unrelated: this toolkit never reads it. The only network
access in the whole toolkit is download_model (the
siglip2 models download command).
Layout::
<home>/ # default: ~/.local/share/siglip2-toolkit
├── config.json # {"cache_dir": "...", "current": "..."}
└── models/
└── google--siglip2-base-patch16-naflex/
├── model.json # provenance: identifier, source, origin, date
└── ... # model files (config.json, weights, processor)
config.json is created on first use with the defaults already written, so
you can see and edit them (e.g. point cache_dir at another disk). There
are no environment variables.
CatalogModel
dataclass
¶
One entry of the informational SigLIP 2 catalog (nothing is automatic).
ModelEntry
dataclass
¶
A model stored in the toolkit cache.
ResolvedModel
dataclass
¶
A model resolved to a local directory, plus its identifier.
toolkit_home ¶
The toolkit home directory (explicit for non-default installations).
ensure_config ¶
Read config.json, creating it with visible defaults on first use.
cache_dir ¶
The model cache directory, as configured in config.json.
Accepts absolute paths or paths relative to the toolkit home.
default_device ¶
The device configured in config.json ("auto" when unset).
find_model ¶
Find a cache entry by identifier (or by its flattened directory name).
set_current ¶
Set the model in use (it must already be in the cache).
is_model_directory ¶
Whether path looks like a loadable transformers model directory.
download_model ¶
Download a HuggingFace model into the toolkit cache (the network path).
This is the only function in the toolkit that uses the network.
import_model ¶
Copy a model from a local path into the toolkit cache.
The source directory is never modified. name sets the identifier
(defaults to the folder name).
delete_model ¶
Delete a model from the toolkit cache (refuses the model in use).
resolve_model ¶
Resolve a model reference to a local directory.
Accepted references: an identifier in the toolkit cache, or a path to a
local model directory. With model=None the model in use is used, or
the built-in default. Never touches the network.