| Crates.io | ollama-file-find |
| lib.rs | ollama-file-find |
| version | 0.1.6 |
| created_at | 2025-08-15 00:00:30.025061+00 |
| updated_at | 2025-08-18 15:19:52.456574+00 |
| description | A library for Ollama model file inspection and discovery. |
| homepage | |
| repository | https://github.com/Exotik850/ollama-file-find |
| max_upload_size | |
| id | 1795989 |
| size | 32,540 |
Lightweight Rust utilities to enumerate and inspect locally installed Ollama models by reading the on‑disk manifests and blobs directories. Provides normalized model names, layer + config metadata, summed sizes, modification times, and verified blob file paths.
ollama list naming behavior (ModelId::normalize).)Add to Cargo.toml (once published):
ollama-file-find = "0.1"
For workspace / path use:
ollama-file-find = { path = "src/ollama-file-find-inner" }
use ollama_file_find::{ollama_models_dir, scan_manifests, ScanArgs};
fn main() {
let root = ollama_models_dir();
let models = scan_manifests(ScanArgs {
root: &root.join("manifests"),
blobs_root: &root.join("blobs"),
include_hidden: false,
verbose: true,
});
for m in models {
println!("{} total={:?}", m.name, m.total_size);
}
}
ollama_models_dir() -> PathBuf – resolve default models directory ($OLLAMA_MODELS or $HOME/.ollama/models).ScanArgs { root, blobs_root, include_hidden, verbose } – scan configuration.scan_manifests(args) -> Vec<ListedModel> – walk manifests and build model records.ListedModel – normalized name + optional verbose details: layers, config, total_size, mtime, primary + full blob path list.LayerInfo, BlobPathInfo, ModelId – supporting metadata structures (serde friendly).digest_to_blob_path(blobs_root, digest) – convert sha256:abcd to on‑disk sha256-abcd path.<models>/manifests/... and <models>/blobs/sha256-<hex>.. skipped unless include_hidden.cargo test -p ollama-file-find
Licensed under the MIT License
The companion CLI crate (ollama-file-find-cli) offers JSON / plain output for scripting.