Files
Lumotia/crates/core/src/constants.rs
jars 7eb69e6251 refactor(core): remove old inference_thread_count facade
The MIN_INFERENCE_THREADS, MAX_INFERENCE_THREADS, and
inference_thread_count() defined in constants.rs were superseded by
the equivalents in tuning.rs (Task 2.1) and are no longer called by
any production code. Both call sites (whisper backend Task 4.1, LLM
generate Task 5.1) have migrated.

Constants.rs now holds only audio/mel/RAM/VAD/download constants;
inference-tuning concerns live in tuning.rs.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-09 12:41:23 +01:00

39 lines
1.3 KiB
Rust

/// Audio pipeline constants.
pub const WHISPER_SAMPLE_RATE: u32 = 16_000;
pub const WHISPER_CHANNELS: u16 = 1;
/// Parakeet mel spectrogram constants.
pub const PARAKEET_N_FFT: usize = 512;
pub const PARAKEET_HOP_LENGTH: usize = 160;
pub const PARAKEET_WIN_LENGTH: usize = 400;
pub const PARAKEET_N_MELS: usize = 80;
pub const PARAKEET_PRE_EMPHASIS: f32 = 0.97;
pub const PARAKEET_BLANK_TOKEN: usize = 1024;
pub const PARAKEET_LOG_GUARD: f32 = 5.960_464_5e-8; // 2^-24
/// Chunk timing for live transcription.
pub const CHUNK_INTERVAL_MS: u64 = 3000;
pub const MIN_CHUNK_SAMPLES: usize = 8000;
/// Post-processing thresholds.
pub const SMART_PARAGRAPH_GAP_SECS: f64 = 2.0;
/// History limits.
pub const HISTORY_MAX_ENTRIES: usize = 100;
/// RAM thresholds for model recommendations (in GB).
pub const RAM_MINIMUM_FOR_LOCAL_STT: f64 = 2.0;
pub const RAM_THRESHOLD_LIGHTWEIGHT: f64 = 4.0;
pub const RAM_THRESHOLD_STANDARD: f64 = 8.0;
pub const RAM_THRESHOLD_COMFORTABLE: f64 = 16.0;
/// VAD configuration defaults.
pub const VAD_SPEECH_THRESHOLD: f64 = 0.5;
pub const VAD_MIN_SPEECH_DURATION_MS: u32 = 250;
pub const VAD_MAX_SPEECH_DURATION_S: u32 = 30;
pub const VAD_MIN_SILENCE_DURATION_MS: u32 = 300;
pub const VAD_SPEECH_PAD_MS: u32 = 100;
/// Model download chunk size for progress reporting.
pub const DOWNLOAD_CHUNK_BYTES: usize = 65_536;