[GH-ISSUE #15479] MLX runner fails to load dynamic library on Ollama 0.20.5 (Apple Silicon, Homebrew install) #35655

Open
opened 2026-04-22 20:19:22 -05:00 by GiteaMirror · 10 comments
Owner

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

What is the issue?

Environment:

Hardware: Apple Silicon (M4 Max)
OS: macOS (latest)
Install method: Homebrew (official formula)
Ollama version: 0.20.5
Previous working version: 0.20.3 (local Homebrew formula build)

Summary:
After upgrading from 0.20.3 to 0.20.5, MLX-based models fail to run due to a dynamic library loading error. Non-MLX models continue to work normally. Restarting the Ollama service does not resolve the issue.

Reproduction steps:

Install or upgrade to Ollama 0.20.5 via Homebrew
Start the Ollama service (launchctl or equivalent)
Run:
ollama run qwen3.5:35b-a3b-mlx-bf16 "Write one sentence about testing."

Expected behavior:
The MLX BF16 model should load and run inference 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.20.5/bin/lib/ollama /opt/homebrew/Cellar/ollama/0.20.5/bin /opt/homebrew/var/build/lib/ollama]) (exit: exit status 1)

Additional observations:

Ollama server starts successfully and listens on 127.0.0.1:11434
Standard (non-MLX) models such as qwen3.5:35b run without issue
Failure is specific to MLX-backed models
Behavior persists after a full service restart
Error suggests missing or incorrectly packaged MLX dynamic library rather than a model issue

Working comparison (0.20.3):

Same MLX BF16 model runs correctly on 0.20.3
No configuration changes between versions

Impact:

Breaks MLX-based workflows on Apple Silicon
Prevents use of BF16 models
Blocks upgrade from 0.20.3 for MLX users

Possible cause:
This appears to be a packaging or runtime path issue affecting MLX dynamic library loading in the 0.20.5 Homebrew build.

Relevant log output


OS

No response

GPU

No response

CPU

No response

Ollama version

No response

Originally created by @charlesdrakon-cmyk on GitHub (Apr 10, 2026). Original GitHub issue: https://github.com/ollama/ollama/issues/15479 ### What is the issue? Environment: Hardware: Apple Silicon (M4 Max) OS: macOS (latest) Install method: Homebrew (official formula) Ollama version: 0.20.5 Previous working version: 0.20.3 (local Homebrew formula build) Summary: After upgrading from 0.20.3 to 0.20.5, MLX-based models fail to run due to a dynamic library loading error. Non-MLX models continue to work normally. Restarting the Ollama service does not resolve the issue. Reproduction steps: Install or upgrade to Ollama 0.20.5 via Homebrew Start the Ollama service (launchctl or equivalent) Run: ollama run qwen3.5:35b-a3b-mlx-bf16 "Write one sentence about testing." Expected behavior: The MLX BF16 model should load and run inference 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.20.5/bin/lib/ollama /opt/homebrew/Cellar/ollama/0.20.5/bin /opt/homebrew/var/build/lib/ollama]) (exit: exit status 1) Additional observations: Ollama server starts successfully and listens on 127.0.0.1:11434 Standard (non-MLX) models such as qwen3.5:35b run without issue Failure is specific to MLX-backed models Behavior persists after a full service restart Error suggests missing or incorrectly packaged MLX dynamic library rather than a model issue Working comparison (0.20.3): Same MLX BF16 model runs correctly on 0.20.3 No configuration changes between versions Impact: Breaks MLX-based workflows on Apple Silicon Prevents use of BF16 models Blocks upgrade from 0.20.3 for MLX users Possible cause: This appears to be a packaging or runtime path issue affecting MLX dynamic library loading in the 0.20.5 Homebrew build. ### Relevant log output ```shell ``` ### OS _No response_ ### GPU _No response_ ### CPU _No response_ ### Ollama version _No response_
GiteaMirror added the bug label 2026-04-22 20:19:22 -05:00
Author
Owner

@leftbankvines commented on GitHub (Apr 11, 2026):

I’m seeing this on a Homebrew install of Ollama 0.20.5 on macOS Tahoe / Apple Silicon, and the currently suggested workaround paths did not resolve it for me.

Environment

  • macOS Tahoe
  • Apple Silicon (M3 Ultra)
  • Ollama 0.20.5 installed via Homebrew
  • mlx and mlx-c both installed by Homebrew
  • text model affected: qwen3.5:35b-a3b-coding-nvfp4

Baseline failure

