Skip to content

feat(config): unify STT provider under [[llm.providers]] with stt_model field#2179

Merged
bug-ops merged 1 commit intomainfrom
feat-config-unify-stt-provider
Mar 26, 2026
Merged

feat(config): unify STT provider under [[llm.providers]] with stt_model field#2179
bug-ops merged 1 commit intomainfrom
feat-config-unify-stt-provider

Conversation

@bug-ops
Copy link
Copy Markdown
Owner

@bug-ops bug-ops commented Mar 26, 2026

Closes #2175

Summary

  • Add stt_model: Option<String> to ProviderEntry, following the existing embedding_model/vision_model flat-union pattern
  • Slim SttConfig: remove model and base_url (moved to provider entry); keep provider (name ref) and language
  • Add stt_provider_entry() and validate_stt() resolution helpers on LlmConfig
  • Replace string-based candle detection with type-safe ProviderKind::Candle + stt_model check
  • Add migrate_stt_to_provider() as step 1 of the --migrate-config pipeline
  • Remove deprecated env vars ZEPH_STT_MODEL and ZEPH_STT_BASE_URL
  • Add MigrateError::InvalidStructure for proper error propagation (replaces .expect() panics)
  • 22 new unit tests across providers.rs and migrate.rs

Breaking Change

Configs with [llm.stt] model = ... or [llm.stt] base_url = ... must be migrated:

cargo run --features full -- --migrate-config path/to/config.toml

Config before/after

Before:

[llm.stt]
model = "gpt-4o-mini-transcribe"
base_url = "https://api.openai.com/v1"
provider = "openai"
language = "auto"

After:

[[llm.providers]]
name = "whisper"
type = "openai"
model = "gpt-4o-mini-transcribe"
stt_model = "gpt-4o-mini-transcribe"

[llm.stt]
provider = "whisper"
language = "auto"

Test plan

  • cargo +nightly fmt --check — clean
  • cargo clippy --profile ci --workspace --features full -- -D warnings — 0 warnings
  • cargo nextest run --workspace --features full --lib --bins — 6488 passed (+32 vs base)
  • Security audit: no secrets leaked in logs or migration output
  • Adversarial implementation review: all 6 pre-implementation warnings addressed

…el field

Move STT model/endpoint configuration from [llm.stt] into [[llm.providers]]
entries via a new `stt_model` field, following the same flat-union pattern
as `embedding_model` and `vision_model`.

[llm.stt] is kept for STT-specific options (provider reference, language,
VAD settings) but no longer holds model or base_url.

- Add `stt_model: Option<String>` to `ProviderEntry`
- Slim `SttConfig`: remove `model` and `base_url` fields
- Add `stt_provider_entry()` and `validate_stt()` on `LlmConfig`
- Replace string-based candle detection with `ProviderKind::Candle` + stt_model
- Add `migrate_stt_to_provider()` to `--migrate-config` pipeline (step 1)
- Remove deprecated env vars ZEPH_STT_MODEL and ZEPH_STT_BASE_URL
- Add MigrateError::InvalidStructure for robust error handling
- 22 new unit tests (providers + migrate)

BREAKING CHANGE: configs with [llm.stt] model/base_url must be migrated.
Run: cargo run --features full -- --migrate-config path/to/config.toml

Closes #2175
@github-actions github-actions bot added enhancement New feature or request documentation Improvements or additions to documentation rust Rust code changes core zeph-core crate config Configuration file changes size/XL Extra large PR (500+ lines) and removed enhancement New feature or request labels Mar 26, 2026
@bug-ops bug-ops enabled auto-merge (squash) March 26, 2026 16:43
@bug-ops bug-ops merged commit 93305bc into main Mar 26, 2026
25 checks passed
@bug-ops bug-ops deleted the feat-config-unify-stt-provider branch March 26, 2026 16:50
@bug-ops bug-ops restored the feat-config-unify-stt-provider branch March 26, 2026 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

config Configuration file changes core zeph-core crate documentation Improvements or additions to documentation rust Rust code changes size/XL Extra large PR (500+ lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(config): unify STT provider under [[llm.providers]] with role/capability field

1 participant