Expand description
Local embeddings and a persistent cosine vector store.
Feature boundaries: inference (ONNX text embedder) and vector (SQLite-backed
cosine store). Both are default-on; a vector-only build does not pull ort or tokenizers.
Structs§
- Accelerator
Parity - Result of the load-time vector parity check an accelerator passed; see
Embedder::accelerator_parity. - Core
MlUnits - The compute units of each Core ML function (
embed_32..embed_512). - Core
MlUnits Parse Error - An unreadable compute-unit or unit-map specification.
- Embedder
- Embedder
Config - Load
Timings - Where an E40 load spent its time; see
Embedder::load_timings. Phases are wall-clock durations of the work asEmbedder::loadran it; they nest (session_createshappen inside the probe and the parity check) and do not add up tototalexactly. - Nearest
- Session
Create - One graph build during an E40 load.
- Vector
Store
Enums§
- Core
MlCompute Unit - Which Core ML compute units run one function (
MLComputeUnits). - Embed
Error - Execution
Provider - Where inference runs.
- Parity
Cache Outcome - What the load-time parity check did with the opt-in verdict cache
(
EmbedderConfig::with_parity_cache_dir). - Vector
Error
Constants§
- ACCELERATOR_
PARITY_ MIN_ COSINE - An accelerator is admitted only if every parity prompt’s native-dimension vector has at least this cosine similarity to the CPU provider’s vector for the same prompt. Two correct runs of the same Q4 graph agree at about 0.999; a DirectML run of EmbeddingGemma 2 Q4 measured 0.58-0.72.
- DEFAULT_
MAX_ BATCH - Default rows per ONNX call for
embed_batch/embed_query_batch. - DEFAULT_
VECTOR_ DIM - EMBEDDINGGEMM
A2_ COREML_ MODEL_ ID - EmbeddingGemma 2 Core ML build (macOS 15+):
EmbeddingGemma2Text.mlpackage(one fixed-shape function per length 32, 64, 128, 256, 512) and a host-side bf16 token table, run through the Core ML framework directly (an.mlpackagecannot be loaded through ONNX Runtime). Selected when the model directory holds that layout. Same weights, different numerics from the Q4 and E40 models, so a different pipeline id. - EMBEDDINGGEMM
A2_ E40_ MODEL_ ID - EmbeddingGemma 2 E40 export: fp16, five fixed-length graphs and a host-side token
table (
embed_tokens.f16.npy), run on DirectML (Windows) or CPU. Selected when the model directory holds that layout. Same weights as the Q4 model, different numerics, so a different pipeline id. - EMBEDDINGGEMM
A2_ MODEL_ ID - EmbeddingGemma 2 text-only Q4 export (b64, accuracy level 4). Selected when
the model directory’s top-level
config.jsonmodel_typeisembedding_gemma2. - EMBEDDINGGEMMA_
MODEL_ ID - NEURAL_
ENGINE_ MAX_ TOKENS - Longest graph (in tokens) the default map sends to the Neural Engine; longer graphs use the GPU.