← Back to all posts

Run AI Models Locally with Ollama: Greener, Faster, Private

5 min read

Every time you fire a prompt at ChatGPT or Claude, the request travels to a data center, wakes up a cluster of A100 or H100 GPUs, and burns electricity to generate your answer. You pay for it in subscription fees; the planet pays for it in carbon. But there is a practical alternative: run the model yourself, on the hardware sitting on your desk.

That is what Ollama is for. It is a free, open-source tool that packages popular open-weight models (Llama 3, Mistral, Gemma, Phi, and many more) into a single binary that runs on Mac, Linux, and Windows. No API key. No monthly bill. No data leaving your machine.

Why Local Models Are Greener

Cloud AI is efficient at scale, but it carries overhead you never see:

  • Network round-trips consume energy on routers, switches, and CDN nodes between you and the data center.
  • Cold-start inference means the provider must keep GPUs partially warm to respond in milliseconds, even between your prompts.
  • Grid intensity varies. Your laptop charges from whatever is on your local grid. Many data centers are still on coal-heavy power.

When you run a quantized model locally, you use the efficient neural-engine or GPU already built into your machine and eliminate the transmission overhead entirely. For repetitive, low-complexity tasks like summarizing notes, drafting short emails, or running a coding assistant, a local 8B model can match cloud quality at a fraction of the energy cost.

Quick benchmark:

Llama 3 8B running on a MacBook M3 Pro draws roughly 15-25 W during inference. A comparable cloud API call routes through hardware drawing thousands of watts, shared across many users but still contributing to your personal usage footprint.

Getting Started with Ollama

Installation takes about two minutes.

1. Install Ollama

On macOS or Linux, paste this into your terminal:

curl -fsSL https://ollama.com/install.sh | sh

On Windows, download the installer from ollama.com/download.

2. Pull a Model

Think of this like docker pull but for AI models. Start with Llama 3.2 (3B), which is small enough to run on any modern laptop:

ollama pull llama3.2

For a more capable model that still fits comfortably on 16 GB of RAM:

ollama pull llama3.1:8b

3. Chat with It

ollama run llama3.2

That opens an interactive chat session in your terminal. Type your prompt, press Enter, and the model responds entirely on your device.

4. Use It as an API

Ollama also exposes a local REST API that is compatible with the OpenAI format, so you can swap it into existing code with one line change:

curl http://localhost:11434/api/chat -d '{
  "model": "llama3.2",
  "messages": [{"role": "user", "content": "Explain quantum tunneling simply"}]
}'

Which Model Should You Use?

The right model depends on your hardware and use case. Here is a practical starting point:

Model Size RAM needed Best for
llama3.2:3b 3B params 4 GB Quick summaries, short chat
llama3.1:8b 8B params 8 GB Coding, drafting, Q&A
mistral:7b 7B params 8 GB Fast, efficient, great RAG
phi3:14b 14B params 12 GB Complex reasoning, analysis
llama3.1:70b 70B params 48 GB Near-GPT-4 quality tasks

If you have an Apple Silicon Mac (M1 or later), all of these models run well because the unified memory architecture means the GPU and CPU share the same RAM pool. A 16 GB M3 MacBook Air can comfortably run an 8B model and still have room for your other apps.

Add a UI: Open WebUI

The terminal interface is fine for developers, but if you want a ChatGPT-style browser UI that talks to your local Ollama instance, Open WebUI is the standard choice. With Docker installed:

docker run -d -p 3000:8080 \
  --add-host=host.docker.internal:host-gateway \
  -v open-webui:/app/backend/data \
  --name open-webui \
  ghcr.io/open-webui/open-webui:main

Open localhost:3000 in your browser and you have a full chat interface, model switcher, conversation history, and even RAG (retrieval-augmented generation) support over your own documents.

The Privacy Advantage

Beyond sustainability, local models solve a problem many teams overlook: data leaves your machine when you use a cloud API. For sensitive documents (legal contracts, medical records, unreleased code), sending text to a third-party API is a compliance risk.

With Ollama, the model and your data stay on the same machine. Nothing is logged on a remote server. This makes it useful for internal tooling at companies that have data residency or privacy requirements.

When to Stick with Cloud APIs

Local models are not always the right answer. Use a cloud API when:

  • You need the very latest frontier model quality (GPT-4o, Claude 3.7 Opus, Gemini 2.0 Ultra).
  • The task requires a context window larger than 32K tokens.
  • You are running on memory-constrained hardware (under 8 GB RAM).
  • You need multimodal input (video, audio) that is not yet practical on local hardware.

Think of local models and cloud APIs as complementary, not competing. Use Ollama for the 80% of everyday tasks, and reach for the cloud API for the 20% that genuinely needs frontier capability. Your running costs drop, your carbon footprint drops, and your workflow stays private by default.

Want to see your actual footprint?

Use our AI Impact Calculator to compare the carbon cost of your current cloud AI usage against what running a local model would look like. The difference is often larger than you expect.

9865900589
Ad Space (Placeholder)Configure specific slot ID for manual placement

Want to measure your own impact?

Use our free calculator to estimate your carbon footprint.

Go to Calculator