Ollama & Local AI Setup
Why and how to run AI models on your own hardware instead of a hosted API — the concepts, not a copy-paste terminal session.
Why run AI locally
- Data privacy — prompts and documents never leave your machine or network, which matters for regulated, confidential, or classified data.
- Offline / air-gapped use — works without internet access, useful for secure environments or field work.
- Cost predictability — no per-token API billing; the cost is the hardware you already own.
- Latency — no network round-trip to a remote API.
- Control — you choose exactly which model version runs, with no silent updates or provider-side changes.
The trade-off: locally-runnable models are generally smaller and less capable than the largest hosted frontier models, and you're responsible for the hardware, updates, and security of the stack yourself.
What Ollama is
Ollama is a runtime for downloading and running open-weight language models on your own machine. It handles the pieces that used to require significant manual setup: fetching model weights, managing quantized versions sized for consumer hardware, and exposing a simple local API and command-line interface for chatting with or scripting against the model. It's one of several tools in this space (others include LM Studio and llama.cpp directly), but it's become a popular default because of its simplicity.
Hardware considerations
- Memory matters more than raw CPU speed. A model needs enough RAM (or VRAM, if using a GPU) to hold its weights. A 7-8B parameter model at 4-bit quantization needs roughly 4-6 GB; a 70B model needs upwards of 40 GB even quantized.
- GPUs accelerate inference dramatically but aren't strictly required — modern CPUs can run smaller models at usable speeds, just slower than a GPU would.
- Quantization is the key lever for fitting a model into limited hardware: reducing weight precision (e.g. 16-bit down to 4-bit) shrinks memory needs substantially with a modest accuracy trade-off. See Quantization in the AI Glossary.
- Disk space adds up quickly if you keep multiple models around — each is several gigabytes.
The general setup flow
Regardless of which local AI tool you choose, the flow is conceptually the same:
- 1. Install the runtime for your operating system (macOS, Linux, or Windows).
- 2. Pull a model from the tool's model library — this downloads the quantized weights to your machine.
- 3. Run it interactively to chat with the model directly from the command line or a bundled UI.
- 4. Call it from your own scripts via the local API it exposes (typically an HTTP endpoint on localhost), so you can build tools, integrate it into workflows, or connect it to other software the same way you'd call any AI API — just pointed at your own machine instead of a remote provider.
- 5. (Optional) add a chat UI — several open-source web interfaces can sit in front of a local model runtime for a more polished chat experience.
Choosing a model to run locally
- Start with a small model (a few billion parameters) to confirm your setup works before trying larger ones.
- Match model size to your available RAM/VRAM — check the quantized size before pulling.
- Pick a model with a license that fits your intended use (some open-weight licenses restrict large-scale commercial use).
- Consider domain-specific fine-tunes if your task is narrow (e.g. code-focused models for a coding assistant).
Security & privacy benefits
Because inference happens entirely on hardware you control, local AI is well suited to:
- Working with regulated data (health, financial, legal) without a third-party data processing relationship.
- Air-gapped or classified environments with no external network access.
- Private document Q&A over sensitive internal material, without that material ever being sent to an external API.
- Secure code review where source code cannot leave the organization's infrastructure.
That said, "local" doesn't automatically mean "secure" — the runtime, any exposed local API, and the machine itself still need normal security hygiene (patching, network exposure control, access management) like any other service.
Limitations to plan around
- Locally-runnable models generally trail the largest hosted frontier models on complex reasoning tasks.
- No built-in internet access or external tool use unless you explicitly wire it up.
- You own the operational burden: updates, hardware failures, and scaling are your responsibility.
- Multi-user or high-throughput scenarios need real capacity planning, not just a laptop.