Zum Inhalt springen

Install Microsoft Foundry Local on macOS and Run It Offline

Microsoft Foundry Local runs locally on a current macOS system with Homebrew and Open WebUI. This guide walks through the complete setup with the exact versions used in the original, including the service port and connecting to the local interface.

Published

Bild KI-generiert

This article walks through installing Microsoft Foundry Local, including the Phi-4 and Phi-4 Reasoning models, on a current macOS system, together with Open WebUI as a graphical interface for easily using local Large Language Models offline.

macOS version: macOS Tahoe 26.2

Homebrew version: 5.0.8

Foundry Local version: 0.8.117

Open WebUI version: v0.6.43

A step-by-step video walkthrough is available on YouTube on the 365 Checkpoint channel:

Installing Homebrew & Microsoft Foundry Local

The installation runs through the Terminal on macOS. Open a regular, new Terminal window.

First, we install Homebrew if it isn’t already present, using the current command below. If this command has changed, you can always find the up-to-date installation command at https://brew.sh

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

You’ll then be asked to enter your password once. You need an account with admin rights, and you confirm with “Return”. The installation then runs for a few minutes.

After the installation, three commands need to be entered to load the Homebrew installation into your user path. You can simply copy these directly from Homebrew’s own instructions in the Terminal, since they already contain the correct paths for your system.

echo >> /Users/<Username>/.zprofile
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/<Uername>/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"

Next comes the installation of Foundry Local, with this command

brew tap microsoft/foundrylocal

and

brew install foundrylocal

After that, you can use the following commands to start the service and list the available models.

foundry service start
foundry model list

AI models can be installed and loaded into the cache with the following command. After a restart, they’re immediately available again as soon as you start the service.

foundry model run <modelname>

Note: depending on complexity and your internet speed, installing a model can take anywhere from a few minutes to quite a while. The GPT OSS model can take 30+ minutes before it’s up and running.

After installing, or after you “run” a model, it starts in interactive chat mode. This mode isn’t required to use the model later — it just lets you test the model directly in the Terminal. To exit interactive chat mode on macOS, simply press

CTRL+C

Installing Open WebUI

After installing Foundry Local and Homebrew, we install an interface for it.

Open WebUI is an open-source project that serves as our user interface for Foundry Local. It can do a lot more than that, but it also offers direct, local support for a locally running service — so with this setup, you can use AI anytime, offline and independent of other devices, without needing an internet connection.

Installing Open WebUI takes a few preparation steps plus the actual setup.

Preparing the Python environment for Open WebUI

brew install uv

Next, we create a new directory to hold Open WebUI and the config files it generates, and navigate straight into that folder

mkdir ~/openwebui && cd ~/openwebui

Then we set up and activate the Python environment

uv init --python=3.11 .
uv venv
source .venv/bin/activate

Now we can install Open WebUI:

uv pip install open-webui

and start it:

cd ~/openwebui
source .venv/bin/activate
open-webui serve

Open WebUI is now running locally on your machine at http://localhost:8080

Connecting Foundry Local with Open WebUI

To reach Foundry Local through the GUI, a few more steps are needed.

Important: both Terminal windows need to stay open (Open WebUI and Foundry)

Both services need to be started and running. So after a restart, the following commands need to be run again

cd ~/openwebui
source .venv/bin/activate
open-webui serve
foundry service start

Creating an account in Open WebUI

Navigate to http://localhost:8080 and create an account there. The account is entirely local. You should still write down the password, though — otherwise you’ll need to reinstall Open WebUI. The account is purely offline and only serves to identify you on this installation.

Finding the Foundry service port

To let Open WebUI access Foundry, you need to link the correct port. The port is dynamic, i.e. it changes every time the service starts.

While the service is running, you can find out

foundry service status
> 🟢 Model management service is running on http://127.0.0.1:59338/openai/status

which port is currently in use. In this example, that’s 59338

Connecting Foundry and Open WebUI

Now, in Open WebUI, navigate via the profile icon to Admin Settings > Connections and edit the URL for the OpenAI service there.

The correct syntax for reaching our local Foundry service is

http://localhost:<PORT>/v1

Set encryption to “None”.

You can now test the connection using the small arrow icon, and after saving and starting a “New Chat”, the installed models should be available.

After restarting your Mac, the Foundry port changes, i.e. it needs to be set again in the admin settings after every restart.

More useful commands:

foundry service status    # Check status
foundry service start     # Start service
foundry service stop      # Stop service
foundry service restart   # Restart service
foundry model list        # List available models
foundry cache list        # List downloaded models
foundry cache clear       # Clear cache (delete models)
brew upgrade foundrylocal  # Update Foundry Local

If you have questions, feel free to use the comments here or under the YouTube video!

What this means for your day-to-day work

The full walkthrough and context are covered above. If you want help applying this to your specific environment, you’ll find the right starting point in Coaching for IT and Admins.

Auch auf Deutsch verfügbar