Local LLMs with Ollama & llama.cpp
Run open-weight LLMs on your own machine with Ollama and llama.cpp: GGUF, quantization, APIs, RAG, tool calling, tuning and security.
Learn Local LLMs with Ollama & llama.cpp free, in English or Hindi, with lessons, shorts and interview questions.
Start course → · Interview questions
30 lessons · 10 modules · Free
What you'll learn
- Explain how local inference works: tokens, prefill and decode, the KV cache and why memory bandwidth limits speed.
- Choose a model family, size and GGUF quantization level that fits your RAM or VRAM and your task.
- Run and customize models with the Ollama CLI, Modelfiles, sampling parameters and chat templates.
- Call local models from code through the Ollama REST API, its Python library and OpenAI-compatible endpoints.
- Build and serve models directly with llama.cpp, llama-cli and llama-server.
- Build structured-output, RAG and tool-calling applications that run fully offline.
- Tune memory, GPU offload and concurrency, and deploy a local LLM server securely.
Syllabus
Why Run LLMs Locally
- What Local LLMs Are and Why They Matter
- The Mental Model: Tokens, Weights and Inference
- Hardware Basics: RAM, VRAM and Bandwidth
Model Files, GGUF and Quantization
- Weights, Parameters and Model Families
- The GGUF File Format
- Quantization Levels and Trade-offs
Getting Started with Ollama
- Installing Ollama and the Server Model
- Everyday Ollama CLI Commands
- Choosing Models from the Library
Customizing Models with Modelfiles
- Modelfile Basics: FROM, SYSTEM and PARAMETER
- Sampling Parameters: Temperature, top_p and Friends
- Chat Templates and Special Tokens
Programming Against the Ollama API
- The REST API: generate, chat and streaming
- The Official Python Library
- OpenAI-Compatible Endpoints
Working Directly with llama.cpp
- What llama.cpp Is and How to Build It
- llama-cli and the Core Flags
- llama-server: HTTP, Web UI and Parallel Slots
Building Applications on Local Models
- Structured Output with JSON Schemas
- Embeddings and Local RAG
- Tool Calling with Local Models
Performance Tuning and Memory
- Memory Math: Weights plus KV Cache
- GPU Offload and CPU/GPU Splits
- Context, Keep-Alive and Concurrency Settings
Deployment, Security and Pitfalls
- Running Local LLMs in Docker and on a Team Server
- Securing Local Inference
- Common Pitfalls and Evaluating Quality
Revision and Interview Prep
- Cheat Sheet: Local LLMs in One Page
- Common Interview and Exam Questions
- Mixed Self-Check