Blog· What you can do with your Mac mini·

Run Gemma 4 on a Mac mini: a private AI model on your own cloud Mac

How to run Google's open model Gemma 4 locally with Ollama on a rented Mac mini M6 with 16 GB: which size to pick, the commands, how to use it from your own computer, and the larger versions for the coming Mac Studio.

A large faceted violet gemstone glowing from inside, resting on a compact silver mini desktop computer, with three smaller violet gems lined up beside it

Gemma 4 is Google’s family of open AI models. You download the model once and it runs on your own machine: your prompts, your code and your documents never leave it, there is no per-token bill and no rate limit. Apple silicon is a good home for it, because the processor and the graphics chip share the same memory, so a Mac mini can give most of its 16 GB to the model.

This guide runs Gemma 4 on a dedicated Mac mini M6 in the cloud with Ollama, step by step: which size fits, the commands, how to send it images, and how to use it from your own computer through an SSH tunnel. It also covers the larger versions for the Mac Studio that is coming to SoloRack.

What Gemma 4 is

Google publishes Gemma 4 in five sizes: E2B and E4B, built for small devices, a 12B model, a 26B model that only activates part of itself for each answer, and a 31B model. All of them read text and images. According to Google’s model card, the E2B, E4B and 12B sizes also understand audio, the two small ones work with a 128K-token context and the others with 256K, and the family handles more than 140 languages.

The licence matters if you build a product on it. Google’s model card lists Gemma 4 under Apache 2.0, which allows commercial use: you keep the licence and copyright notices and say which files you changed, and that’s about it.

Which size fits which Mac

Ollama’s library lists these downloads for Gemma 4:

Model Download size Context Fits
gemma4:e2b 4.6 to 7.5 GB 128K Mac mini M6
gemma4:e4b 6.6 to 9.5 GB 128K Mac mini M6
gemma4:12b 7.7 to 8.0 GB 256K Mac mini M6
gemma4:26b 16 to 19 GB 256K Mac Studio M5 Ultra
gemma4:31b 19 to 20 GB 256K Mac Studio M5 Ultra

The size is a range because Ollama offers more than one build of each model and picks one for your machine.

On the Mac mini M6 (16 GB of memory, 256 GB SSD), the pick is gemma4:12b. At about 8 GB it leaves room for macOS and for the work you do next to it, and it is the largest size with the full 256K context. Google’s own table puts the 4-bit version of the 12B model at about 6.7 GB of memory before the conversation is counted. If you want to keep Xcode, a browser and a build running at the same time, gemma4:e4b at 6.6 GB is the lighter choice. On disk, the three small sizes together take about 20 GB of the 256 GB.

On the Mac Studio M5 Ultra (96 GB of memory, 1 TB SSD), you can go to the top of the family. gemma4:31b is a 20 GB download in its standard 4-bit build, and Ollama also lists a higher-precision 8-bit build at 34 GB (gemma4:31b-it-q8_0) and a full-precision one at 63 GB (gemma4:31b-it-bf16), all inside 96 GB. The Mac Studio is coming soon to SoloRack: on the pricing page you can leave your email to be among the first to get one. Everything below works today on the Mac mini.

What you need

  • A cloud Mac. A SoloRack Mac mini M6 comes with 16 GB of memory, a 256 GB SSD, a 1 Gbit/s connection, an up-to-date macOS and your own macOS administrator account. The model download takes minutes on that connection.
  • Ollama, a free tool that downloads open models and runs them. It needs macOS 14 Sonoma or newer and uses the Mac’s graphics chip on Apple silicon.
  • For the tunnel in step 5: your public SSH key added in My account.

Step 1: install Ollama

Connect to your Mac with the remote desktop app, using the details in My account. In the browser on the Mac, open Ollama’s download page, download the macOS version, open the .dmg file and drag Ollama into Applications. That is the method Ollama’s documentation recommends.

Open Ollama from Applications. If it asks for permission to add the ollama command for Terminal, allow it: your account is an administrator. Ollama now runs in the background, with its icon in the menu bar.

Step 2: download and run Gemma 4

Open Terminal and run:

ollama run gemma4:12b

The first time, Ollama downloads the model, then shows a prompt. Type a question and press Return. Type /bye to leave the chat; the model stays on disk for next time.

