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.
Python agent-orchestrationai-agentai-coding-assistantclaude-codecoding-agentcomputer-usedesktop-applocal-firstmcppersonal-jarvisvoice-assistantvoice-coding
fix(hardware): recommend a multilingual Whisper model, never English-only
Ruben Lütke691ec4ef4c79
diff --git a/jarvis/hardware/detection.py b/jarvis/hardware/detection.pyindex 630398db2d..32198581f9 100644--- a/jarvis/hardware/detection.py+++ b/jarvis/hardware/detection.py@@ -57,7 +57,7 @@ class HardwareReport:class WhisperRecommendation:"""Recommended Whisper configuration based on detected hardware."""provider: str # "faster-whisper" | "openai-api"- model: str # tiny | base | small | distil-small | distil-large-v3 | large-v3+ model: str # tiny | base | small | large-v3-turbo | large-v3device: str # cuda | cpucompute_type: str # int8_float16 | fp16 | int8expected_latency_ms: int@@ -232,11 +232,14 @@ def recommend_whisper(report: HardwareReport) -> WhisperRecommendation:"""Maps a HardwareReport to the recommended Whisper configuration.Heuristic:- - NVIDIA GPU with >= 8 GB VRAM → distil-large-v3 (multilingual, fast)- - NVIDIA GPU with 4-8 GB VRAM → distil-small or small- - NVIDIA GPU with < 4 GB VRAM → tiny/base CPU or OpenAI API+ - NVIDIA GPU with >= 4 GB VRAM → large-v3-turbo (fast, MULTILINGUAL)+ - NVIDIA GPU with < 4 GB VRAM → base (multilingual)- No CUDA but plenty of RAM → CPU faster-whisper tiny/base- Otherwise → OpenAI Whisper API++ Never recommends a Distil-Whisper model: all distil-* checkpoints are+ English-only and mangle German/Spanish (the runtime force-upgrades them to+ large-v3-turbo anyway)."""if not report.has_nvidia_gpu or not report.torch_cuda_available:if report.ram_total_mb >= 8192:@@ -265,29 +268,24 @@ def recommend_whisper(report: HardwareReport) -> WhisperRecommendation:)vram = report.total_vram_mb- if vram >= 8000:- return WhisperRecommendation(- provider="faster-whisper",- model="distil-large-v3",- device="cuda",- compute_type="int8_float16",- expected_latency_ms=250,- rationale=(- f"NVIDIA GPU with {vram} MB VRAM — runs distil-large-v3 (multilingual DE+EN) "- f"at ~250ms latency. Optimal for local privacy + low latency."- ),- )if vram >= 4000:+ # large-v3-turbo, NOT a Distil model: every distil-* checkpoint is+ # English-only (there is no multilingual distil) and mangles German/+ # Spanish into English words — the runtime already force-upgrades them to+ # large-v3-turbo (jarvis/plugins/stt/fwhisper.py::_ENGLISH_ONLY_MODELS),+ # so recommending distil here only persists a confusing, self-overridden+ # value into jarvis.toml. large-v3-turbo is the fast MULTILINGUAL+ # checkpoint (~1.5 GB, fits from 4 GB VRAM up).return WhisperRecommendation(provider="faster-whisper",- model="distil-small",+ model="large-v3-turbo",device="cuda",compute_type="int8_float16",- expected_latency_ms=200,+ expected_latency_ms=250,rationale=(- f"NVIDIA GPU with {vram} MB VRAM — distil-small recommended "- f"(~200ms latency, 97% quality). Switchable to distil-large-v3 later "- f"for higher precision once VRAM frees up."+ f"NVIDIA GPU with {vram} MB VRAM — runs large-v3-turbo (fast, "+ f"MULTILINGUAL incl. DE/EN/ES, ~1.5 GB) at ~250ms latency. Optimal "+ f"for local privacy + low latency."),)return WhisperRecommendation(@@ -297,8 +295,8 @@ def recommend_whisper(report: HardwareReport) -> WhisperRecommendation:compute_type="int8_float16",expected_latency_ms=180,rationale=(- f"NVIDIA GPU with only {vram} MB VRAM — 'base' model fits. "- f"Quality is sufficient for German/English, latency ~180ms."+ f"NVIDIA GPU with only {vram} MB VRAM — 'base' (multilingual) model "+ f"fits. Quality is sufficient for German/English, latency ~180ms."),)diff --git a/tests/unit/hardware/test_whisper_recommendation.py b/tests/unit/hardware/test_whisper_recommendation.pynew file mode 100644index 0000000000..fd5a37a337--- /dev/null+++ b/tests/unit/hardware/test_whisper_recommendation.py@@ -0,0 +1,48 @@+"""recommend_whisper must never recommend an English-only Whisper model.++Regression guard for the "German is mangled on a GPU box" first-run bug: the+wizard used to recommend distil-large-v3 / distil-small for NVIDIA GPUs. Every+Distil-Whisper checkpoint is English-only (there is no multilingual distil) and+turns German/Spanish into English words. The runtime already force-upgrades such+models to large-v3-turbo, so recommending them only persisted a confusing,+self-overridden value into jarvis.toml. The recommender must stay aligned with+that runtime guard and hand out a multilingual model directly.+"""+from __future__ import annotations++from types import SimpleNamespace++import pytest++from jarvis.hardware.detection import recommend_whisper+from jarvis.plugins.stt.fwhisper import _ENGLISH_ONLY_MODELS+++def _gpu_report(vram_mb: int) -> SimpleNamespace:+ return SimpleNamespace(+ has_nvidia_gpu=True,+ torch_cuda_available=True,+ total_vram_mb=vram_mb,+ )++[email protected]("vram", [2000, 4000, 6000, 8000, 16000, 24000])+def test_gpu_recommendation_is_never_english_only(vram: int) -> None:+ rec = recommend_whisper(_gpu_report(vram))+ assert rec.model not in _ENGLISH_ONLY_MODELS, rec.model+ assert not rec.model.startswith("distil-"), (+ f"recommended {rec.model!r}: every distil-* model is English-only and "+ f"mangles German/Spanish."+ )++[email protected]("vram", [4000, 8000, 16000, 24000])+def test_capable_gpu_recommends_multilingual_turbo(vram: int) -> None:+ rec = recommend_whisper(_gpu_report(vram))+ assert rec.model == "large-v3-turbo"+ assert rec.device == "cuda"+++def test_low_vram_gpu_recommends_base_multilingual() -> None:+ rec = recommend_whisper(_gpu_report(2000))+ assert rec.model == "base"