Skip to content

fix(stt): map cloud-only model names to valid local size for faster-whisper#2545

Closed
Mibayy wants to merge 1 commit into
NousResearch:mainfrom
Mibayy:fix/stt-local-model-name-validation
Closed

fix(stt): map cloud-only model names to valid local size for faster-whisper#2545
Mibayy wants to merge 1 commit into
NousResearch:mainfrom
Mibayy:fix/stt-local-model-name-validation

Conversation

@Mibayy

@Mibayy Mibayy commented Mar 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #2544.

When stt.provider is local but the resolved model name is a cloud-only
string like whisper-1, faster-whisper crashes with:

Invalid model size 'whisper-1', expected one of: tiny, base, small, medium, large...

The voice message is then silently dropped with no user-facing feedback.

Root cause

transcribe_audio() already had _normalize_local_command_model() for the
local_command path (line 530), but the local (faster-whisper) path at
line 525 passed the model name through without any validation.

Changes

  • Renamed _normalize_local_command_model_normalize_local_model (shared
    helper); kept the old name as a thin wrapper for backwards compat.
  • _normalize_local_model now emits a WARNING when it remaps a cloud-only
    name, telling the user exactly how to fix their config.
  • Applied _normalize_local_model() to the local provider path in
    transcribe_audio().
  • Added 6 new tests in TestNormalizeLocalModel, including an end-to-end test
    that verifies WhisperModel is never called with 'whisper-1'.

Test

26 passed, 16 warnings

…hisper

When stt.provider is 'local' but stt.model (or stt.local.model) is set
to a cloud-only name like 'whisper-1', faster-whisper would crash with:
  Invalid model size 'whisper-1', expected one of: tiny, base, small...

The local provider path in transcribe_audio() now calls
_normalize_local_model() (shared with the local_command path) which:
- maps OPENAI_MODELS / GROQ_MODELS names to DEFAULT_LOCAL_MODEL ('base')
- emits a clear WARNING so the user knows what happened and how to fix it
- passes all valid faster-whisper size names through unchanged

