| Crates.io | models-cat |
| lib.rs | models-cat |
| version | 0.1.0 |
| created_at | 2025-04-15 06:56:06.393296+00 |
| updated_at | 2025-04-15 06:56:06.393296+00 |
| description | Unofficial Rust client for [ModelScope](https://www.modelscope.cn/) Hub |
| homepage | https://github.com/zhaoyii/models-cat |
| repository | https://github.com/zhaoyii/models-cat |
| max_upload_size | |
| id | 1634036 |
| size | 137,299 |
models-cat is an unofficial Rust client for ModelScope Hub, inspired by hf-hub. Born from a simple need: "To build a Rust desktop app requiring model/dataset downloads with no suitable Rust client."
When to use models-cat for model downloads? Three main scenarios:
Sync download:
use models_cat::{download_model_with_progress, ProgressBarWrapper};
download_model_with_progress(
"BAAI/bge-small-zh-v1.5",
"model.safetensors",
ProgressBarWrapper::default(),
).unwrap();
Note: The filename including extension and parent directory, such as model.safetensors or safetensors/model.safetensors.
Async download:
use models_cat::asynchronous::{download_model_with_progress, ProgressBarWrapper};
download_model_with_progress(
"BAAI/bge-small-zh-v1.5",
"model.safetensors",
ProgressBarWrapper::default(),
).await.unwrap();
Asynchronous download requires enabling the tokio feature:
model-cat = { version = "*", features = ["tokio"] }
Download models from ModelScope hosted repositories like BAAI/bge-small-zh-v1.5 to local storage,default cache path is [HOME_DIR].cache/modelscope/hub/models--BAAI--bge-small-zh-v1.5/.
When using shortcut functions, you can set the local cache path via the environment variable MODELS_CAT_CACHE_DIR. Alternatively, you can use ModelsCat and pass the local cache path during initialization.