Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Ollama Tutorial

Ollama Tutorial

Ollama is an open-source framework for running local large language models, designed for conveniently deploying and running large language models (LLMs) on local machines.

Ollama supports multiple operating systems, including macOS, Windows, Linux, and running via Docker containers.

In simple terms, if services like ChatGPT, Claude, and DeepSeeek call someone else's models over the internet, then Ollama is more like alocal AI model runtime environment。


Who should read this tutorial?

Ollama is suitable for developers, researchers, and users with high data privacy requirements; it helps users quickly deploy and run large language models in a local environment while providing flexible customization options.

With Ollama, we can run qwen3.5, Llama 3.3, DeepSeek-R1, Phi-4, Mistral, Gemma 2, and other models locally.

Person type What they might want to do
AI beginner Understand what a local large model is, install Ollama, download, run, and delete models
Programmer / Developer Integrate large models into your own Python, JavaScript, and Web applications
AI Agent developer Connect local models to programming Agents such as Claude Code, Codex, and OpenCode
Regular users who want to experience local AI No API purchases, no data in the cloud; experience various open-source models on your own computer

What developers can do with Ollama

For developers, Ollama's value lies in turning a large model into a local service that can be called at any time.

Typical uses include: AI chatbots, AI writing tools, AI programming assistants, document analysis tools, RAG knowledge bases, vector retrieval, AI Agents, automated workflows, and local AI Web applications.

Behind these capabilities are the text generation, chat, model management, Embedding, and other interfaces provided by Ollama, with support for streaming responses and tool calling.

Why Agent developers need it

If you are learning AI programming tools such as Claude Code, Codex, and OpenCode, Ollama can serve as their local model backend.

Ollama already provides official integration methods with tools such as Claude Code, Codex, OpenCode, Copilot CLI, and Droid; a single ollama launch command can connect local models to these Agent workflows, which will be expanded in detail in the integration chapter.



What you need to know before studying this tutorial

Ollama itself is not difficult; if you just want to run models, you basically don't need a programming background.

Different learning goals correspond to different prerequisite requirements; you can assess your starting point against the table below:

Learning goals Required background
Install Ollama Basic computer operation, terminal fundamentals
Download and run models Basic command-line knowledge
Use the Ollama API HTTP and JSON fundamentals
Python development Python 3.x Basic Tutorial
JavaScript development JavaScript / TypeScript fundamentals
RAG / Agent development Python + large model fundamentals
Model deployment and optimization Fundamentals of GPU, VRAM, Linux, Docker, etc.

If you just want to experience Ollama, knowing what a terminal, command, folder, and model are is basically enough.

If you want to further develop AI applications, it is recommended to first understand HTTP / REST API, JSON, Python or JavaScript, as well as the basics of Git and Docker.


Create a new model

This is Ollama's core capability: run open-source models on your own computer or server, without building a complex inference environment yourself.

A single command starts it, and you can chat directly once the model is running:


ollama run qwen3.5

This command starts the Tongyi Qianwen Qwen3.5 model locally and enters an interactive chat terminal; if the model is not available locally, it will be downloaded first and then started.


Related links