← Learning

Ollama

A linear, one-concept-per-lesson path through Ollama, running open-source LLMs on your own machine instead of a cloud API, from your first local generate call to a fully offline RAG agent. 24 lessons · 3 tiers.

Prerequisites: Completion of LangChain & Agent Building through Lesson 11 (init_chat_model), where the model behind an agent was already shown to be swappable. Every other course in this repo calls Gemini over the network; this one builds the same kinds of agents, generate calls, tool-calling loops, and RAG, against a model running locally.

No GOOGLE_API_KEY needed at all: every lesson calls a model running locally via Ollama (llama3.2 by default), not a cloud API. Setup needs the Ollama application installed separately (not a Python package) from ollama.com/download, plus `ollama pull llama3.2` before starting. Lessons 8 and 21 also use a small local embedding model, nomic-embed-text.

Built on Ollama, the local model runtime this course teaches.

Course source

Every lesson's README and lesson.py for this course live in the ai-agent-engineering repo.

View on GitHub →
Ollama

Beginner

Running and calling a local model: generate, chat, streaming, embeddings.

  1. 01What Is OllamaGitHub
  2. 02Installing and Pulling ModelsGitHub
  3. 03First Generate CallGitHub
  4. 04Chat vs GenerateGitHub
  5. 05Streaming ResponsesGitHub
  6. 06Model ParametersGitHub
  7. 07Listing and Managing ModelsGitHub
  8. 08Embeddings With OllamaGitHub
  9. 09Checkpoint: Streaming Chatbot, Fully OfflineGitHub

Intermediate

Structured output, tool calling, and swapping into LangChain or Pydantic AI.

  1. 10Structured OutputGitHub
  2. 11Tool Calling With OllamaGitHub
  3. 12Multi-Turn MemoryGitHub
  4. 13Swapping Into LangChainGitHub
  5. 14Swapping Into Pydantic AIGitHub
  6. 15Comparing ModelsGitHub
  7. 16Custom Models With ModelfileGitHub
  8. 17Checkpoint: Tool-Calling Local AgentGitHub

Advanced

Hardware, context limits, concurrency, local RAG, and production concerns.

  1. 18GPU vs CPU and QuantizationGitHub
  2. 19Context Window ManagementGitHub
  3. 20Concurrent RequestsGitHub
  4. 21Local RAG With OllamaGitHub
  5. 22Running as a Background ServiceGitHub
  6. 23Security and Network ExposureGitHub
  7. 24Capstone: Fully Offline RAG AgentGitHub
Start at Lesson 1

Contact

Book a Call