Course outline▾
Week 1 · The Foundations
- Day 1Demystifying AI — From Buzzword to Business Logic
- Day 2How Machines Actually Learn — Supervised, Unsupervised and Reinforcement Learning
- Day 3Inside Neural Networks — The Engine of Modern Deep Learning
- Day 4The AI Project Lifecycle — From Raw Data to Production Deployment
- Day 5The Math Behind the Magic — Why Linear Algebra and Probability Matter
- Day 6Data Preprocessing — Cleaning the Messy Reality of Enterprise Data
- Day 7Measuring Success — Understanding Accuracy, Precision, Recall and F1 Scores
Week 2 · Applied AI & APIs
- Day 8Introduction to LLMs & The Modern AI API Landscape
- Day 9Advanced Prompt Engineering — Few-Shot, Chain-of-Thought and Structured JSON
- Day 10Tokenization, Context Windows and Cost Optimization
- Day 11Embeddings and Vector Representations — How Machines Map Meaning
- Day 12Vector Databases — Storing and Searching Enterprise Knowledge
- Day 13Retrieval-Augmented Generation (RAG) — Chatting with Proprietary Documents
- Day 14RAG Evaluation and Hallucination Guardrails
Week 3 · Infrastructure & Hosting
- Day 15Introduction to AI Infrastructure — Hardware, Runtimes and Compute
- Day 16Local Model Execution — Running Open-Weight LLMs Securely with Ollama and vLLM
- Day 17Containerizing AI Workloads: Writing Production Dockerfiles for Python APIsComing soon · 2026-10-17 · 7 PM IST
- Day 18Docker Compose for Multi-Container AI Stacks (Web UI, Vector DB, LLM Engine)Coming soon · 2026-10-18 · 7 PM IST
- Day 19Kubernetes for AI 101: Pods, Deployments, and Services for Model ServingComing soon · 2026-10-19 · 7 PM IST
- Day 20Persistent Storage in Kubernetes: Managing State, Weights, and Vector IndicesComing soon · 2026-10-20 · 7 PM IST
- Day 21High-Performance Networking: Configuring Ingress and Egress for AI ClustersComing soon · 2026-10-21 · 7 PM IST
Week 4 · Enterprise Workflows
- Day 22Autonomous Agents: From Passive LLMs to Goal-Driven ExecutionComing soon · 2026-10-22 · 7 PM IST
- Day 23Tool Use & Function Calling: Connecting LLMs to APIs, Databases, and ShellsComing soon · 2026-10-23 · 7 PM IST
- Day 24Multi-Agent Orchestration: Supervisor, Worker, and Evaluator PatternsComing soon · 2026-10-24 · 7 PM IST
- Day 25Automated CI/CD: Automating the Software Lifecycle for AI ModelsComing soon · 2026-10-25 · 7 PM IST
- Day 26Zero-Trust Security for AI: Sandboxing Ephemeral Execution & Model EgressComing soon · 2026-10-26 · 7 PM IST
- Day 27Observability & Tracing for Agentic Systems (Telemetry, Logs, and Metrics)Coming soon · 2026-10-27 · 7 PM IST
- Day 28Human-in-the-Loop Architecture: Machine Second, Human First in PracticeComing soon · 2026-10-28 · 7 PM IST
- Day 29Managing Technical Debt, Drift, and Model Governance in Enterprise ITComing soon · 2026-10-29 · 7 PM IST
- Day 30The 10-Year Horizon: Architecting IT Strategy for the AI-Native EnterpriseComing soon · 2026-10-30 · 7 PM IST
Day 16: Local Model Execution — Running Open-Weight LLMs Securely with Ollama and vLLM
2026-10-16 · 9 min read
Relying only on commercial cloud APIs carries real exposure: vendor lock-in, recurring cost for every token, rate limits, and the need to send sensitive intellectual property across public networks. Running an open-weight model such as Llama 3, Mistral or Gemma 2 on your own infrastructure addresses each of those. The price is that you now operate the hardware, so choosing the right runtime matters.
In plain terms: Ordering from a restaurant is easy, but you pay per dish, you queue at busy hours, and the restaurant sees what you ate. Cooking at home means buying the stove, and in return the menu, the speed and the privacy are yours.
1. Prototyping and edge: Ollama and llama.cpp
On a workstation, a laptop or an edge box with limited memory (a 16 GB machine is a typical target), a plain Python script adds overhead you do not want. Ollama is built on llama.cpp, a lean C and C++ engine, so it avoids most of that Python overhead.
- GGUF quantization: Ollama runs models stored in the GGUF format, usually at 4-bit or 8-bit precision. That shrinks multi-gigabyte weights enough to fit in ordinary RAM or a modest GPU, with a small loss in quality for most tasks. Check the quality on your own prompts.
- Operational simplicity: it runs a local service and handles downloading models, spreading them across GPU and CPU memory, and formatting prompts. It exposes an OpenAI-compatible REST API at
http://localhost:11434.
2. High-throughput serving: vLLM
When hundreds of users hit the same model at once, handling requests one after another creates a queue. vLLM is a serving engine built for that case, with two key ideas.
PagedAttention. Older engines reserve one contiguous block of KV-cache memory per request, sized for the longest possible reply, so much of it sits empty. The vLLM authors measured 60 to 80% waste in earlier systems. PagedAttention borrows the idea of virtual-memory paging from operating systems and splits the cache into small blocks that are handed out as a request grows.
Continuous batching. A static batch must finish completely before new requests are accepted, so slots sit idle while the longest reply completes. vLLM slips new requests into the running batch at the token level. Reported gains are commonly 2x to 4x higher throughput than basic pipelines, but the real figure depends on your model, hardware and traffic.
Which one should you pick?
Here is how little your application code changes. Both engines speak an OpenAI-style API, so you can point the same client at either one. This assumes you have installed Ollama and pulled a model, or started a vLLM server.
# Ollama: pull and chat with a quantized 8B model in one command
ollama run llama3.1:8b
# vLLM: serve a model with an OpenAI-compatible API on port 8000 (needs an NVIDIA GPU)
vllm serve Qwen/Qwen2.5-7B-Instruct
from openai import OpenAI
# Same client, different base_url. Ollama listens on 11434, vLLM on 8000.
client = OpenAI(base_url="http://localhost:11434/v1", api_key="not-needed")
reply = client.chat.completions.create(
model="llama3.1:8b",
messages=[{"role": "user", "content": "Summarise RAG in one sentence."}],
)
print(reply.choices[0].message.content)
Self-hosting turns an LLM from an outside cost center into a private utility inside your own network boundary. The next lessons package it properly, starting with containers.
Coming Up Next
Day 17: Containerizing AI workloads: writing production Dockerfiles for Python APIs.