ollama run qwen3.5:35b-a3b-coding-nvfp4 "Reply in one sentence: are you working?"

mlx runner failed: Error: MLX not available: failed to load MLX dynamic library (searched: [/opt/homebrew/Cellar/ollama/0.20.5/bin/lib/ollama /opt/homebrew/Cellar/ollama/0.20.5/bin /Users/alexlepage/build/lib/ollama])

What I verified:

  • Ollama service itself is healthy and serving normally
  • Metal is detected normally
  • failure occurs when the MLX runner subprocess starts

What I tried:

  1. Confirmed Homebrew-installed MLX libraries exist:

    • /opt/homebrew/Cellar/mlx/0.31.1/lib/libmlx.dylib
    • /opt/homebrew/Cellar/mlx-c/0.6.0/lib/libmlxc.dylib
  2. Tried the symlink workaround discussed in related issues.

    • First attempt using mlx-c was not valid on my machine because there is no /opt/homebrew/opt/mlx-c/lib/libmlx.dylib
    • Then I used the actual mlx library:
      • symlinked /opt/homebrew/opt/mlx/lib/libmlx.dylib into:
        • /opt/homebrew/opt/ollama/bin/libmlx.dylib
        • /opt/homebrew/Cellar/ollama/0.20.5/bin/libmlx.dylib
        • /opt/homebrew/Cellar/ollama/0.20.5/bin/lib/ollama/libmlx.dylib

    Result: no change; exact same error and exact same searched paths.

  3. Tried launching Ollama manually with:
    OLLAMA_LIBRARY_PATH=/opt/homebrew/opt/mlx/lib /opt/homebrew/bin/ollama serve

    Result: no change. The MLX runner still failed with the same error and the same searched paths, so in this code path the runner does not appear to honor OLLAMA_LIBRARY_PATH (or it is not sufficient to resolve the issue).

Additional notes:

  • file, otool -L, and codesign -dv on /opt/homebrew/opt/mlx/lib/libmlx.dylib all looked normal (arm64 Mach-O shared library, normal Apple framework deps, ad-hoc signature).
  • I removed all workaround symlinks afterward and confirmed I’m back to a clean state.

So at least in this Homebrew 0.20.5 setup, the currently circulating symlink / library-path workaround does not resolve the MLX loader failure.

Happy to provide any additional logs if useful.

<!-- gh-comment-id:4230034157 --> @leftbankvines commented on GitHub (Apr 11, 2026): I’m seeing this on a **Homebrew install of Ollama 0.20.5 on macOS Tahoe / Apple Silicon**, and the currently suggested workaround paths did **not** resolve it for me. ## Environment - macOS Tahoe - Apple Silicon (**M3 Ultra**) - Ollama **0.20.5** installed via **Homebrew** - `mlx` and `mlx-c` both installed by Homebrew - text model affected: `qwen3.5:35b-a3b-coding-nvfp4` ## Baseline failure ollama run qwen3.5:35b-a3b-coding-nvfp4 "Reply in one sentence: are you working?" mlx runner failed: Error: MLX not available: failed to load MLX dynamic library (searched: [/opt/homebrew/Cellar/ollama/0.20.5/bin/lib/ollama /opt/homebrew/Cellar/ollama/0.20.5/bin /Users/alexlepage/build/lib/ollama]) ## What I verified: - Ollama service itself is healthy and serving normally - Metal is detected normally - failure occurs when the MLX runner subprocess starts ## What I tried: 1. Confirmed Homebrew-installed MLX libraries exist: - `/opt/homebrew/Cellar/mlx/0.31.1/lib/libmlx.dylib` - `/opt/homebrew/Cellar/mlx-c/0.6.0/lib/libmlxc.dylib` 2. Tried the symlink workaround discussed in related issues. - First attempt using `mlx-c` was not valid on my machine because there is no `/opt/homebrew/opt/mlx-c/lib/libmlx.dylib` - Then I used the actual `mlx` library: - symlinked `/opt/homebrew/opt/mlx/lib/libmlx.dylib` into: - `/opt/homebrew/opt/ollama/bin/libmlx.dylib` - `/opt/homebrew/Cellar/ollama/0.20.5/bin/libmlx.dylib` - `/opt/homebrew/Cellar/ollama/0.20.5/bin/lib/ollama/libmlx.dylib` Result: no change; exact same error and exact same searched paths. 3. Tried launching Ollama manually with: `OLLAMA_LIBRARY_PATH=/opt/homebrew/opt/mlx/lib /opt/homebrew/bin/ollama serve` Result: no change. The MLX runner still failed with the same error and the same searched paths, so in this code path the runner does not appear to honor `OLLAMA_LIBRARY_PATH` (or it is not sufficient to resolve the issue). ## Additional notes: - `file`, `otool -L`, and `codesign -dv` on `/opt/homebrew/opt/mlx/lib/libmlx.dylib` all looked normal (arm64 Mach-O shared library, normal Apple framework deps, ad-hoc signature). - I removed all workaround symlinks afterward and confirmed I’m back to a clean state. So at least in this Homebrew 0.20.5 setup, the currently circulating symlink / library-path workaround does not resolve the MLX loader failure. Happy to provide any additional logs if useful.
Author
Owner

