# Running Open-Weight Models Locally

> Use Ollama and similar tools to run open models on your own machine for privacy, offline work, experimentation and cheap iteration. Free notes, key concepts,...

Canonical: https://www.internhack.in/roadmaps/tracks/ai-engineer/open-weight-models
Last updated: 2026-11-28

Use Ollama and similar tools to run open models on your own machine for privacy, offline work, experimentation and cheap iteration.

Beginner · about 4 hours · difficulty 2/5

Learn first: [Messages APIs and Provider SDKs](https://www.internhack.in/roadmaps/tracks/ai-engineer/first-api-calls), [The Model Landscape and Choosing a Model](https://www.internhack.in/roadmaps/tracks/ai-engineer/choosing-models)

Open-weight models can be downloaded and run anywhere. For development, **Ollama** (and alternatives such as LM Studio or llama.cpp) makes it a one-command job, and exposes a local API, including an OpenAI-compatible endpoint, so your code barely changes.

### Key ideas

- **Parameter count and memory**: a model's size determines how much RAM or VRAM it needs. Rule of thumb at 16-bit precision: about 2 bytes per parameter.
- **Quantization**: storing weights in 8, 5 or 4 bits shrinks memory needs dramatically with modest quality loss. File formats like GGUF are built for this.
- **Hardware**: Apple Silicon, consumer GPUs and even CPUs can run small models; larger ones need serious GPUs.
- **Licenses**: open weights are not always open source; check commercial use terms.

### When local models make sense

- Sensitive data that must not leave the machine or network.
- Offline or edge scenarios.
- High-volume simple tasks (classification, extraction) where a small model is good enough.
- Learning how models behave without paying per token.

### Limits

Small local models are noticeably weaker at complex reasoning and tool use than frontier models. For production serving at scale you will use a dedicated inference server like vLLM (covered later), not a desktop tool.

### Good enough to move on

You can run an open model locally, call it from your code through its API, and compare its quality and speed with a hosted model on a small task.

## Key concepts

- **Ollama**
- **LM Studio / llama.cpp**
- **Model size and memory math**
- **Quantization and GGUF**
- **OpenAI-compatible local endpoints**
- **Open model licenses**
- **Hugging Face Hub**

## Mini project

Run a small open model with Ollama and point your earlier terminal chatbot at it through its compatible API; compare answers, latency and memory usage with a hosted model on 10 prompts.

## Check yourself

Roughly how much memory does a 7-billion-parameter model need at 16-bit precision and at 4-bit quantization?

## Free resources

- [Ollama](https://ollama.com/) (Ollama)
- [Ollama on GitHub](https://github.com/ollama/ollama) (GitHub)
- [Hugging Face Hub documentation](https://huggingface.co/docs/hub/index) (Hugging Face)

Previous: [Rate Limits, Errors and Cost Awareness](https://www.internhack.in/roadmaps/tracks/ai-engineer/rate-limits-and-cost) · Next: [Clear Instructions and System Prompts](https://www.internhack.in/roadmaps/tracks/ai-engineer/prompt-fundamentals)

## More in Working with Model APIs

- [Messages APIs and Provider SDKs](https://www.internhack.in/roadmaps/tracks/ai-engineer/first-api-calls)
- [Streaming Responses](https://www.internhack.in/roadmaps/tracks/ai-engineer/streaming-responses)
- [Structured Outputs and JSON Schema](https://www.internhack.in/roadmaps/tracks/ai-engineer/structured-outputs)
- [Tool and Function Calling](https://www.internhack.in/roadmaps/tracks/ai-engineer/tool-calling)
- [Prompt Caching and Batch Processing](https://www.internhack.in/roadmaps/tracks/ai-engineer/prompt-caching-batching)
- [Rate Limits, Errors and Cost Awareness](https://www.internhack.in/roadmaps/tracks/ai-engineer/rate-limits-and-cost)
- [Running Open-Weight Models Locally](https://www.internhack.in/roadmaps/tracks/ai-engineer/open-weight-models)

## Related

- [Roadmaps](https://www.internhack.in/roadmaps)
- [AI Engineer Roadmap](https://www.internhack.in/roadmaps/tracks/ai-engineer)
