Run Gemma 4 12B locally with Ollama
Run Google's Gemma 4 12B on your own computer with Ollama in 20 minutes, then chat, ask about images and connect your apps, with no API bills.

What you need
Ollama needs macOS 14 Sonoma or newer, and Intel Macs run models on the CPU only. On Windows, it needs Windows 10 22H2 or newer.
Step 1: Install Ollama
3 minOllama downloads, runs and serves local models, and the commands are the same on every system.
- Go to ollama.com/download and pick your system.
- Mac: open the disk image, drag Ollama into Applications and open it. Windows: run OllamaSetup.exe.
- Linux: run the install command below in a terminal.
- Open a new terminal window and run
ollama lsto check that the command works.
Linux: run thiscurl -fsSL https://ollama.com/install.sh | sh
You should see a header row with no models under it yet, and no error.
The terminal says it can't find the ollama command?
On a Mac, open the Ollama app once and let it link the command to
/usr/local/bin. Then open a new terminal window and try again.Step 2: Download Gemma 4 12B
8 minYou download the model once. After that, every chat runs on your machine, even offline.
- Run the command below.
- Wait for the download to finish. It's about 8 GB, so it can take a few minutes.
Run thisollama pull gemma4:12b
You should see a progress bar that fills up and finishes without an error.
Your main drive is running out of space?
Models are saved in
~/.ollama/modelson a Mac. Set theOLLAMA_MODELSvariable to keep them on another drive, then pull the model again.Type the
:12btag. Plaingemma4pulls the smaller E4B model instead.Step 3: Chat in the terminal
3 minA short test shows the model runs before you add images or apps.
- Run the command below to open a chat.
- At the
>>>prompt, type a short question and press Enter. - In a second terminal window, run
ollama psto see where the model is loaded.
Run thisollama run gemma4:12b
You should see a reply in the terminal, and
gemma4:12blisted byollama ps.Replies come out very slowly?
Check the
PROCESSORcolumn inollama ps.100% CPUmeans the model didn't load onto your GPU. Close other apps, or try the smallergemma4:e4b.Step 4: Ask about an image
3 minGemma 4 reads images, so it can describe screenshots, charts and photos without sending them anywhere.
- Write your question and put the image's full path at the end, inside the quotes.
- Run it as one command, as in the example below.
Run thisollama run gemma4:12b "What does this chart show? [PATH TO YOUR IMAGE]"
You should see a description of your image, written by the model on your own computer.
It answers without looking at the image?
Use the full path, such as
/Users/you/Desktop/chart.png, and check the file name. Keep the path inside the same quotes as the question.Google says the 12B model also understands audio. Ollama lists this tag for text and image input only.
Step 5: Connect an app to Gemma
3 minOllama serves an OpenAI-compatible API, so most apps with an OpenAI option can use Gemma.
- Keep the Ollama app open, or run
ollama servein a terminal. - In your app's OpenAI or custom provider settings, set the base URL to
http://localhost:11434/v1/. - Set the model to
gemma4:12b. If the app asks for an API key, typeollama. - To test the connection, run the command below.
Test it (Mac or Linux)curl http://localhost:11434/v1/chat/completions -H "Content-Type: application/json" -d '{"model": "gemma4:12b", "messages": [{"role": "user", "content": "Say hello in 5 words."}]}'You should see a JSON reply with Gemma's answer in the
contentfield.The app can't connect?
Check that Ollama is running and that the URL ends in
/v1/. Ollama only listens on this computer by default, so the app must run here too.Ollama ignores the API key. Never paste a real OpenAI key into this field or into shared config files.
- Keep the Ollama app open, or run
You get
Gemma 4 12B running on your own computer, with chat, image questions and a local API for your apps
Try next
Did this guide work for you?
Thanks. It helps us fix the steps.
Sources
0 of 5Next: Install Ollama


