Local LLM Engineering with Ollama & llama.cpp
From GGUF to Production Inference
What you'll learn
Running a language model on your own hardware has gone from a hobby to a serious engineering option. You get data that never leaves your network, predictable cost, offline operation, and full control over the model. But "ollama run" is where most people stop, and production needs much more: knowing why a model is slow, why it ran out of memory, which quantization to pick, how to get valid JSON every time, how to serve 20 concurrent users, and how to put an adapter you trained into production.
This course teaches the whole local inference stack from first principles:
- What the hardware is actually doing: tokens, the KV cache, memory math, and why decode speed is set by memory bandwidth.
- Ollama in depth: CLI, server configuration, the REST API, structured outputs, tool calling, Modelfiles and templates.
- llama.cpp in depth: building for your GPU, the GGUF format byte by byte, quantization (k-quants, i-quants, imatrix) measured with perplexity and KL divergence, sampling and grammars, and performance tuning (offload, flash attention, KV-cache quantization, speculative decoding, parallel slots).
- Production: OpenAI-compatible serving, TLS and authentication, systemd and Docker, metrics, load testing, and security (exposed inference servers are a real and recurring incident class).
- Customization: LoRA fine-tuning, merging, converting to GGUF, and deploying with Ollama or llama-server.
Every lab runs on a laptop. A GPU makes it faster but is not required, and a bundled mock server lets all client code run without any model.
Learning outcomes
By the end of the course, you can:
- Estimate memory and speed for any model/quantization/context/hardware combination, and explain the estimates (KV cache, memory bandwidth).
- Operate Ollama as a service: configure context, parallelism, keep-alive, model storage and the KV cache type, and troubleshoot GPU offload.
- Integrate local models through the Ollama and OpenAI-compatible APIs, with streaming, structured outputs, tool calling and embeddings.
- Package models with Modelfiles: system prompts, parameters, chat templates, few-shot messages, adapters.
- Build llama.cpp for CPU/CUDA/Metal/Vulkan/ROCm and use its tools (
llama-cli,llama-server,llama-bench,llama-quantize,llama-perplexity). - Explain the GGUF format, convert Hugging Face models, and choose quantizations based on measured quality (perplexity, KL divergence) and size.
- Control generation with sampling parameters and grammar or JSON-schema constraints.
- Tune performance with GPU offload, flash attention, KV-cache quantization, batching, threads and speculative decoding, and benchmark correctly.
- Deploy a secure, observable, load-tested local inference service.
- Fine-tune a model with LoRA and ship it through GGUF to Ollama or llama-server.
Who it's for
- Developers and DevOps/platform engineers who need to run LLMs on-premises or on edge devices
- Engineers building products on local models (assistants, extraction, coding tools, RAG)
- Technical leads evaluating "local vs API" with real numbers
Prerequisites
Comfortable on the command line; basic Python; basic understanding of HTTP APIs. No ML background needed.
Equipment and software
| You have | You can do |
|---|---|
| 8 GB RAM, no GPU | Everything with 0.5–3B models; quantization and fine-tuning labs with Qwen2.5-0.5B (slow but fine) |
| 16 GB RAM or Apple Silicon 16 GB | Comfortable with 7–8B models at Q4 |
| NVIDIA/AMD GPU ≥ 8 GB VRAM | All labs fast; GPU builds in Module 5 |
| ≥ 50 GB free disk | Recommended (models + llama.cpp build + quantization ladder) |
The full setup guide, with verification steps, is in your learning materials when you enroll.
Format and study time
40 guided hours (10 modules × 4 h) plus ~12 h capstone. Instructor-led cohort, 5-day intensive, or self-paced with office hours.
| Format | Schedule | Contact hours |
|---|---|---|
| A. Part-time cohort | 10 weekly 4-hour sessions + Demo Day in week 11 | 40 |
| B. Intensive | 5 days × 8 h (2 modules/day); capstone due 2 weeks later | 40 |
| C. Self-paced + office hours | 10–12 weeks, weekly 1-hour office hours | ~40 + 12 |
Each scheduled class below states its own format, every meeting date and time, and its time zone.
What a seat includes
| Component | Detail |
|---|---|
| 10 instructor-led modules | ~40 h of teaching: lecture notes, slide decks, labs, quizzes |
| Lab toolkit | Memory/speed calculator, pure-Python GGUF inspector, sampling playground, benchmark and load-test harnesses, mock LLM server, 21 unit tests |
| Deployment kit | Docker Compose (llama-server + Ollama + Caddy TLS/auth), systemd units, Prometheus config |
| Fine-tuning kit | Dataset builder, transparent LoRA training loop, merge → GGUF → Ollama pipeline |
| Assessment suite | 10 quizzes, a final exam with marking guides, a capstone with a 100-point rubric |
| Verifiable certificate | PDF certificate with registry-backed verification |
| Curated sources | Papers (LLaMA, GPTQ, AWQ, LoRA, FlashAttention, speculative decoding...) and official docs |
| Instructor kit | Run sheets, demo scripts, expected results, troubleshooting, grading workflow |
Curriculum
- 01How LLMs run locally: tokens, KV cache, memory & speed4 h · Lab: Memory/speed predictions for 3 models, checked against reality
- 02Ollama fundamentals: CLI, server & configuration4 h · Lab: A configured Ollama service + a troubleshooting log
- 03The Ollama API: streaming, JSON, tools, embeddings4 h · Lab: A tool-calling, schema-validated client
- 04Modelfiles, templates & packaging4 h · Lab: Three custom models, including an imported GGUF
- 05llama.cpp from source4 h · Lab: A GPU-accelerated build + a llama-server smoke test
- 06GGUF & quantization, measured4 h · Lab: A quantization ladder with perplexity/KLD vs size
- 07Sampling, grammars & structured output4 h · Lab: Sampling experiments + 100% valid JSON extraction
- 08Performance engineering4 h · Lab: A tuning report with before/after benchmarks
- 09Serving in production4 h · Lab: A TLS + auth deployment, load-tested, with metrics
- 10Fine-tune to deploy (LoRA → GGUF → Ollama)4 h · Lab: A fine-tuned model served locally, evaluated against its base
- ★Capstone clinic & demo dayLab: Capstone project
Assessment and completion
| Component | Weight |
|---|---|
| Labs (10 × 4%) | 40% |
| Quizzes (10 × 1.5%) | 15% |
| Final exam | 15% |
| Capstone | 30% |
| Outcome | Requirement |
|---|---|
| Distinction | ≥ 90% overall + the capstone Distinction criteria |
| Merit | ≥ 80% overall |
| Pass | ≥ 70% overall, capstone ≥ 70, ≥ 8 labs submitted, ≥ 80% attendance (A/B) |
Simply opening a lesson or a video never counts as completing an assessment. Completion is recorded only when the published requirements are met and your instructor has confirmed the result.
Course outcomes and recognition. Each course page explains the training and assessment it includes. Any RNK Academy completion certificate records the course requirements you met. It does not by itself establish an accredited qualification, professional license or third-party credential.
Course policies
- Late work: −10%/day for up to 3 days; one free 48-hour extension.
- Hardware fairness: grading never rewards owning faster hardware. Labs are graded on method, correctness and explanation; absolute speeds don't matter.
- AI assistants: allowed with disclosure; you must be able to explain your work. Fabricated measurements are misconduct.
- Licenses: download only models whose licenses you accept; note them in reports.
- Safety: don't expose lab servers to the internet; follow Module 2/9 security rules even in labs.
- Accessibility: searchable PDF materials (Markdown sources available on request); accommodations on request.
Upcoming classes
No classes for this course are scheduled right now
New classes are added as instructors and dates are confirmed. Browse the courses to see what each one covers, or ask us about upcoming dates.