pub trait QuantizationResolver: Send + Sync {
// Required methods
fn resolve<'life0, 'life1, 'async_trait>(
&'life0 self,
repo_id: &'life1 str,
quantization: Quantization,
) -> Pin<Box<dyn Future<Output = Result<Resolution, DownloadError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn list_available<'life0, 'life1, 'async_trait>(
&'life0 self,
repo_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<Quantization>, DownloadError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Trait for resolving quantization-specific files from a model repository.
Implementations handle the specifics of querying APIs (HuggingFace, etc.)
to find GGUF files matching a requested quantization.
§Usage
ⓘ
let resolver: Arc<dyn QuantizationResolver> = /* ... */;
let resolution = resolver.resolve("unsloth/Llama-3-GGUF", Quantization::Q4KM).await?;
println!("Found {} files", resolution.file_count());Required Methods§
Sourcefn resolve<'life0, 'life1, 'async_trait>(
&'life0 self,
repo_id: &'life1 str,
quantization: Quantization,
) -> Pin<Box<dyn Future<Output = Result<Resolution, DownloadError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn resolve<'life0, 'life1, 'async_trait>(
&'life0 self,
repo_id: &'life1 str,
quantization: Quantization,
) -> Pin<Box<dyn Future<Output = Result<Resolution, DownloadError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Resolve files for a specific quantization.
Returns a Resolution containing the list of files to download
and metadata about the resolution.
Sourcefn list_available<'life0, 'life1, 'async_trait>(
&'life0 self,
repo_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<Quantization>, DownloadError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list_available<'life0, 'life1, 'async_trait>(
&'life0 self,
repo_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<Quantization>, DownloadError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
List all available quantizations in a repository.