liveBook · Manning

Ollama

As explained in AI-Powered Developer: Build software with ChatGPT and Copilot

Software for running and managing large language models locally, including through Docker-based deployments.

Ollama runs Llama 2 locally through Docker, making local model evaluation practical on modest commodity hardware. section 9.2

Listing 9.3 Starting and running Ollama
docker run -d -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama
  
docker exec -it ollama ollama run llama2

Use the Docker commands to start Ollama, expose its service, and launch Llama 2; the initial model download may take several gigabytes. section 9.2.2

A practical Ollama workflow includes:

  • Run the container with persistent model storage and start Llama 2 interactively. section 9.2.2
  • Download the model while connected to a stable internet connection; afterward, Ollama can run without internet access. section 9.2.2
  • Compare generated answers with a known-correct ChatGPT baseline rather than accepting local output automatically. section 9.2.2
  • Refine prompts when the first answer is ambiguous, then question inconsistencies and inspect the resulting code or explanation. section 9.2.2

Checking a standard-deviation answer

Ask Llama 2 for pure-Python standard-deviation code, then restrict the prompt to exclude libraries. Review its formula, test the implementation, and ask why it uses n − 1 when the result differs from another baseline. section 9.2.2

How AI-Powered Developer: Build software with ChatGPT and Copilot covers it

How deep it goes
Explains Docker startup, model downloading, prompt refinement, and output checking, but does not describe Ollama internals.
Examples
Uses Docker commands, model self-description, pure-Python standard-deviation code, formula explanations, and degrees-of-freedom questions.
What it assumes
Assumes access to Docker and a stable internet connection for the initial multi-gigabyte model download.
What you can do after
Operate Ollama in Docker, run Llama 2 locally, and evaluate or refine its answers against a known-correct baseline.
How it connects
Connects Docker, Llama 2, ChatGPT, offline inference, prompt refinement, and standard deviation.

Also explained in

Compare how 8 books explain Ollama →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of AI-Powered Developer: Build software with ChatGPT and Copilot. The section links point to the parts of the book it draws on.