Skip to content

Fix: live recording + whisper.cpp + Translate task → "File Not Found (/audio/translations)"#1555

Merged
raivisdejus merged 1 commit into
chidiwilliams:mainfrom
NumerousDragonfly:fix/local-whisper.cpp-404
Jul 17, 2026
Merged

Fix: live recording + whisper.cpp + Translate task → "File Not Found (/audio/translations)"#1555
raivisdejus merged 1 commit into
chidiwilliams:mainfrom
NumerousDragonfly:fix/local-whisper.cpp-404

Conversation

@NumerousDragonfly

@NumerousDragonfly NumerousDragonfly commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Fix: live recording + whisper.cpp + Translate task → "File Not Found (/audio/translations)"

Bug

Using live recording with the whisper.cpp backend, source language zh,
task Translate, fails immediately with:
Transcription (task=Transcribe) works fine on the same setup; only
Translate is broken.

Root cause

start_local_whisper_server() boots the bundled whisper-server with a
single hardcoded route:

"--inference-path", "/audio/transcriptions",

Meanwhile, _transcribe_via_api() picks between the OpenAI SDK's
.audio.transcriptions.create() and .audio.translations.create()
based on task. When task is Translate, the SDK POSTs to
/audio/translations — a route the local server never registers — so
the request 404s.

This affects every user running live recording + whisper.cpp + Translate,
not just a specific machine/config. File-based transcription (whisper_cpp.py,
which invokes whisper-cli directly with a --translate flag) is unaffected.

Fix

whisper.cpp's whisper-server supports its own --translate flag, which
makes its single endpoint return translated text instead of a same-language
transcript. Two small changes:

  1. start_local_whisper_server() passes --translate to the server
    subprocess when the selected task is Translate.
  2. _transcribe_via_api() always calls .audio.transcriptions.create()
    when the backend is the local whisper.cpp server, since that's the
    only route it exposes — regardless of task.

The OpenAI Whisper API backend (ModelType.OPEN_AI_WHISPER_API), which
genuinely exposes both /audio/transcriptions and /audio/translations
on the real OpenAI API, is unaffected — the transcribe/translate branch
there is preserved exactly as before.

Testing

  • Live recording, whisper.cpp backend, task=Transcribe, zh → unchanged, returns Chinese text
  • Live recording, whisper.cpp backend, task=Translate, zh → now returns English text, no 404
  • Live recording/API mode, OpenAI Whisper API backend, task=Transcribe → unchanged
  • Live recording/API mode, OpenAI Whisper API backend, task=Translate → unchanged
  • File-based transcription (whisper.cpp, Translate) → unaffected, still uses whisper-cli directly

Notes for reviewers

No new endpoints, no changes to file-based transcription, no changes to
faster-whisper/Hugging Face code paths. Scope is limited to the
live-recording + local-whisper.cpp-server code path.

Live recording with the whisper.cpp backend and task=Translate failed
with "File Not Found (/audio/translations)". The local whisper-server
process is only ever started with a single route,
--inference-path /audio/transcriptions, but _transcribe_via_api()
called the OpenAI client's .audio.translations.create(), which POSTs
to /audio/translations — a path the local server never exposes.

Fix:
- start_local_whisper_server() now passes --translate to the
  whisper-server subprocess when the selected task is Translate, so
  its single endpoint returns translated (English) text instead of
  a same-language transcript.
- _transcribe_via_api() now always calls .audio.transcriptions.create()
  when talking to the local whisper.cpp server, since that's the only
  route it exposes, regardless of task. Behavior for the OpenAI Whisper
  API backend (which does expose both /audio/transcriptions and
  /audio/translations) is unchanged.

File-based transcription (whisper_cpp.py, using whisper-cli directly)
was already unaffected by this bug and remains unchanged.
@raivisdejus
raivisdejus enabled auto-merge (squash) July 17, 2026 06:02
@raivisdejus

Copy link
Copy Markdown
Collaborator

@NumerousDragonfly Thanks for your contribution! Nice fix

@codecov

codecov Bot commented Jul 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 82.95%. Comparing base (191795b) to head (1fccefe).

Files with missing lines Patch % Lines
buzz/transcriber/recording_transcriber.py 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1555      +/-   ##
==========================================
- Coverage   82.98%   82.95%   -0.03%     
==========================================
  Files         108      108              
  Lines       11693    11697       +4     
==========================================
  Hits         9703     9703              
- Misses       1990     1994       +4     
Flag Coverage Δ
Linux 81.71% <75.00%> (-0.02%) ⬇️
macOS 82.46% <75.00%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@raivisdejus
raivisdejus merged commit a029f77 into chidiwilliams:main Jul 17, 2026
15 of 19 checks passed
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.

2 participants