← Back

Module hub

enum ModelSource

Source: hub.joule:26

enum ModelFormat

Source: hub.joule:41

fn from_path(path: &Path) -> Self

Detect format from file extension

Source: hub.joule:64

fn extensions(&self) -> &[&str]

File extensions for this format

Source: hub.joule:79

fn supports_streaming(&self) -> bool

Whether this format supports streaming load

Source: hub.joule:94

fn supports_mmap(&self) -> bool

Whether this format supports mmap

Source: hub.joule:99

enum GgufQuantization

Source: hub.joule:106

fn bits_per_weight(&self) -> f32

Bits per weight

Source: hub.joule:138

fn memory_for_params(&self, param_count: u64) -> u64

Memory size for parameter count

Source: hub.joule:158

fn from_filename(name: &str) -> Option<Self>

Parse from GGUF filename pattern

Source: hub.joule:163

enum ModelArchitecture

Source: hub.joule:198

fn from_name(name: &str) -> Self

Parse from model name or config

Source: hub.joule:263

enum ModelTask

Source: hub.joule:304

struct ModelInfo

Source: hub.joule:340

struct ModelFile

Source: hub.joule:389

fn estimate_memory(&self) -> u64

Estimate memory required to load this model

Source: hub.joule:399

fn estimate_load_energy(&self) -> Joules

Source: hub.joule:419

fn fits_in_memory(&self, available_bytes: u64) -> bool

Check if model fits in memory

Source: hub.joule:426

fn best_variant_for_memory(&self, available_bytes: u64) -> Option<&ModelFile>

Get the best quantization variant for memory constraint

Source: hub.joule:431

enum HubError

Source: hub.joule:448

fn from(e: io::Error) -> Self

Source: hub.joule:460

struct HubConfig

Source: hub.joule:467

fn default() -> Self

Source: hub.joule:485

struct DownloadOptions

Source: hub.joule:509

struct Hub

Model Hub client for unified model access

Source: hub.joule:523

fn new() -> Self

Create new hub with default config

Source: hub.joule:531

fn with_config(config: HubConfig) -> Self

Create hub with custom config

Source: hub.joule:536

fn with_energy_tracker(mut self, tracker: Arc<EnergyTracker>) -> Self

Set energy tracker

Source: hub.joule:548

fn scan_local(&self, path: &Path) -> Result<Vec<ModelInfo>, HubError>

Source: hub.joule:709

fn import_local(&self, path: &Path) -> Result<ModelInfo, HubError>

Source: hub.joule:738

fn cached_models(&self) -> Vec<ModelInfo>

List all cached models

Source: hub.joule:835

fn cache_size(&self) -> u64

Get cache size in bytes

Source: hub.joule:840

fn clear_cache(&self, model_id: &str) -> Result<(), HubError>

Clear cache for specific model

Source: hub.joule:845

fn clear_all_cache(&self) -> Result<(), HubError>

Clear entire cache

Source: hub.joule:850

fn prune_cache(&self, target_bytes: u64) -> Result<u64, HubError>

Prune cache to target size

Source: hub.joule:855

fn energy_scope(&self, op: &str) -> Option<EnergyScope>

Source: hub.joule:863

fn verify_sha256(&self, path: &Path, expected: &str) -> Result<(), HubError>

Source: hub.joule:913

fn parse_hf_model_info(&self, json: &str, repo_id: &str) -> Result<ModelInfo, HubError>

Source: hub.joule:923

fn parse_hf_search_results(&self, json: &str) -> Result<Vec<ModelInfo>, HubError>

Source: hub.joule:932

fn parse_ollama_list(&self, json: &str) -> Result<Vec<ModelInfo>, HubError>

Source: hub.joule:939

fn parse_ollama_info(&self, json: &str, name: &str) -> Result<ModelInfo, HubError>

Source: hub.joule:946

fn parse_local_model(&self, path: &Path, format: ModelFormat) -> Result<ModelInfo, HubError>

Source: hub.joule:953

fn parse_local_model_dir(&self, path: &Path) -> Result<ModelInfo, HubError>

Source: hub.joule:996

fn copy_dir_recursive(&self, src: &Path, dst: &Path) -> Result<(), HubError>

Source: hub.joule:1062

struct ModelCache

Local model cache management

Source: hub.joule:1086

struct CacheEntry

Source: hub.joule:1091

fn new(base_dir: &Path) -> Self

Source: hub.joule:1100

fn get(&self, model_id: &str, revision: Option<&str>) -> Option<PathBuf>

Source: hub.joule:1109

fn path_for(&self, model_id: &str, revision: Option<&str>) -> PathBuf

Source: hub.joule:1122

fn mark_complete(&self, model_id: &str, revision: Option<&str>) -> Result<(), HubError>

Source: hub.joule:1128

fn list_all(&self) -> Vec<ModelInfo>

Source: hub.joule:1146

fn total_size(&self) -> u64

Source: hub.joule:1151

fn remove(&self, model_id: &str) -> Result<(), HubError>

Source: hub.joule:1156

fn clear_all(&self) -> Result<(), HubError>

Source: hub.joule:1168

fn prune_to_size(&self, target_bytes: u64) -> Result<u64, HubError>

Source: hub.joule:1180

fn cache_key(&self, model_id: &str, revision: Option<&str>) -> String

Source: hub.joule:1208

fn dir_size(path: &Path) -> io::Result<u64>

Source: hub.joule:1213

fn hub() -> &'static Hub

Get the global hub instance

Source: hub.joule:1237

fn from_local(path: impl AsRef<Path>) -> Result<ModelInfo, HubError>

Source: hub.joule:1270

fn recommend_variant(

Recommend best model variant for available memory

Source: hub.joule:1311

struct ModelRecommendation

Source: hub.joule:1320