Skip to content

fix(stt): read Groq model from stt.groq.model config before env fallback - #58765

Closed
liuhao1024 wants to merge 1 commit into
NousResearch:mainfrom
liuhao1024:liuhao/cron-bugfix-58734-groq-stt-config-model
Closed

fix(stt): read Groq model from stt.groq.model config before env fallback#58765
liuhao1024 wants to merge 1 commit into
NousResearch:mainfrom
liuhao1024:liuhao/cron-bugfix-58734-groq-stt-config-model

Conversation

@liuhao1024

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes the Groq STT provider's model resolution to read from stt.groq.model in config.yaml before falling back to the STT_GROQ_MODEL env var / default. Every other STT provider (OpenAI, Mistral, ElevenLabs, local) already follows this pattern, but the Groq branch skipped the config lookup entirely.

Related Issue

Fixes #58734

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)

Changes Made

  • tools/transcription_tools.py — Add stt_config.get("groq", {}) lookup before DEFAULT_GROQ_STT_MODEL fallback, matching the pattern used by OpenAI/Mistral/ElevenLabs/local providers
  • tests/tools/test_transcription_tools.py — Add test_config_groq_model_used regression test verifying stt.groq.model is read from config

How to Test

  1. Run python -m pytest tests/tools/test_transcription_tools.py -k groq -xvs — all 24 Groq-related tests should pass
  2. Run python -m pytest tests/tools/test_transcription_tools.py -x — full suite (108 tests) should pass
  3. Verify the new test specifically: python -m pytest tests/tools/test_transcription_tools.py::TestTranscribeAudioDispatch::test_config_groq_model_used -xvs should pass
  4. Manual: set stt.groq.model: whisper-large-v3 in config.yaml (without setting STT_GROQ_MODEL env), trigger voice transcription, and confirm Groq uses whisper-large-v3 instead of the default whisper-large-v3-turbo

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: macOS 26.4.1

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A (this is a config resolution fix with no platform-specific behavior)
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

The Groq STT provider skipped the provider-namespaced config lookup
(stt.groq.model) that every other STT provider (OpenAI, Mistral,
ElevenLabs, local) uses. This forced users to set the STT_GROQ_MODEL
env var instead of using config.yaml like all other providers.

Add groq_cfg lookup matching the established pattern:
  model or groq_cfg.get('model', DEFAULT_GROQ_STT_MODEL)

Includes regression test test_config_groq_model_used.
@alt-glitch alt-glitch added type/bug Something isn't working tool/tts Text-to-speech and transcription area/config Config system, migrations, profiles P2 Medium — degraded but workaround exists labels Jul 5, 2026
@teknium1 teknium1 added sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels Jul 15, 2026

@teknium1 teknium1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the focused regression fix. The premise still holds on current main: tools/transcription_tools.py:1761-1763 bypasses stt.groq.model and falls straight back to DEFAULT_GROQ_STT_MODEL.

Problems

  • The new stt_config.get("groq", {}) can return None for valid YAML stt.groq: null, so the subsequent .get("model", ...) would raise. Current sibling branches use .get("<provider>") or {} after the null-subsection hardening in 3a394210.
  • This changes a user-facing configuration contract, but website/docs/user-guide/configuration.md:1627-1634 still describes Groq model overrides as environment-driven only.

Suggested changes

  • Use groq_cfg = stt_config.get("groq") or {} and cover a null subsection in the regression tests.
  • Document stt.groq.model and its precedence over STT_GROQ_MODEL.

Automated hermes-sweeper review.

@@ -1671,7 +1671,8 @@ def transcribe_audio(file_path: str, model: Optional[str] = None) -> Dict[str, A
return _transcribe_local_command(file_path, model_name)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stt.groq: null is valid YAML and makes this expression return None, so the next groq_cfg.get(...) raises AttributeError. Please match the null-safe sibling-provider pattern introduced in 3a394210: stt_config.get("groq") or {}, with a regression test for the null subsection.

@teknium1

Copy link
Copy Markdown
Contributor

Closing as superseded: this exact fix landed on main via a10bd49ddd (PR #73067) — Groq STT now resolves model or stt.groq.model (config) or DEFAULT_GROQ_STT_MODEL in transcription_tools.py.

Thanks @liuhao1024 — your patch identified the right resolution order; the merged change matches it.

@teknium1 teknium1 closed this Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/config Config system, migrations, profiles P2 Medium — degraded but workaround exists sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades tool/tts Text-to-speech and transcription type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Groq STT ignores provider-specific model in config.yaml

3 participants