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.
Re-exports§
pub use download_plan::DEFAULT_MODEL_DOWNLOAD_CONCURRENCY;pub use download_plan::DownloadAction;pub use download_plan::DownloadPlan;pub use download_plan::DownloadPlanError;pub use download_plan::FileDownloadProgress;pub use download_plan::FileDownloadStatus;pub use download_plan::FriendlyDownloadProblem;pub use download_plan::ModelFilePlan;pub use download_plan::OverallDownloadProgress;pub use download_plan::build_download_plan;pub use generation::GenerationTransitionError;pub use generation::GenerationValueError;pub use generation::ManagedGenerationId;pub use generation::ManagedGenerationRecord;pub use generation::ManagedGenerationSnapshot;pub use generation::ManagedGenerationState;pub use generation::ManagedProfileState;pub use generation::ModelStoreProfileId;pub use generation::StartupEpoch;pub use generation::StartupValidationEvidence;pub use model_store::ExclusiveAccess;pub use model_store::MODEL_STORE_LOCK_FILE;pub use model_store::ManagedModelStore;pub use model_store::ModelStoreLockError;pub use model_store::ModelStoreMutationGuard;pub use readiness::FileReadiness;pub use readiness::LocalFileIntegrity;pub use readiness::LocalFileStatus;pub use readiness::ModelProvenance;pub use readiness::ModelReadiness;pub use readiness::ModelReadinessReport;pub use readiness::check_app_managed_model_readiness;pub use readiness::check_model_readiness;pub use readiness::check_user_supplied_model_readiness;pub use trust::DEFAULT_TRUSTED_MODEL;pub use trust::HeaderDisposition;pub use trust::HttpClientPolicy;pub use trust::PRODUCTION_HTTP_CLIENT_POLICY;pub use trust::TrustPolicyError;pub use trust::TrustedModelFile;pub use trust::TrustedModelIdentity;pub use trust::TrustedModelManifest;pub use trust::TrustedTransportPolicy;pub use trust::redirect_header_disposition;pub use trust::validate_initial_url;pub use trust::validate_redirect_url;
Modules§
- download_
plan - Download plan: maps readiness → actions (RFC-043 §10).
- generation
- Typed managed-generation lifecycle state for RFC-050 §3B.
- model_
store - Cross-process serialization for the managed model store (RFC-050 §5).
- readiness
- Local model file readiness check (RFC-043 §7).
- trust
- Reviewed trust root and pure transport policy for RFC-050.
Structs§
- Embedding
Batch Stats - Per-call batch statistics for measurement only (RFC-048 Task 011) —
never consulted by embedding logic itself.
padded_seq_lenis what the backend’s padding strategy actually resolved to for this call;real_token_positionsis the sum, across the whole batch, of each item’s non-padding token count (from its attention mask, where the backend has one).batch_size * padded_seq_lenis the padded token-position count the call actually paid for. - Embedding
Model Config - Configuration for loading a real embedding model from disk.
- Mock
Embedding Model - Deterministic 8-dimensional mock embedding model.
- Rerank
Candidate - A candidate document passed to the reranker.
- Rerank
Score - Per-candidate rerank score (higher = more relevant).
- Reranker
Config - Configuration for a cross-encoder reranker model.
- Vector
Candidate - A vector search candidate (RFC-008 §13).
Enums§
- Inference
Backend - The compute backend used for local inference.
- Model
Role - Model roles (catalog
models.role). - Model
Status - Model availability (catalog
models.status). - Search
Capability - Search capability derived from model availability. Keyword search never depends on models (RFC-007: works with zero models installed).
Traits§
- Cross
Encoder Reranker - Cross-encoder reranker contract (RFC-010 §5).
- Embedding
Model - Local embedding model abstraction (RFC-008 §6).
Functions§
- blob_
to_ vec - Deserialize from BLOB bytes; returns
Noneon 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.
- vec_
to_ blob - Serialize a vector to little-endian bytes for BLOB storage (RFC-008 §12.1 “sqlite_blob with FP32”).