ollama - ✅(Solved) Fix MLX models fail to load in v0.21.0 due to missing libmlxc.dylib (Apple Silicon) [1 pull requests, 2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
ollama/ollama#15648Fetched 2026-04-18 05:51:59
View on GitHub
Comments
2
Participants
2
Timeline
8
Reactions
0
Timeline (top)
subscribed ×4commented ×2labeled ×1mentioned ×1

Error Message

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) 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

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)

Fix Action

Fix / Workaround

Ensure no workaround is present:

Workaround (Not a Fix)

PR fix notes

PR #278296: ollama: fix mlx and add test

Description (problem / solution / changelog)


<!-- Do not tick a checkbox if you haven’t performed its action. Honesty is indispensable for a smooth review process. --> <!-- Use [x] to mark item done before creation, or just click the checkboxes with device pointer after creation --> <!-- In the following questions `<formula>` is the name of the formula you're editing. -->
  • Have you followed the guidelines for contributing?
  • Have you ensured that your commits follow the commit style guide?
  • Have you checked that there aren't other open pull requests for the same formula update/change?
  • Have you built your formula locally with HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>?
  • Is your test running fine brew test <formula>?
  • Does your build pass brew audit --strict <formula> (after doing HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>)? If this is a new formula, does it pass brew audit --new <formula>?

  • AI was used to generate or assist with generating this PR. Please specify below how you used AI to help you, and what steps you have taken to manually verify the changes.

Fixes https://github.com/ollama/ollama/issues/15648.

cc @dhiltgen.

Changed files

  • Formula/o/ollama.rb (modified, +25/-7)
RAW_BUFFERClick to expand / collapse

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

extent analysis

TL;DR

Creating a symlink from the MLX-C library location to the Ollama binary directory may allow MLX models to run, but a proper fix would involve updating Ollama to search for the MLX dynamic library in the correct location.

Guidance

  • Verify that the libmlxc.dylib file is correctly installed at /opt/homebrew/opt/mlx-c/lib/libmlxc.dylib and that the Ollama runtime is not searching this path.
  • Consider creating a symlink from the MLX-C library location to the Ollama binary directory as a temporary workaround: ln -sf "$(brew --prefix mlx-c)/lib/libmlxc.dylib" "$(brew --prefix ollama)/bin/libmlxc.dylib".
  • Check if there are any open issues or pull requests in the Ollama repository that address this library path resolution issue.
  • If possible, try to update the Ollama configuration to include the correct path to the MLX dynamic library.

Example

No code snippet is provided as the issue is related to library path resolution and not a specific code error.

Notes

The provided workaround may break on upgrade and is not a canonical solution. A proper fix would involve updating Ollama to search for the MLX dynamic library in the correct location.

Recommendation

Apply the workaround by creating a symlink, as it may allow MLX models to run, but be aware that this is not a permanent solution and may break on upgrade. A better solution would be to update Ollama to correctly handle the library path.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING