Replace the broken sed-based entrypoint from 4.8.2 with a runtime Python
patch script for Onyx 5.0.3 voice module compatibility.
Background
----------
Onyx 5.0.3 refactored the voice subsystem to use raw aiohttp instead of
the OpenAI Python SDK. The old /v1 suffix in our LocalAI base URL now
causes a double-prefix (https://.../v1/v1/audio/...) and 404s.
Additionally, line numbers and constants shifted, making the previous
sed patches fail silently.
Changes
-------
* api_server: override CMD with a startup sequence that runs
patch_voice.py before uvicorn.
* Add backend/scripts/patch_voice.py that patches:
- factory.py: fallback api_base, stt_model and api_key when no
voice provider is configured in the Onyx admin UI.
- providers/openai.py: DEFAULT_OPENAI_API_BASE (without /v1),
realtime model constants, and optional chunked-STT language
injection (WHISPER_LANGUAGE=de).
* Mount patch script read-only into /app/scripts/.
* Env: WHISPER_API_BASE now points to the origin only
(https://aido-whisper-ch.livtec.cloud), leaving /v1 path assembly
to Onyx code.
* Env: WHISPER_MODEL=whisper-1, WHISPER_LANGUAGE=de.
Migration
---------
The previous entrypoint sed block is removed. No admin UI voice
provider configuration is required; the patch is fully transparent.
Refs: aido-whisper-ch deployment, Onyx 5.0.3 upgrade