Skip to content

fix(gallery): make opus a meta backend for platform auto-selection (#9813)#10291

Merged
mudler merged 1 commit into
masterfrom
fix/9813-opus-darwin-alias
Jun 13, 2026
Merged

fix(gallery): make opus a meta backend for platform auto-selection (#9813)#10291
mudler merged 1 commit into
masterfrom
fix/9813-opus-darwin-alias

Conversation

@localai-bot

@localai-bot localai-bot commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

Closes #9813

Root cause (revised)

The realtime/WebRTC path loads the opus codec by name (Load("opus")). On macOS arm64 only metal-opus is installable, so the load failed with "opus backend not available".

The real problem is at the gallery layer: 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 (metal-opus on Apple Silicon), the way llama-cpp resolves to metal-llama-cpp.

Fix

Restructure opus to mirror llama-cpp/whisper:

  • opus becomes a meta backend: capabilities: {default: cpu-opus, metal: metal-opus}, no uri.
  • The CPU image moves to a new concrete cpu-opus (and opus-development -> cpu-opus-development).
  • metal-opus / metal-opus-development are unchanged.

Installing opus now resolves via FindBestBackendFromMeta to metal-opus on Apple Silicon and cpu-opus elsewhere, writes a meta pointer named opus, and Load("opus") works on every platform. The realtime endpoint needs no special-casing - so this reverts the realtime_webrtc.go resolution 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.yaml parses; both capability targets (cpu-opus, metal-opus) exist as concretes with uris; opus has no uri (so it is correctly a meta backend).
  • go test ./core/gallery/... green.
  • Capability() falls back default -> cpu, so non-metal platforms (incl. Jetson/L4T, Vulkan, ROCm, etc.) correctly get cpu-opus.

Net diff is now a small backend/index.yaml change.

@mudler mudler force-pushed the fix/9813-opus-darwin-alias branch from e1c0646 to 03dbf96 Compare June 13, 2026 07:27
@localai-bot localai-bot changed the title fix(realtime): resolve platform opus codec backend instead of hardcoding "opus" (#9813) fix(gallery): make opus a meta backend for platform auto-selection (#9813) Jun 13, 2026
…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>
@mudler mudler force-pushed the fix/9813-opus-darwin-alias branch from 03dbf96 to fc26352 Compare June 13, 2026 07:33
@mudler mudler merged commit 0413fc0 into master Jun 13, 2026
58 of 59 checks passed
@mudler mudler deleted the fix/9813-opus-darwin-alias branch June 13, 2026 07:51
@localai-bot

Copy link
Copy Markdown
Collaborator Author

Registry verification: confirmed all four opus image tags are published on quay.io/go-skynet/local-ai-backends - latest-cpu-opus, latest-metal-darwin-arm64-opus, master-cpu-opus, master-metal-darwin-arm64-opus. The meta + cpu-opus/metal-opus concretes all resolve to real images.

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.

VAD Models on Mac Don't load. Manual install, errors with opus not available even if you install metal-opus backend

2 participants