Fixes NousResearch#2544
teknium1 pushed a commit that referenced this pull request Apr 20, 2026
…hisper (#2544)

Cherry-picked from PR #2545 by @Mibayy.

The setup wizard could leave stt.model: "whisper-1" in config.yaml.
When using the local faster-whisper provider, this crashed with
"Invalid model size 'whisper-1'". Voice messages were silently ignored.

_normalize_local_model() now detects cloud-only names (whisper-1,
gpt-4o-transcribe, etc.) and maps them to the default local model
with a warning. Valid local sizes (tiny, base, small, medium, large-v3)
pass through unchanged.

- Renamed _normalize_local_command_model -> _normalize_local_model
  (backward-compat wrapper preserved)
- 6 new tests including integration test
- Added lowercase AUTHOR_MAP alias for @Mibayy

Closes #2544
teknium1 pushed a commit that referenced this pull request Apr 20, 2026
…hisper (#2544)

Cherry-picked from PR #2545 by @Mibayy.

The setup wizard could leave stt.model: "whisper-1" in config.yaml.
When using the local faster-whisper provider, this crashed with
"Invalid model size 'whisper-1'". Voice messages were silently ignored.

_normalize_local_model() now detects cloud-only names (whisper-1,
gpt-4o-transcribe, etc.) and maps them to the default local model
with a warning. Valid local sizes (tiny, base, small, medium, large-v3)
pass through unchanged.

- Renamed _normalize_local_command_model -> _normalize_local_model
  (backward-compat wrapper preserved)
- 6 new tests including integration test
- Added lowercase AUTHOR_MAP alias for @Mibayy

Closes #2544
@teknium1

Copy link
Copy Markdown
Contributor

Merged via PR #13016 #13016 — your commit was cherry-picked onto current main with your authorship preserved. Best fix of the three submissions — thorough tests and clean scope. Thanks @Mibayy!

@teknium1 teknium1 closed this Apr 20, 2026
ulasbilgen pushed a commit to ulasbilgen/hermes-adhd-agent that referenced this pull request May 1, 2026
…hisper (NousResearch#2544)

Cherry-picked from PR NousResearch#2545 by @Mibayy.

The setup wizard could leave stt.model: "whisper-1" in config.yaml.
When using the local faster-whisper provider, this crashed with
"Invalid model size 'whisper-1'". Voice messages were silently ignored.

_normalize_local_model() now detects cloud-only names (whisper-1,
gpt-4o-transcribe, etc.) and maps them to the default local model
with a warning. Valid local sizes (tiny, base, small, medium, large-v3)
pass through unchanged.

- Renamed _normalize_local_command_model -> _normalize_local_model
  (backward-compat wrapper preserved)
- 6 new tests including integration test
- Added lowercase AUTHOR_MAP alias for @Mibayy

Closes NousResearch#2544
aj-nt pushed a commit to aj-nt/hermes-agent that referenced this pull request May 1, 2026
…hisper (NousResearch#2544)

Cherry-picked from PR NousResearch#2545 by @Mibayy.

The setup wizard could leave stt.model: "whisper-1" in config.yaml.
When using the local faster-whisper provider, this crashed with
"Invalid model size 'whisper-1'". Voice messages were silently ignored.

_normalize_local_model() now detects cloud-only names (whisper-1,
gpt-4o-transcribe, etc.) and maps them to the default local model
with a warning. Valid local sizes (tiny, base, small, medium, large-v3)
pass through unchanged.

- Renamed _normalize_local_command_model -> _normalize_local_model
  (backward-compat wrapper preserved)
- 6 new tests including integration test
- Added lowercase AUTHOR_MAP alias for @Mibayy

Closes NousResearch#2544
Luminet2023 pushed a commit to Luminet2023/hermes-agent that referenced this pull request May 1, 2026
…hisper (NousResearch#2544)

Cherry-picked from PR NousResearch#2545 by @Mibayy.

The setup wizard could leave stt.model: "whisper-1" in config.yaml.
When using the local faster-whisper provider, this crashed with
"Invalid model size 'whisper-1'". Voice messages were silently ignored.

_normalize_local_model() now detects cloud-only names (whisper-1,
gpt-4o-transcribe, etc.) and maps them to the default local model
with a warning. Valid local sizes (tiny, base, small, medium, large-v3)
pass through unchanged.

- Renamed _normalize_local_command_model -> _normalize_local_model
  (backward-compat wrapper preserved)
- 6 new tests including integration test
- Added lowercase AUTHOR_MAP alias for @Mibayy

Closes NousResearch#2544
02356abc pushed a commit to 02356abc/hermes-agent that referenced this pull request May 14, 2026
…hisper (NousResearch#2544)

Cherry-picked from PR NousResearch#2545 by @Mibayy.

The setup wizard could leave stt.model: "whisper-1" in config.yaml.
When using the local faster-whisper provider, this crashed with
"Invalid model size 'whisper-1'". Voice messages were silently ignored.

_normalize_local_model() now detects cloud-only names (whisper-1,
gpt-4o-transcribe, etc.) and maps them to the default local model
with a warning. Valid local sizes (tiny, base, small, medium, large-v3)
pass through unchanged.

- Renamed _normalize_local_command_model -> _normalize_local_model
  (backward-compat wrapper preserved)
- 6 new tests including integration test
- Added lowercase AUTHOR_MAP alias for @Mibayy

Closes NousResearch#2544
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 2026
…hisper (NousResearch#2544)

Cherry-picked from PR NousResearch#2545 by @Mibayy.

The setup wizard could leave stt.model: "whisper-1" in config.yaml.
When using the local faster-whisper provider, this crashed with
"Invalid model size 'whisper-1'". Voice messages were silently ignored.

_normalize_local_model() now detects cloud-only names (whisper-1,
gpt-4o-transcribe, etc.) and maps them to the default local model
with a warning. Valid local sizes (tiny, base, small, medium, large-v3)
pass through unchanged.

- Renamed _normalize_local_command_model -> _normalize_local_model
  (backward-compat wrapper preserved)
- 6 new tests including integration test
- Added lowercase AUTHOR_MAP alias for @Mibayy

Closes NousResearch#2544
Egavasyug pushed a commit to Egavasyug/hermes-agent that referenced this pull request Jun 10, 2026
…hisper (NousResearch#2544)

Cherry-picked from PR NousResearch#2545 by @Mibayy.

The setup wizard could leave stt.model: "whisper-1" in config.yaml.
When using the local faster-whisper provider, this crashed with
"Invalid model size 'whisper-1'". Voice messages were silently ignored.

_normalize_local_model() now detects cloud-only names (whisper-1,
gpt-4o-transcribe, etc.) and maps them to the default local model
with a warning. Valid local sizes (tiny, base, small, medium, large-v3)
pass through unchanged.

- Renamed _normalize_local_command_model -> _normalize_local_model
  (backward-compat wrapper preserved)
- 6 new tests including integration test
- Added lowercase AUTHOR_MAP alias for @Mibayy

Closes NousResearch#2544
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Local STT provider crashes when config contains OpenAI model name ("whisper-1")

2 participants