Expand description
Single source of truth for every voxora runtime setting.
Replaces the ad-hoc cascade currently duplicated across
voxora-cli/src/args.rs::resolve_hf_cache_dir and
voxora-hf/src/cache.rs::default_cache_root.
Settings come from three layers — built-in defaults, an optional TOML file, and the environment — and every getter resolves them in the same order, first non-empty wins:
- An explicit value on the config itself: either set by the
caller (
CacheConfig::root,HfConfig::token, …) or loaded from a TOML file viaVoxoraConfig::from_file. - The matching
VOXORA_*environment variable, listed inenv(plus theHF_TOKEN/HUGGING_FACE_HUB_TOKENaliases for the token). - The built-in default (
VoxoraConfig::default).
ASR-specific: this crate only models configuration concerns that exist in the voxora speech-recognition stack (cache dir, HF token, HF base URL, default revision). It does not model LLM / vision / multimodal configuration.
§Example
use voxora_config::VoxoraConfig;
let cfg = VoxoraConfig::from_file(std::path::Path::new("voxora.toml"))?;
println!("cache root: {}", cfg.cache_root().display());
println!("hub: {}", cfg.hf_base_url());Modules§
- env
- Centralised list of
VOXORA_*environment variables. - file
- Optional TOML file loader for voxora-config.
Structs§
- Cache
Config - Where voxora keeps downloaded models on disk.
- HfConfig
- How voxora talks to the Hugging Face Hub.
- Voxora
Config - Top-level voxora configuration.
Enums§
- Config
Error - All errors that may occur while loading a voxora configuration.