@jameswsullivan commented on GitHub (Apr 12, 2026):

Similar error here when testing with x/z-image-turbo model. With the latest 0.20.5 version I got this error, but reverting back to 0.20.3 version works.

Error: 500 Internal Server Error: mlx runner failed: Error: failed to initialize MLX: libmlxc.dylib not found (exit: exit status 1)

The files do exists under:

/Applications/Ollama.app/Contents/Resources/mlx_metal_v3/libmlxc.dylib
/Applications/Ollama.app/Contents/Resources/mlx_metal_v4/libmlxc.dylib
<!-- gh-comment-id:4230768957 --> @jameswsullivan commented on GitHub (Apr 12, 2026): Similar error here when testing with `x/z-image-turbo` model. With the latest `0.20.5` version I got this error, but reverting back to `0.20.3` version works. ``` Error: 500 Internal Server Error: mlx runner failed: Error: failed to initialize MLX: libmlxc.dylib not found (exit: exit status 1) ``` The files do exists under: ``` /Applications/Ollama.app/Contents/Resources/mlx_metal_v3/libmlxc.dylib /Applications/Ollama.app/Contents/Resources/mlx_metal_v4/libmlxc.dylib ```
Author
Owner

@affanjavid commented on GitHub (Apr 13, 2026):

Getting same error , tried fresh install directly with out home brew still getting same on Two device, M1 and M3

ollama run x/z-image-turbo
Error: failed to load model: 500 Internal Server Error: mlx runner failed: Error: failed to initialize MLX: libmlxc.dylib not found (exit: exit status 1)

<!-- gh-comment-id:4235596424 --> @affanjavid commented on GitHub (Apr 13, 2026): Getting same error , tried fresh install directly with out home brew still getting same on Two device, M1 and M3 ollama run x/z-image-turbo Error: failed to load model: 500 Internal Server Error: mlx runner failed: Error: failed to initialize MLX: libmlxc.dylib not found (exit: exit status 1)
Author
Owner

@breichldomico commented on GitHub (Apr 13, 2026):

also getting the same error running 0.20.6 on mac mini m4, no homebrew, standard dmg install:
ollama run x/z-image-turbo
Error: failed to load model: 500 Internal Server Error: mlx runner failed: Error: failed to initialize MLX: libmlxc.dylib not found (exit: exit status 1)

<!-- gh-comment-id:4237714999 --> @breichldomico commented on GitHub (Apr 13, 2026): also getting the same error running 0.20.6 on mac mini m4, no homebrew, standard dmg install: ollama run x/z-image-turbo Error: failed to load model: 500 Internal Server Error: mlx runner failed: Error: failed to initialize MLX: libmlxc.dylib not found (exit: exit status 1)
Author
Owner

@fungiboletus commented on GitHub (Apr 14, 2026):

The symlink hack worked for me:

I just created a symlink and it worked for now sudo ln -s /opt/homebrew/lib/libmlxc.dylib /opt/homebrew/Cellar/ollama/0.16.3/bin/libmlxc.dylib

UPD: Change 0.16.3 to your version

https://github.com/Homebrew/homebrew-core/issues/266704#issuecomment-3938521402

<!-- gh-comment-id:4242570435 --> @fungiboletus commented on GitHub (Apr 14, 2026): The symlink hack worked for me: > I just created a symlink and it worked for now `sudo ln -s /opt/homebrew/lib/libmlxc.dylib /opt/homebrew/Cellar/ollama/0.16.3/bin/libmlxc.dylib` > > UPD: Change `0.16.3` to your version https://github.com/Homebrew/homebrew-core/issues/266704#issuecomment-3938521402
Author
Owner

@cyrilblanchet commented on GitHub (Apr 16, 2026):

The following "hack" worked for me on an Apple M3 Max with MacOS 26.4.1 and a standard dmg installation.

  1. Open a terminal
