fix(gallery): make opus a meta backend for platform auto-selection (#9813)#10291
Merged
Conversation
e1c0646 to
03dbf96
Compare
…o-selected (#9813) The realtime/WebRTC path loads the "opus" codec backend by name, but on macOS arm64 only "metal-opus" is installable, so Load("opus") failed with "opus backend not available". The root cause: unlike llama-cpp and whisper, the opus entry was a concrete CPU backend (it carried a uri and no capabilities map) rather than a meta backend, so nothing mapped "opus" to the platform-appropriate variant. Restructure opus to mirror llama-cpp/whisper: "opus" becomes a meta backend with a capabilities map (default -> cpu-opus, metal -> metal-opus) and no uri; the CPU image moves to a new "cpu-opus" concrete (and its dev variant to "cpu-opus-development"). Installing "opus" now resolves to metal-opus on Apple Silicon and cpu-opus elsewhere, and Load("opus") works on every platform via the meta pointer - so the realtime endpoint needs no special casing. This reverts the realtime_webrtc.go resolution helper from the earlier approach in favor of the gallery-level fix. Assisted-by: claude:claude-opus-4-8 [Claude Code] Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
03dbf96 to
fc26352
Compare
Collaborator
Author
|
Registry verification: confirmed all four opus image tags are published on quay.io/go-skynet/local-ai-backends - |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #9813
Root cause (revised)
The realtime/WebRTC path loads the opus codec by name (
Load("opus")). On macOS arm64 onlymetal-opusis installable, so the load failed with "opus backend not available".The real problem is at the gallery layer: unlike
llama-cppandwhisper, theopusentry was a concrete CPU backend - it carried auriand nocapabilities:map - rather than a meta backend. So nothing mappedopusto the platform-appropriate variant (metal-opuson Apple Silicon), the wayllama-cppresolves tometal-llama-cpp.Fix
Restructure
opusto mirrorllama-cpp/whisper:opusbecomes a meta backend:capabilities: {default: cpu-opus, metal: metal-opus}, nouri.cpu-opus(andopus-development->cpu-opus-development).metal-opus/metal-opus-developmentare unchanged.Installing
opusnow resolves viaFindBestBackendFromMetatometal-opuson Apple Silicon andcpu-opuselsewhere, writes a meta pointer namedopus, andLoad("opus")works on every platform. The realtime endpoint needs no special-casing - so this reverts therealtime_webrtc.goresolution helper from the first version of this PR in favor of the gallery-level fix. (Thanks @mudler for pointing at the meta/capabilities mechanism.)Verification
backend/index.yamlparses; both capability targets (cpu-opus,metal-opus) exist as concretes with uris;opushas no uri (so it is correctly a meta backend).go test ./core/gallery/...green.Capability()falls backdefault->cpu, so non-metal platforms (incl. Jetson/L4T, Vulkan, ROCm, etc.) correctly getcpu-opus.Net diff is now a small
backend/index.yamlchange.