Skip to content

Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.

fix(stt): demote unreliable Groq fallback

Ruben Lütkea4a486530f65
diff --git a/jarvis/plugins/stt/__init__.py b/jarvis/plugins/stt/__init__.py
index d785de357a..c36e976d46 100644
--- a/jarvis/plugins/stt/__init__.py
+++ b/jarvis/plugins/stt/__init__.py
@@ -45,18 +45,17 @@ _STT_SECRET_CANDIDATES: dict[str, tuple[tuple[str, str], ...]] = {
),
}
-# Cross-family probe order when the configured cloud STT has no usable key: the
-# family the maintainer ships first, then the common BYO-key alternatives. Only a
-# family that BOTH has a key AND is registered as a `jarvis.stt` entry-point is
-# ever chosen (a keyed-but-unregistered name is skipped, so we never promise an
-# STT we cannot build). Every entry here now HAS a plugin (groq-api, openrouter-
-# stt, openai-api, gemini-api); the dead `deepgram*` names were removed so the
-# resolver can never cross to a non-existent provider. This mirrors the TTS
-# factory's `_TTS_CROSS_FAMILY_ORDER`; it is what lets a fresh downloader whose
-# only key is (say) an OpenAI or Gemini key get working voice input instead of
-# dead-ending on local faster-whisper the base install never shipped.
+# Cross-family probe order when the configured cloud STT has no usable key.
+# OpenRouter leads because its shared Brain key commonly needs no second setup;
+# OpenAI and Gemini follow, while Groq is deliberately the LAST cloud option.
+# Live German dictation showed materially worse transcription quality on Groq,
+# so availability must not make it the preferred takeover. Only a family that
+# BOTH has a key AND is registered as a `jarvis.stt` entry-point is ever chosen
+# (a keyed-but-unregistered name is skipped, so we never promise an STT we cannot
+# build). The key-free local engine remains the final floor below every cloud
+# family when it is installed.
_STT_CROSS_FAMILY_ORDER: tuple[str, ...] = (
- "groq-api", "openrouter-stt", "openai-api", "gemini-api",
+ "openrouter-stt", "openai-api", "gemini-api", "groq-api",
)
# Constructor kwargs the factory offers but no provider is required to accept.
diff --git a/jarvis/ui/web/provider_spec.py b/jarvis/ui/web/provider_spec.py
index 89f6c52ef0..1d4fc4ff3f 100644
--- a/jarvis/ui/web/provider_spec.py
+++ b/jarvis/ui/web/provider_spec.py
@@ -643,18 +643,6 @@ PROVIDERS: tuple[ProviderSpec, ...] = (
),
),
# ── STT ───────────────────────────────────────────────────────────────
- ProviderSpec(
- id="groq-api",
- label="Groq STT (Whisper)",
- tier="stt",
- auth_mode="api_key",
- secret_keys=("groq_api_key",),
- dashboard_url="https://console.groq.com/keys",
- credential_help=(
- "Groq API key (starts with gsk_). Fast hosted Whisper "
- "speech-to-text, billed per token."
- ),
- ),
ProviderSpec(
id="openai-api",
label="OpenAI Whisper STT",
@@ -723,6 +711,26 @@ PROVIDERS: tuple[ProviderSpec, ...] = (
"highest accuracy and have the hardware for it."
),
),
+ # Deliberately last in the Voice Input picker and last among cloud runtime
+ # fallbacks. It remains available for users who only have a Groq key, but
+ # live German dictation has been substantially less reliable than the other
+ # hosted choices and must not be presented as a preferred takeover.
+ ProviderSpec(
+ id="groq-api",
+ label="Groq STT (Whisper)",
+ tier="stt",
+ auth_mode="api_key",
+ secret_keys=("groq_api_key",),
+ dashboard_url="https://console.groq.com/keys",
+ credential_help=(
+ "Groq API key (starts with gsk_). Fast hosted Whisper "
+ "speech-to-text, billed per token."
+ ),
+ caution=(
+ "Not recommended for primary transcription: real-world dictation "
+ "quality has been less reliable than the other hosted choices."
+ ),
+ ),
# ── Dictation polish ──────────────────────────────────────────────────
# Derived from POLISH_FAMILIES above, in that tuple's order (Groq first —
# it is the recommended pick because its key is usually already there).
diff --git a/tests/unit/speech/test_stt_fallback.py b/tests/unit/speech/test_stt_fallback.py
index c091e6068b..b866f6f910 100644
--- a/tests/unit/speech/test_stt_fallback.py
+++ b/tests/unit/speech/test_stt_fallback.py
@@ -11,6 +11,7 @@ from __future__ import annotations
import pytest
from jarvis.core.protocols import Transcript
+from jarvis.plugins.stt import _STT_CROSS_FAMILY_ORDER
from jarvis.speech.stt_fallback import (
FallbackSTT,
alternate_provider_names,
@@ -182,6 +183,21 @@ def test_local_whisper_is_the_floor_not_the_first_choice():
assert "groq-api" not in order # never falls back to the one that just failed
+def test_groq_is_the_last_cloud_fallback():
+ """Poor dictation quality keeps Groq available, but never preferred."""
+ assert _STT_CROSS_FAMILY_ORDER == (
+ "openrouter-stt",
+ "openai-api",
+ "gemini-api",
+ "groq-api",
+ )
+
+ order = alternate_provider_names(
+ "openrouter-stt", [*_STT_CROSS_FAMILY_ORDER, "faster-whisper"]
+ )
+ assert order == ["openai-api", "gemini-api", "groq-api", "faster-whisper"]
+
+
def test_a_single_key_install_is_not_wrapped():
"""Nothing to fall back to — no wrapper, no cost."""
diff --git a/tests/unit/test_provider_spec.py b/tests/unit/test_provider_spec.py
index 7cf0c927be..8d608fe6f9 100644
--- a/tests/unit/test_provider_spec.py
+++ b/tests/unit/test_provider_spec.py
@@ -88,6 +88,14 @@ def test_get_spec_lookup() -> None:
assert get_spec("does-not-exist") is None
+def test_groq_stt_is_last_and_not_recommended() -> None:
+ """Groq remains selectable, but the Voice Input UI must de-emphasize it."""
+ stt_specs = [spec for spec in PROVIDERS if spec.tier == "stt"]
+ assert stt_specs[-1].id == "groq-api"
+ assert stt_specs[-1].recommended is False
+ assert stt_specs[-1].caution
+
+
def test_all_secret_keys_collects_unique_set() -> None:
keys = all_secret_keys()
assert "anthropic_api_key" in keys