# 1. Export the Ollama libs and source your profile
echo 'export OLLAMA_LIBRARY_PATH=/Applications/Ollama.app/Contents/Resources' >> ~/.zshrc
source ~/.zshrc
# 2. Start the server in this terminal
ollama serve
  1. Open a NEW terminal tab and run your command:
ollama run x/z-image-turbo "your prompt"
<!-- gh-comment-id:4258711024 --> @cyrilblanchet commented on GitHub (Apr 16, 2026): The following "hack" worked for me on an Apple M3 Max with `MacOS 26.4.1` and a standard dmg installation. 1. Open a terminal ```bash # 1. Export the Ollama libs and source your profile echo 'export OLLAMA_LIBRARY_PATH=/Applications/Ollama.app/Contents/Resources' >> ~/.zshrc source ~/.zshrc # 2. Start the server in this terminal ollama serve ``` 2. Open a NEW terminal tab and run your command: ```bash ollama run x/z-image-turbo "your prompt" ```
Author
Owner

@mainfruit commented on GitHub (Apr 16, 2026):

Try:

Uninstall Ollama brew version:
brew uninstall ollama

Install official Ollama non-brew version, see https://ollama.com/download:
curl -fsSL https://ollama.com/install.sh | sh (mac)

Then do the test again. Worked for me.

<!-- gh-comment-id:4263596553 --> @mainfruit commented on GitHub (Apr 16, 2026): Try: Uninstall Ollama brew version: `brew uninstall ollama` Install official Ollama non-brew version, see https://ollama.com/download: `curl -fsSL https://ollama.com/install.sh | sh` (mac) Then do the test again. Worked for me.
Author
Owner

@jameswsullivan commented on GitHub (Apr 16, 2026):

@mainfruit if the install script works now, it must've been fixed, I originally used the install script and discovered the problem, later switched to brew to troubleshoot.

<!-- gh-comment-id:4263722057 --> @jameswsullivan commented on GitHub (Apr 16, 2026): @mainfruit if the install script works now, it must've been fixed, I originally used the install script and discovered the problem, later switched to brew to troubleshoot.
Author
Owner

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

🤖 Automated Triage & Analysis Report

Issue: #15479
Analyzed: 2026-04-18T18:20:51.465778

Analysis

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

Implementation Plan

  • Effort: medium
  • Steps:

This issue has been triaged and marked for implementation.

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

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

...
2. Tried the symlink workaround discussed in related issues.

  • First attempt using mlx-c was not valid on my machine because there is no /opt/homebrew/opt/mlx-c/lib/libmlx.dylib

  • Then I used the actual mlx library:

    • symlinked /opt/homebrew/opt/mlx/lib/libmlx.dylib into:

      • /opt/homebrew/opt/ollama/bin/libmlx.dylib
      • /opt/homebrew/Cellar/ollama/0.20.5/bin/libmlx.dylib
      • /opt/homebrew/Cellar/ollama/0.20.5/bin/lib/ollama/libmlx.dylib

Result: no change; exact same error and exact same searched paths.
...

For those who don't want to uninstall the brew version, these symlinks worked for me:

ln -s /opt/homebrew/lib/libmlx.dylib /opt/homebrew/Cellar/ollama/0.21.0/bin
ln -s /opt/homebrew/lib/libmlxc.dylib /opt/homebrew/Cellar/ollama/0.21.0/bin
<!-- gh-comment-id:4274422991 --> @edp8489 commented on GitHub (Apr 18, 2026): > ... > 2. Tried the symlink workaround discussed in related issues. > > * First attempt using `mlx-c` was not valid on my machine because there is no `/opt/homebrew/opt/mlx-c/lib/libmlx.dylib` > * Then I used the actual `mlx` library: > > * symlinked `/opt/homebrew/opt/mlx/lib/libmlx.dylib` into: > > * `/opt/homebrew/opt/ollama/bin/libmlx.dylib` > * `/opt/homebrew/Cellar/ollama/0.20.5/bin/libmlx.dylib` > * `/opt/homebrew/Cellar/ollama/0.20.5/bin/lib/ollama/libmlx.dylib` > > Result: no change; exact same error and exact same searched paths. > ... For those who don't want to uninstall the brew version, these symlinks worked for me: ``` ln -s /opt/homebrew/lib/libmlx.dylib /opt/homebrew/Cellar/ollama/0.21.0/bin ln -s /opt/homebrew/lib/libmlxc.dylib /opt/homebrew/Cellar/ollama/0.21.0/bin ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#35655