Skip to main content

Crate voxora_config

Crate voxora_config 

Source
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:

  1. An explicit value on the config itself: either set by the caller (CacheConfig::root, HfConfig::token, …) or loaded from a TOML file via VoxoraConfig::from_file.
  2. The matching VOXORA_* environment variable, listed in env (plus the HF_TOKEN / HUGGING_FACE_HUB_TOKEN aliases for the token).
  3. 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§

CacheConfig
Where voxora keeps downloaded models on disk.
HfConfig
How voxora talks to the Hugging Face Hub.
VoxoraConfig
Top-level voxora configuration.

Enums§

ConfigError
All errors that may occur while loading a voxora configuration.