โ† Back to Course|Local AI Tools
๐Ÿฆ™
100% Free & Open SourceRuns Locally โ€” No Internet Needed

Ollama

Run powerful AI models on your own computer โ€” completely private, completely free

Ollama makes it as easy to run an AI model locally as installing any other app. One command to pull a model, one command to chat. Your data never leaves your machine โ€” no API keys, no usage limits, no monthly fees. Supports Llama 3, Mistral, Gemma, Phi-3, DeepSeek, and dozens more.

Cost
Free forever
Privacy
100% local
Internet
Not required
Platform
Mac, Win, Linux
RAM needed
8 GB min (16 GB+)
Website
ollama.com

โšก Install & Setup (5 minutes)

1
Download Ollama
Go to ollama.com โ†’ Download. Pick your OS. On Mac, drag Ollama.app to Applications. It adds a menu bar icon.
2
Pull your first model
Open Terminal and run: ollama pull llama3.2 โ€” this downloads the 2.0 GB Llama 3.2 3B model. For a bigger model: ollama pull llama3.1 (4.7 GB, much more capable).
3
Chat in terminal
Run: ollama run llama3.2 โ€” a chat prompt appears. Type your message and press Enter. Type /bye to exit.
4
Or use a GUI (optional)
Install Open WebUI for a ChatGPT-like browser interface: run the Docker command from openwebui.com. Connects to your local Ollama automatically.
# Quick start commands:
ollama pull llama3.2 ย ย ย ย ย # Download model (one time)
ollama run llama3.2 ย ย ย ย ย # Start chatting
ollama list ย ย ย ย ย ย ย ย ย ย ย ย # See downloaded models
ollama pull mistral ย ย ย ย ย # Download Mistral 7B

๐Ÿ“ฆ Recommended Models to Try

ModelSizeRAMBest for
llama3.22 GB8 GBFast chat, low-end hardware
llama3.14.7 GB8 GBGeneral purpose, good quality
llama3.1:70b40 GB64 GBNear GPT-4 quality, needs high-end Mac
mistral4.1 GB8 GBFast, strong coding tasks
deepseek-coder776 MB8 GBCode generation, very fast
phi3:mini2.3 GB8 GBLightweight, good reasoning
gemma2:2b1.6 GB8 GBGoogle model, very fast
codellama3.8 GB8 GBCode completion, works with editors

๐Ÿš€ Example: Chat + Code Assistance

Terminal Chat
$ ollama run llama3.1
>>> Write a Python function that parses a CSV file and returns a list of dicts

Here is a clean implementation:
def parse_csv(file_path: str) -> list[dict]:
ย ย ย ย with open(file_path, 'r') as f:
ย ย ย ย ย ย ย ย return list(csv.DictReader(f))
Use Ollama from Python
pip install ollama

import ollama

response = ollama.chat(
ย ย model='llama3.1',
ย ย messages=[{'role': 'user', 'content': 'Explain async/await in Python'}]
)
print(response['message']['content'])
Use with VS Code via Continue extension

Install the "Continue" extension in VS Code โ†’ set provider to Ollama โ†’ point to your local model. You now have free local AI completions in VS Code with no API costs.

๐Ÿ’ก Pro Tips

  • Apple Silicon Macs (M1/M2/M3/M4) run Ollama models fast using the GPU โ€” even 7B models feel snappy
  • Models are cached โ€” pulling is a one-time download. Running them requires no internet
  • Use Open WebUI (openwebui.com) for a full browser-based ChatGPT-like UI over your local models
  • Ollama exposes an OpenAI-compatible API at localhost:11434 โ€” swap it into any code that uses OpenAI
  • For max privacy: AI coding without any data leaving your machine โ€” perfect for confidential codebases
โ†’ Free Local AI 1-Pagerโ†’ Hugging Face Guideโ†’ Hardware Buying Guide