Skip to main content

Module hf

Module hf 

Source
Expand description

Minimal HuggingFace tree-listing helper used by outrig config init.

Returns each file’s path and size so the picker can display human-readable sizes alongside filenames – mistralrs users tell quantizations apart by file size as much as by name. Hits HF’s /api/models/{id}/tree/{revision} directly via reqwest (rather than hf-hub::Api::info(), which only exposes filenames).

The local-llm feature pulls in reqwest for the real implementation. Builds without the feature still get the trait plus an Unavailable impl that always errors – so the init flow can prompt for model-file as free-form text without compiling against reqwest.

Structs§

HfFile
One file in a HuggingFace repo, projected into the fields the picker needs. size is the file’s byte count when known (HF’s tree endpoint reports it for every regular file; the field stays Option so future API quirks don’t break the picker).
UnavailableHfTreeFetcher
Always-fails fetcher used when the local-llm feature is off (or by callers that explicitly want to bypass the network). Returns a configuration error the prompt flow recognizes as “fall back to the free-form text prompt”.

Enums§

AutoHfTreeFetcher

Traits§

HfTreeFetcher

Functions§

auto
Pick a fetcher appropriate for the current build. Mirrors the init::prompt::auto factory.
filter_gguf
Filter to .gguf files only, sorted by path.
format_size
Render a byte count as a human-readable string (e.g. “1.4 GiB”).