[GH-ISSUE #12916] The auto-start Ollama service cannot output in parallel. #34323

Open
opened 2026-04-22 17:46:29 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @XiaZixun on GitHub (Nov 3, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/12916

What is the issue?

I use brew services to start ollama at boot and inject the environment variable OLLAMA_NUM_PARALLEL = 4 via a plist.
However, the automatically started ollama cannot achieve parallel output, even though checking the environment variable shows the correct value.

❯ launchctl print gui/$UID/homebrew.mxcl.ollama | grep OLLAMA_NUM_PARALLEL
                OLLAMA_NUM_PARALLEL => 4

At this point, I only need to run brew services restart ollama without setting any additional environment variables, and ollama will correctly perform parallel output.

I'm not entirely sure if I have set it up correctly. What should the correct method for persistently setting ollama's environment variables be?

My ~/Library/LaunchAgents/environments.plist is as follows:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>Label</key>
    <string>environment.variables.user</string>

    <key>ProgramArguments</key>
    <array>
      <string>/bin/sh</string>
      <string>-c</string>
      <string>
        /bin/launchctl setenv OLLAMA_NUM_PARALLEL 4;
        /bin/launchctl setenv OLLAMA_MAX_LOADED_MODELS 4;
      </string>
    </array>

    <key>RunAtLoad</key>
    <true/>
  </dict>
</plist>

Relevant log output


OS

macOS

GPU

Apple

CPU

Apple

Ollama version

0.12.9

Originally created by @XiaZixun on GitHub (Nov 3, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/12916 ### What is the issue? I use `brew services` to start ollama at boot and inject the environment variable `OLLAMA_NUM_PARALLEL = 4` via a plist. However, the automatically started ollama cannot achieve parallel output, even though checking the environment variable shows the correct value. ``` ❯ launchctl print gui/$UID/homebrew.mxcl.ollama | grep OLLAMA_NUM_PARALLEL OLLAMA_NUM_PARALLEL => 4 ``` At this point, I only need to run `brew services restart ollama` without setting any additional environment variables, and ollama will correctly perform parallel output. I'm not entirely sure if I have set it up correctly. What should the correct method for persistently setting ollama's environment variables be? My `~/Library/LaunchAgents/environments.plist` is as follows: ``` <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>environment.variables.user</string> <key>ProgramArguments</key> <array> <string>/bin/sh</string> <string>-c</string> <string> /bin/launchctl setenv OLLAMA_NUM_PARALLEL 4; /bin/launchctl setenv OLLAMA_MAX_LOADED_MODELS 4; </string> </array> <key>RunAtLoad</key> <true/> </dict> </plist> ``` ### Relevant log output ```shell ``` ### OS macOS ### GPU Apple ### CPU Apple ### Ollama version 0.12.9
GiteaMirror added the bug label 2026-04-22 17:46:29 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#34323