Expand description
Model management service for downloading and caching AI models from HuggingFace Hub
This service provides a unified interface for:
- Downloading models from HuggingFace Hub using the model catalog
- Caching models to the project’s models/ directory
- Listing available and installed models
- Managing model lifecycle (pull, remove, info)
§Design
- Models are defined in
model_catalog.tomlembedded in the CLI binary - Models are downloaded from HuggingFace Hub on first use (lazy loading)
- Models are cached to
<project_root>/models/<name>.onnx - HF cache is also used (
~/.cache/huggingface/hub/) for offline support
§Usage
use mecha10_cli::services::ModelService;
let service = ModelService::new()?;
// List catalog models
let catalog = service.list_catalog()?;
// Download a model
service.pull("yolov8n", None)?;
// List installed models
let installed = service.list_installed()?;Structs§
- Installed
Model - Installed model metadata
- Model
Catalog Entry - Model catalog entry from model_catalog.toml
- Model
Info - Combined model information (catalog + installed)
- Model
Service - Model management service
- Quantize
Config - Quantization configuration for automatic INT8 conversion
Enums§
- Preprocessing
Preset - Preprocessing presets for common model families