Search Results for “#macOS”

Page 1 of 1

Run Ollama In The Menu Bar On macOS With Custom Host Bindings

By default ollama runs on the localhost IP address of 127.0.0.1. But if you want to host it on macOS somewhere else, it requires a system-wide environment variable change. The developers of ollama recommend running this command, and then relaunching ollama:

launchctl setenv OLLAMA_HOST "0.0.0.0"

This works great! If you want to run this automatically at startup you can use a small AppleScript to create an application, and then add that application to your Login Items.

First, open Script Editor and paste the following code:

do shell script "launchctl setenv OLLAMA_HOST \"0.0.0.0\""
tell application "Ollama" to run

This will bind all IP addresses to ollama and then launch it. Obviously, you can bind any specific IP address you like.

Next, in the File menu use the Export command to create an Application that is signed to run locally. Quit Script Editor and then put the new application in your Applications folder.

Finally, search for “Login Items” in System Settings. Remove any existing Ollama application from the list, and add your application.

Now when you restart and sign in, your application will launch, set the environment variable for the host binding, launch Ollama, and quit.

#YOUREWELCOME #Apple #macOS #code #tech #ai

Mar 2


Copyright © 2024 Michael Argentini. All rights reserved.