Module 4: Ollama - Introduction

Module 4: Ollama - Introduction

What will you learn in this module?

In Module 3 you used LM Studio (local GUI). Now you'll learn Ollama, a professional CLI tool for running LLMs locally in production.

Ollama vs LM Studio:

  • ✅ CLI (vs GUI) → Automatable, CI/CD
  • ✅ Docker support → Containerization, deploy
  • ✅ Powerful model management → Pull, push, versioning
  • ✅ Production-ready → Servers, clustering

By the end, you'll have Ollama running on your machine and you'll understand when to use CLI vs GUI.


🎯 Module goal

Master Ollama: From CLI to production

Deliverables:

  1. Ollama installed (Mac/Linux/Windows)
  2. Models downloaded via CLI
  3. A REST API running (OpenAI-compatible)
  4. A chatbot with Ollama + Docker

Final project: Deploy a chatbot in Docker with Ollama


📋 Module structure

Phase 1: Setup (capsules 1-3)

  • 01: Module introduction
  • 02: Installing the Ollama CLI
  • 03: Model management (pull, list, remove)

Phase 2: Use (capsules 4-5)

  • 04: Local REST API
  • 05: Integration with Python

Phase 3: Production (capsules 6-7)

  • 06: Docker deployment
  • 07: Performance tuning

Phase 4: Project (capsule 8)

  • 08: Mini-project - Chatbot in Docker

🔗 Connections with other modules

Prerequisite:

  • Module 3 (LM Studio): Concepts of local LLMs

Comparison:

  • LM Studio: GUI, development, laptop
  • Ollama: CLI, production, servers

Next:

  • Module 5 (OpenRouter): Multi-provider cloud

⏱️ Estimated time

Total: 3-4 hours

Breakdown:

  • Setup: 30 min
  • Model management: 30 min
  • API integration: 1 hour
  • Docker: 1 hour
  • Project: 1 hour

🛠️ Skills you'll develop

Technical:

  1. Ollama CLI:

    • Basic commands (pull, run, list)
    • Model management
    • API server
  2. Docker:

    • Containerizing Ollama
    • Docker Compose
    • Networking
  3. Production:

    • Server deployment
    • Performance tuning
    • Monitoring

Conceptual:

  • CLI vs GUI trade-offs
  • Containerizing LLMs
  • Production best practices

📦 Prerequisites

Minimum hardware:

  • RAM: 8GB (16GB recommended)
  • Storage: 10GB free
  • CPU: Any (GPU optional)

Software:

  • macOS 11+, Linux, or Windows 10+
  • Terminal access
  • Docker (for capsules 06-08)

💰 Cost

  • Ollama: $0 (open source)
  • Models: $0 (open source)
  • Hardware: $0 (you use what you have)

Total: $0


🎯 Ollama vs LM Studio vs OpenAI

FeatureOllamaLM StudioOpenAI
InterfaceCLIGUIAPI
DifficultyMediumLowLow
Production
DockerN/A
Cost$0$0$$$

📊 What you'll build

Final project:

A chatbot in a Docker container with:

  • Ollama as the backend
  • An exposed REST API
  • Persistent storage
  • Health checks
  • Docker Compose setup

✅ Success criteria

You completed it when:

  • Ollama installed (ollama --version)
  • Model downloaded (ollama pull mistral)
  • API working (curl http://localhost:11434)
  • Chatbot in Docker running
  • You understand the CLI workflow

🔗 Resources

  1. Ollama.com - Official site
  2. GitHub - Source code
  3. Docker Hub - Official image

🚀 Get started

Next: 02-installing-ollama.md

You'll install the Ollama CLI on your operating system.

Time: 15 min
Difficulty: Low


Total time: 3-4 hours
Next: 02-installing-ollama.md