A few commands you’ll use often:

ollama pull gemma4:e4b
ollama list
ollama ps
ollama rm gemma4:e4b

pull downloads a model without opening a chat, list shows the models on disk with their sizes, ps shows which model is loaded in memory right now, and rm deletes one to free space. Models and settings live in the .ollama folder of your home directory.

Step 3: give it an image

Gemma 4 reads images as well as text. In Ollama you put the path of the file in the prompt:

ollama run gemma4:12b "What is wrong with the layout in this screenshot? ./screenshot.png"

This is useful for work you already do on the Mac: a screenshot from the iOS Simulator, a design mock-up, a photo of an error on a device, a chart from a report. Ollama’s page for Gemma 4 lists text and images as inputs; the audio input from Google’s model card isn’t listed there.

Step 4: call it from your code

Ollama also runs a local API on the Mac, at http://localhost:11434. This is the example from Ollama’s own page, with the 12B model:

curl http://localhost:11434/api/chat \
  -d '{
    "model": "gemma4:12b",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

Ollama also answers in the format of the OpenAI API, at http://localhost:11434/v1/chat/completions. Many editors, coding assistants and libraries can talk to it: you set the base URL to http://localhost:11434/v1, the model to gemma4:12b, and any text as the API key, because Ollama doesn’t check it. Node.js and Python are already installed on the Mac, so a script that calls the model works straight away.

Step 5: use it from your own computer

The API listens on the Mac itself. To reach it from your Windows PC or laptop, open an SSH tunnel: take the SSH command from My account, which looks like ssh -p <port> <user>@connect.solorack.com, and add -L:

ssh -p <port> -L 11434:localhost:11434 <user>@connect.solorack.com

While that window stays open, http://localhost:11434 on your own computer is the model on your Mac. Point your editor, your scripts or a chat interface at it, exactly as in step 4. The traffic travels inside the encrypted SSH connection, and the model stays private to you: it is your personal assistant, reached only with your SSH key.

Step 6: keep it running

To have Ollama start by itself, add it to your login items: System Settings, General, Login Items & Extensions, then add Ollama under Open at Login. After a restart, even one you start from My account, the Mac goes back to your session by itself, so Ollama comes back with it. If you change your macOS password, set automatic login again with the new one, as your access email explains.

What people use a local Gemma for

  • Private code help. Ask it to explain, review or refactor code that you’d rather not paste into an online service.
  • A model for your agents. Always-on agents and automations can send their routine steps to the local model, with no cost per request.
  • App Store work. Draft descriptions, release notes and keywords, and translate them: the model handles more than 140 languages.
  • Reading screenshots. Check a screen from the Simulator against a design, or turn a photo of a form into structured text.
  • Long documents. With a 256K context, the 12B model can take a long log, a contract or a specification in one go.

You can keep more than one model on the Mac and switch between them with ollama run. And if your work grows into the larger sizes, the 26B and 31B models are what the Mac Studio is for.

Before your rental ends

At the end of a rental, your macOS account and all its files are deleted with no copy kept, and our reminders tell you in time. The models themselves are free to download again, so what you need to save is your own work: scripts, prompts, Modelfiles and anything the model produced for you.

Run Gemma 4 on your own Mac mini

A private AI model needs a machine that is yours for the whole time, with enough memory and nobody else on it. Rent a dedicated Mac mini M6 from SoloRack, from $3.73 a day on the monthly plan ($112 a month), with your own admin account, remote desktop and SSH. See the plans on our pricing page, and have Gemma 4 answering in a few minutes.

Try SoloRack from ⁦$3.73⁩ a day

A dedicated Mac mini M6 on the monthly plan: ⁦$112⁩ a month. Prices in US dollars, VAT included where it applies.

Before you pay

The email you enter on the payment page becomes your account: you sign in to My account with that same address.

Payment is handled by Stripe through Link, its payment service: the payment page shows Link's name, and your bank statement will show LINK.COM* SOLORACK.

They show us how the site is used, including recordings of your visit; what you type stays hidden (PostHog, Google Analytics). These tools use cookies and start only if you say yes. You can change your mind at any time from the bottom of the page. If you say no to statistics, we only count your visit, without cookies. Cookie policy