Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Install an LLM on macOS: A Step-by-Step Guide

· 4 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

You can install a Large Language Model (LLM) on macOS by using a local runner like Ollama, which allows you to chat with AI privately on your own hardware without an internet connection. This achieves complete data privacy, eliminates subscription fees, and allows you to use the AI offline. To get started, you need a Mac with Apple Silicon (M1, M2, or M3 chips) for optimal performance, though some Intel Macs can run smaller models slowly.

What You'll Need

  • A Mac running a recent version of macOS.
  • An internet connection for the initial download of the software and the model files.
  • Available disk space (typically 4GB to 10GB per model, depending on the size).
  • At least 8GB of RAM (16GB or more is highly recommended for larger models).

Step-by-Step

  1. Visit the official Ollama website and download the macOS application.
  2. Open the downloaded .zip file and drag the Ollama application into your Applications folder.
  3. Launch Ollama from your Applications folder. You may be prompted to grant permission to run the app; confirm this in your system settings if requested.
  4. Once the app is running, look for the Ollama icon in the menu bar at the top of your screen.
  5. Open the Terminal app (found in Applications > Utilities).
  6. In the Terminal window, type the command ollama run llama3 (or replace "llama3" with another supported model name) and press Enter.
  7. Wait for the system to download the model weights. The Terminal will show a progress bar.
  8. Once the download is complete, you will see a prompt that says "Send a message". You can now type your questions and chat with the LLM directly in the Terminal.
  9. To exit the chat, type /bye and press Enter.

Common Mistakes

  • Choosing a model that is too large: Attempting to run a 70B parameter model on a Mac with only 8GB of RAM will cause the system to swap heavily to the disk, resulting in extremely slow response times or crashes.
  • Closing the Terminal too early: If you close the Terminal window while the model is still downloading, the process will be interrupted.
  • Ignoring system updates: Running outdated versions of macOS can sometimes lead to compatibility issues with the Metal acceleration used by LLMs to access the GPU.

Tips

  • Use a GUI: If you prefer a visual interface over the Terminal, look for open-source projects like Page Assist or Enchanted that connect to the Ollama backend to provide a ChatGPT-like experience.
  • Monitor Resource Usage: Open Activity Monitor and go to the Memory tab to see how much Unified Memory the model is consuming while it generates text.
  • Try Different Models: Depending on your needs, try mistral for efficiency or phi3 for a very lightweight model that runs quickly on older hardware.

Troubleshooting

If the installation or execution does not go to plan, try these steps in order:

  1. Restart the Ollama App: Quit the application from the menu bar and relaunch it to ensure the background server is active.
  2. Check Disk Space: Ensure you have enough free space. If the disk is nearly full, the model download may fail silently or corrupt.
  3. Update macOS: Ensure your OS is up to date, as LLM runners rely on the latest Metal frameworks for GPU acceleration.
  4. Reinstall the Application: Delete the Ollama app from the Applications folder and download a fresh copy from the official site.

Frequently Asked Questions

Does running an LLM locally drain the battery?

Yes, running a local LLM is computationally intensive and will consume battery power significantly faster than standard web browsing.

Is my data safe when using a local LLM?

Yes. Because the model runs entirely on your own hardware, your prompts and the AI's responses never leave your machine.

Can I run an LLM on an Intel-based Mac?

Yes, but it is much slower. Intel Macs lack the Unified Memory Architecture of Apple Silicon, meaning they cannot access the GPU as efficiently for these tasks.

Do I need a special graphics card?

No. On Apple Silicon Macs, the GPU is integrated into the M-series chip, which the software uses automatically.

How do I delete a model to save space?

In the Terminal, use the command ollama rm [modelname] to remove a specific model from your storage.