[GH-ISSUE #15648] MLX models fail to load in v0.21.0 due to missing libmlxc.dylib (Apple Silicon) #72044

Closed
opened 2026-05-05 03:23:42 -05:00 by GiteaMirror · 7 comments
Owner

Originally created by @charlesdrakon-cmyk on GitHub (Apr 17, 2026).
Original GitHub issue: https://github.com/ollama/ollama/issues/15648

What is the issue?

Environment
Hardware: Apple Silicon (M-series)
OS: macOS
Ollama version: 0.21.0 (Homebrew)
Installation method: brew upgrade ollama
MLX dependency installed via: brew install mlx-c
Summary

MLX-based models fail to run in Ollama v0.21.0 due to the runtime being unable to locate the required MLX dynamic library (libmlxc.dylib), even though it is correctly installed via Homebrew.

This issue persists from previous versions (0.20.4–0.20.5) and remains unresolved in 0.21.0.

ollama run qwen3.5:35b-a3b-mlx-bf16 "Write one sentence about testing."
Error: 500 Internal Server Error: mlx runner failed: Error: MLX not available: failed to load MLX dynamic library (searched: [/opt/homebrew/Cellar/ollama/0.21.0/bin/lib/ollama /opt/homebrew/Cellar/ollama/0.21.0/bin /opt/homebrew/var/build/lib/ollama]) (exit: exit status 1)

Steps to Reproduce

Install MLX dependency:

brew install mlx-c

Ensure no workaround is present:

rm "$(brew --prefix ollama)/bin/libmlxc.dylib"

Run an MLX model:

ollama run qwen3.5:35b-a3b-mlx-bf16 "Write one sentence about testing."
Expected Behavior
MLX model loads successfully
Inference runs normally
Actual Behavior
Error: 500 Internal Server Error: mlx runner failed: Error: MLX not available: failed to load MLX dynamic library (searched: [/opt/homebrew/Cellar/ollama/0.21.0/bin/lib/ollama /opt/homebrew/Cellar/ollama/0.21.0/bin /opt/homebrew/var/build/lib/ollama]) (exit: exit status 1)
Root Cause (Observed)

libmlxc.dylib is installed at:

/opt/homebrew/opt/mlx-c/lib/libmlxc.dylib
Ollama does not search this path
The runtime only searches internal directories under the Ollama Cellar

This indicates a library path resolution / packaging issue

Workaround (Not a Fix)

Creating a symlink allows MLX models to run:

ln -sf "$(brew --prefix mlx-c)/lib/libmlxc.dylib"
"$(brew --prefix ollama)/bin/libmlxc.dylib"

However:

This is non-canonical
May break on upgrade
Should not be required for normal operation
Additional Notes
Issue reproduced cleanly on a fresh 0.21.0 upgrade
Behavior is identical to 0.20.5 aside from updated search path
Confirms no regression fix was included in 0.21.0 for MLX loading

Relevant log output


OS

No response

GPU

No response

CPU

No response

Ollama version

No response

Originally created by @charlesdrakon-cmyk on GitHub (Apr 17, 2026). Original GitHub issue: https://github.com/ollama/ollama/issues/15648 ### What is the issue? Environment Hardware: Apple Silicon (M-series) OS: macOS Ollama version: 0.21.0 (Homebrew) Installation method: brew upgrade ollama MLX dependency installed via: brew install mlx-c Summary MLX-based models fail to run in Ollama v0.21.0 due to the runtime being unable to locate the required MLX dynamic library (libmlxc.dylib), even though it is correctly installed via Homebrew. This issue persists from previous versions (0.20.4–0.20.5) and remains unresolved in 0.21.0. ollama run qwen3.5:35b-a3b-mlx-bf16 "Write one sentence about testing." Error: 500 Internal Server Error: mlx runner failed: Error: MLX not available: failed to load MLX dynamic library (searched: [/opt/homebrew/Cellar/ollama/0.21.0/bin/lib/ollama /opt/homebrew/Cellar/ollama/0.21.0/bin /opt/homebrew/var/build/lib/ollama]) (exit: exit status 1) Steps to Reproduce Install MLX dependency: brew install mlx-c Ensure no workaround is present: rm "$(brew --prefix ollama)/bin/libmlxc.dylib" Run an MLX model: ollama run qwen3.5:35b-a3b-mlx-bf16 "Write one sentence about testing." Expected Behavior MLX model loads successfully Inference runs normally Actual Behavior Error: 500 Internal Server Error: mlx runner failed: Error: MLX not available: failed to load MLX dynamic library (searched: [/opt/homebrew/Cellar/ollama/0.21.0/bin/lib/ollama /opt/homebrew/Cellar/ollama/0.21.0/bin /opt/homebrew/var/build/lib/ollama]) (exit: exit status 1) Root Cause (Observed) libmlxc.dylib is installed at: /opt/homebrew/opt/mlx-c/lib/libmlxc.dylib Ollama does not search this path The runtime only searches internal directories under the Ollama Cellar This indicates a library path resolution / packaging issue Workaround (Not a Fix) Creating a symlink allows MLX models to run: ln -sf "$(brew --prefix mlx-c)/lib/libmlxc.dylib" \ "$(brew --prefix ollama)/bin/libmlxc.dylib" However: This is non-canonical May break on upgrade Should not be required for normal operation Additional Notes Issue reproduced cleanly on a fresh 0.21.0 upgrade Behavior is identical to 0.20.5 aside from updated search path Confirms no regression fix was included in 0.21.0 for MLX loading ### Relevant log output ```shell ``` ### OS _No response_ ### GPU _No response_ ### CPU _No response_ ### Ollama version _No response_
GiteaMirror added the bug label 2026-05-05 03:23:42 -05:00
Author
Owner

@dhiltgen commented on GitHub (Apr 17, 2026):

I think the formula likely needs some updating now that we've moved things around a bit on the Ollama side. We used to build a single MLX/MLX-C version in our official builds, but to support v26 and M5 Macs with NAX optimizations, we've moved to a model similar to how we ship multiple CUDA versions. The new pathing pattern is ./lib/ollama/mlx_metal_[version] and we pick the optimal version at runtime based on which OS the user is running.

CC @p-linnane

<!-- gh-comment-id:4270255199 --> @dhiltgen commented on GitHub (Apr 17, 2026): I think the formula likely needs some updating now that we've moved things around a bit on the Ollama side. We used to build a single MLX/MLX-C version in our official builds, but to support v26 and M5 Macs with NAX optimizations, we've moved to a model similar to how we ship multiple CUDA versions. The new pathing pattern is ./lib/ollama/mlx_metal_[version] and we pick the optimal version at runtime based on which OS the user is running. CC @p-linnane
Author
Owner

@charlesdrakon-cmyk commented on GitHub (Apr 17, 2026):

Thanks — that matches what I’m seeing. On Apple Silicon with a Homebrew upgrade to 0.21.0, MLX fails without the symlink and works immediately once it’s restored, so this does look like a formula/pathing mismatch.

<!-- gh-comment-id:4270311681 --> @charlesdrakon-cmyk commented on GitHub (Apr 17, 2026): Thanks — that matches what I’m seeing. On Apple Silicon with a Homebrew upgrade to 0.21.0, MLX fails without the symlink and works immediately once it’s restored, so this does look like a formula/pathing mismatch.
Author
Owner

@PureBlissAK commented on GitHub (Apr 18, 2026):

🤖 Automated Triage & Analysis Report

Issue: #15648
Analyzed: 2026-04-18T18:13:40.880270

Analysis

  • Type: unknown
  • Severity: medium
  • Components: unknown

Implementation Plan

  • Effort: medium
  • Steps:

This issue has been triaged and marked for implementation.

<!-- gh-comment-id:4274294742 --> @PureBlissAK commented on GitHub (Apr 18, 2026): <!-- ollama-issue-orchestrator:v1 issue:15648 --> ## 🤖 Automated Triage & Analysis Report **Issue**: #15648 **Analyzed**: 2026-04-18T18:13:40.880270 ### Analysis - **Type**: unknown - **Severity**: medium - **Components**: unknown ### Implementation Plan - **Effort**: medium - **Steps**: *This issue has been triaged and marked for implementation.*
Author
Owner

@p-linnane commented on GitHub (Apr 18, 2026):

@dhiltgen Thanks for the ping. Will investigate later today.

<!-- gh-comment-id:4274355055 --> @p-linnane commented on GitHub (Apr 18, 2026): @dhiltgen Thanks for the ping. Will investigate later today.
Author
Owner

@delfireinoso commented on GitHub (Apr 18, 2026):

Thanks — that matches what I’m seeing. On Apple Silicon with a Homebrew upgrade to 0.21.0, MLX fails without the symlink and works immediately once it’s restored, so this does look like a formula/pathing mismatch.

I have observed the same

With Homebrew Ollama v21 MLX dependencies are installed but on my M2Pro are not loaded

I had more success with the previous version but now I can't use MLX models

<!-- gh-comment-id:4274653450 --> @delfireinoso commented on GitHub (Apr 18, 2026): > Thanks — that matches what I’m seeing. On Apple Silicon with a Homebrew upgrade to 0.21.0, MLX fails without the symlink and works immediately once it’s restored, so this does look like a formula/pathing mismatch. I have observed the same With Homebrew Ollama v21 MLX dependencies are installed but on my M2Pro are not loaded I had more success with the previous version but now I can't use MLX models
Author
Owner

@p-linnane commented on GitHub (Apr 19, 2026):

This is fixed in Homebrew now. Run brew update && brew upgrade ollama.

<!-- gh-comment-id:4275235687 --> @p-linnane commented on GitHub (Apr 19, 2026): This is fixed in Homebrew now. Run `brew update && brew upgrade ollama`.
Author
Owner

@charlesdrakon-cmyk commented on GitHub (Apr 19, 2026):

Fix confirmed. MLX models now load correctly on Apple Silicon after upgrading to Homebrew 0.21.0_1. Workaround no longer required.

<!-- gh-comment-id:4276136319 --> @charlesdrakon-cmyk commented on GitHub (Apr 19, 2026): Fix confirmed. MLX models now load correctly on Apple Silicon after upgrading to Homebrew 0.21.0_1. Workaround no longer required.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#72044