mirror of
https://github.com/mudler/LocalAI.git
synced 2026-06-13 03:09:03 -04:00
The realtime WebRTC transport hardcoded loading the literal "opus" backend. On darwin/arm64 the only installable opus codec is "metal-opus" (it shares the gallery alias "opus"). Backend names resolve through the model loader's external-backends map, and the "opus" alias key is only registered when a user-path variant's alias was collected; a system-path metal-opus registers only under its concrete name. As a result, with metal-opus installed the realtime path still failed with "opus backend not available". Resolve the opus codec from the set of currently loadable backends instead of the hardcoded literal: an exact "opus" match wins (covers the plain backend and the alias key), otherwise fall back to a platform-appropriate "*opus*" codec, preferring the metal build on darwin/arm64. Behavior is unchanged when a plain "opus" backend is present, and the same error is surfaced when no opus codec is installed at all. The selection logic is extracted into resolveOpusBackend and unit-tested. Assisted-by: claude:claude-opus-4-8 [Claude Code] Signed-off-by: Ettore Di Giacinto <mudler@localai.io>