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.
l2_normalize
L2-normalize a vector in-place. No-op for the zero vector.
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”).