pub struct ModelLibrary;Expand description
Library API for managing model engrams.
Implementations§
Source§impl ModelLibrary
impl ModelLibrary
Sourcepub async fn save_model(
store: &mut dyn Store,
manifest: ModelManifest,
) -> Result<ManifestId>
pub async fn save_model( store: &mut dyn Store, manifest: ModelManifest, ) -> Result<ManifestId>
Save a model manifest as a typed engram.
Sourcepub async fn save_model_with_components(
store: &mut dyn Store,
model_id: &str,
architecture: &str,
license: &str,
config: Value,
weights: &[u8],
tokenizer: &[u8],
weight_sources: Vec<BlobSource>,
tokenizer_sources: Vec<BlobSource>,
privacy: PrivacyClass,
provenance: ProvenanceRecord,
trust: TrustEnvelope,
created_at: Timestamp,
) -> Result<ManifestId>
pub async fn save_model_with_components( store: &mut dyn Store, model_id: &str, architecture: &str, license: &str, config: Value, weights: &[u8], tokenizer: &[u8], weight_sources: Vec<BlobSource>, tokenizer_sources: Vec<BlobSource>, privacy: PrivacyClass, provenance: ProvenanceRecord, trust: TrustEnvelope, created_at: Timestamp, ) -> Result<ManifestId>
Save a model and its component blobs (weights, tokenizer) in one shot.
Sourcepub async fn load_model(
store: &mut dyn Store,
id: ManifestId,
) -> Result<Option<ModelManifest>>
pub async fn load_model( store: &mut dyn Store, id: ManifestId, ) -> Result<Option<ModelManifest>>
Load a model manifest by its manifest ID.
Sourcepub async fn resolve_components(
store: &mut dyn Store,
fetcher: &mut dyn BlobFetcher,
id: ManifestId,
) -> Result<Option<ResolvedModel>>
pub async fn resolve_components( store: &mut dyn Store, fetcher: &mut dyn BlobFetcher, id: ManifestId, ) -> Result<Option<ResolvedModel>>
Resolve all components of a model (config, tokenizer, weights) into byte buffers.
Auto Trait Implementations§
impl Freeze for ModelLibrary
impl RefUnwindSafe for ModelLibrary
impl Send for ModelLibrary
impl Sync for ModelLibrary
impl Unpin for ModelLibrary
impl UnsafeUnpin for ModelLibrary
impl UnwindSafe for ModelLibrary
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more