Skip to main content

Crate orbok_models

Crate orbok_models 

Source
Expand description

§orbok-models

Local AI model vocabulary (RFC-012). Milestone M1–M6 only needs the shared types and the “what is available” summary the UI shows; the install/locate/validate workflow lands in M12.

Privacy rule carried from the requirements: model download is the only network operation orbok may ever perform, it is explicit, and it never involves document contents.

Structs§

EmbeddingModelConfig
Configuration for loading a real embedding model from disk.
MockEmbeddingModel
Deterministic 8-dimensional mock embedding model.
MockReranker
Deterministic mock reranker: scores by passage length (longer = more informative). Useful for pipeline testing without an ML model.
RerankCandidate
A candidate document passed to the reranker.
RerankScore
Per-candidate rerank score (higher = more relevant).
RerankerConfig
Configuration for a cross-encoder reranker model.
VectorCandidate
A vector search candidate (RFC-008 §13).

Enums§

InferenceBackend
The compute backend used for local inference.
ModelRole
Model roles (catalog models.role).
ModelStatus
Model availability (catalog models.status).
SearchCapability
Search capability derived from model availability. Keyword search never depends on models (RFC-007: works with zero models installed).

Traits§

CrossEncoderReranker
Optional local cross-encoder reranker (RFC-010 §5).
EmbeddingModel
Local embedding model abstraction (RFC-008 §6).

Functions§

blob_to_vec
Deserialize from BLOB bytes; returns None on length mismatch.
cosine_similarity
Compute cosine similarity between two L2-normalized vectors.
cosine_similarity_i8
Compute approximate cosine similarity from INT8 vectors via FP32 conversion. For exact INT8 dot-product, a SIMD-optimised path would be preferable; this provides correct results at lower compute cost than full FP32.
dequantize_from_i8
Dequantize INT8 back to FP32 for similarity computation.
i8_blob_to_vec
Deserialize INT8 vector from BLOB bytes.
i8_vec_to_blob
Serialize INT8 vector to bytes for BLOB storage.
l2_normalize
L2-normalize a vector in-place. No-op for the zero vector.
quantize_to_i8
Quantize an L2-normalized FP32 vector to INT8.
search_capability
Derive the capability shown in the UI from model statuses.
vec_to_blob
Serialize a vector to little-endian bytes for BLOB storage (RFC-008 §12.1 “sqlite_blob with FP32”).