hearth_resolve/lib.rs
1//! Resolve a model reference to fetchable bytes.
2//!
3//! hearth aggregates catalogs it does not own: Ollama's curated few hundred,
4//! and HuggingFace's hundreds of thousands of GGUFs. Neither is the product —
5//! the serving is. This crate is the seam between "what a person typed" and
6//! "these exact bytes, with this digest".
7//!
8//! Everything here is pure. Reference parsing, layer selection, quantization
9//! choice and multi-part detection are all rules, and rules are testable
10//! without a network. The HTTP that actually moves bytes lives elsewhere and
11//! contains no decisions.
12//!
13//! ```
14//! use hearth_resolve::Reference;
15//! assert_eq!(
16//! Reference::parse("llama3").unwrap().key(),
17//! "ollama/library/llama3:latest",
18//! );
19//! ```
20
21pub mod plan;
22pub mod reference;
23
24pub use plan::{
25 available_quants, pick_gguf, plan_from_hf_files, plan_from_ollama_manifest, quant_of,
26 total_parts, Blob, FetchPlan, HfSource, QuantChoice, RepoFile, ResolveError,
27 OLLAMA_MODEL_MEDIA_TYPE, QUANT_PREFERENCE,
28};
29pub use reference::{ParseError, Reference};