The Complete Guide to Ollama: Run DeepSeek and Other LLMs Locally with a Single Command

Ollama is a 170K-Star open-source tool for running LLMs locally with a single command
Ollama is an open-source tool built with Go, powered by the llama.cpp inference engine, that lets users run mainstream LLMs like DeepSeek and Qwen locally with a single command via GGUF quantization. It supports all major platforms, auto-detects GPU hardware, is compatible with the OpenAI API format, and seamlessly integrates with RAG, Agent, and other ecosystem tools while providing data privacy and cost advantages — making it the de facto standard for local LLM deployment.
What Is Ollama: The Local LLM Tool with 170K GitHub Stars
Ollama is an open-source project built with Go, with a clear mission — making it easy to run various large language models (LLMs) on your own computer. No complex environment setup, no wrestling with CUDA drivers — just a single command to pull and run models like DeepSeek and Qwen locally.
Large Language Models (LLMs) are deep learning models based on the Transformer architecture, trained on massive amounts of text data, with parameter counts typically ranging from billions to hundreds of billions. The Transformer was introduced by Google in the 2017 paper "Attention Is All You Need," with its core innovation being the Self-Attention mechanism, which allows the model to attend to information at all positions in the input simultaneously when processing sequential data, rather than processing step-by-step like traditional RNNs (Recurrent Neural Networks). This architectural breakthrough enabled highly parallelized model training, laying the foundation for the subsequent explosive growth in parameter scale. Current mainstream LLMs (such as GPT, LLaMA, Qwen, etc.) are almost all built on the Decoder-Only variant of Transformer — the model generates text by predicting the next Token one at a time, and the more parameters and training data, the stronger the model's language understanding and generation capabilities.
Traditionally, running such models required configuring NVIDIA CUDA drivers, installing deep learning frameworks like PyTorch, manually downloading model weight files of tens of GBs, and handling various version compatibility issues — an extremely unfriendly process for average developers. Ollama's core innovation is encapsulating these complex steps into a Docker-like experience — it integrates the llama.cpp inference engine under the hood, supports quantized model formats like GGUF, automatically detects the hardware environment (CPU/GPU) and selects the optimal inference backend, so users only need to focus on "which model to run" without worrying about the underlying implementation.
llama.cpp is an open-source project initiated by developer Georgi Gerganov in 2023, implementing inference for LLaMA-series models in pure C/C++ without requiring Python or PyTorch. Its greatest technical contribution is enabling efficient CPU inference and support for multiple quantization formats, allowing large models to run on consumer-grade hardware without high-end GPUs. llama.cpp also defined the GGUF (GPT-Generated Unified Format) model format, which unifies model weights, tokenizer configuration, and metadata into a single file, becoming the de facto standard format for local inference. Ollama builds model management, API services, and automatic hardware detection capabilities on top of llama.cpp, so users don't need to interact directly with the underlying inference engine.
This project has already earned over 170,000 Stars on GitHub, with nearly 16,000 forks — it's the most mainstream local LLM tool available, bar none.
What Models Does Ollama Support
Comprehensive Coverage of Mainstream Open-Source Models
Ollama's model library is quite extensive, covering virtually all currently popular open-source LLMs:
| Model | Source | Description |
|---|---|---|
| DeepSeek | DeepSeek | Including DeepSeek-V2/V3 series, one of the hottest open-source models from China |
| Qwen | Alibaba | Qwen series with multiple sizes available |
| Kimi-K2.5 | Moonshot AI | Recently released large model |
| GLM-5 | Zhipu AI | Latest generation general-purpose language model |
| Gemma | Lightweight open-source model suitable for resource-limited devices | |
| MiniMax | MiniMax | Open-source model from MiniMax |
| gpt-oss | Community | Open-source GPT-class models |
This means you can use the same tool and the same set of commands to run models from different providers and directly compare their performance, eliminating the hassle of setting up separate environments for each model.
Ollama's ability to run these large models on ordinary computers relies heavily on Model Quantization technology. Original LLMs typically store parameters using FP16 (16-bit floating point) or even FP32, and a 7-billion-parameter model requires approximately 14GB of VRAM. Quantization techniques reduce parameter precision from FP16 down to INT8, INT4, or even lower bit counts, compressing model size and memory usage to 1/4 or even 1/8 of the original while losing only minimal inference accuracy.
From a technical implementation perspective, quantization is mainly divided into Post-Training Quantization (PTQ) and Quantization-Aware Training (QAT). Ollama/llama.cpp primarily uses PTQ methods, where the K-Quant series (such as Q4_K_M, Q5_K_M) employs a grouped quantization strategy — partitioning model parameters into groups, computing scaling factors independently for each group, and using different quantization precisions for layers of varying importance (e.g., higher precision for attention layers, lower precision for feed-forward layers), achieving a better balance between compression ratio and accuracy. Ollama's default GGUF format supports these multiple quantization levels, allowing users to choose the appropriate quantized version based on their hardware. For example, Q4_K_M is typically the best value choice, significantly compressing model size while retaining the vast majority of inference quality; Q8_0 provides near-original accuracy but requires more memory.
Fast Model Update Cadence
The Ollama team is very timely in following up on new models. Models like Kimi-K2.5 and GLM-5 that were released recently are already available through Ollama, essentially achieving "model goes open-source, Ollama can run it."
Why Is Ollama So Popular
Extremely Low Barrier to Entry
Ollama's design philosophy can be summed up in two words: plug and play. After installation, a single command downloads and starts the model:
ollama run deepseek-v2
No manual model weight downloads, no configuration files to write, no dependency conflicts to resolve. For developers who want to quickly experience local LLMs, this kind of experience is revolutionary.
Full Platform Support: macOS, Linux, and Windows
Go's inherent cross-platform advantages allow Ollama to run smoothly across all three major operating systems. Whether you're using a Mac Studio or a Windows desktop, you get a consistent experience.
Go (also known as Golang) is a programming language released by Google in 2009, known for its fast compilation speed, strong concurrency handling, and simple deployment (compiling to a single binary file). Ollama's choice of Go as its development language is no accident — Go's cross-compilation capability allows the same codebase to be easily compiled into executables for macOS, Linux, and Windows, greatly reducing distribution and installation complexity. Additionally, Go's goroutine concurrency model is well-suited for handling I/O-intensive tasks during model inference, such as model file download management and concurrent API request processing. Compared to the "dependency hell" common in the Python ecosystem (version conflicts between packages, chaotic virtual environment management, etc.), Go's single compiled binary means users don't need to install any runtime environment — this is the technical foundation of Ollama's "plug and play" experience.
Regarding GPU acceleration, Ollama achieves zero-configuration as well. CUDA (Compute Unified Device Architecture) is NVIDIA's parallel computing platform and programming model, on which virtually all mainstream deep learning frameworks depend for GPU acceleration. CUDA's core concept is leveraging thousands of compute cores in a GPU to simultaneously process massive matrix operations — and matrix multiplication is the most critical computation in Transformer model inference. Traditionally, deploying LLMs required users to manually install the CUDA Toolkit matching their GPU model (e.g., CUDA 11.8 or 12.1), the cuDNN library (NVIDIA's deep neural network acceleration library), and ensure compatibility with PyTorch/TensorFlow versions — version mismatches being one of the most common error sources. Ollama handles GPU scheduling automatically through its built-in inference engine — automatically using CUDA acceleration on NVIDIA GPUs, Metal API on Apple Silicon chips, and ROCm on AMD GPUs — users don't need to manually configure drivers at all, which is key to its "zero-configuration" experience.
It's worth specifically mentioning that Apple Silicon's Unified Memory Architecture provides unique advantages for local LLM inference. In traditional PCs, CPU memory (RAM) and GPU memory (VRAM) are physically separate — model weights need to be copied from RAM to VRAM for GPU-accelerated inference, and VRAM capacity is typically the bottleneck (consumer GPUs max out at 24GB). Apple M-series chips share a single memory pool between CPU and GPU, allowing model weights to be directly accessed by the GPU without copying, significantly reducing memory bottlenecks. For example, a Mac Studio M4 Ultra with 192GB of unified memory can theoretically run complete 70B or even larger parameter models, which would require multiple high-end GPUs on traditional PCs. This is why Mac users have become one of Ollama's most active user groups.
Active Community Ecosystem
170K+ Stars isn't just a number — it represents developers continuously contributing code, constantly improving documentation, and a large number of third-party tools and plugins built around Ollama. This positive feedback loop makes Ollama's feature iteration speed far exceed comparable projects.
Practical Use Cases for Ollama
Integration with Development Toolchains
Ollama provides an API interface compatible with the OpenAI format, enabling seamless integration with various development tools.
OpenAI's Chat Completions API format (including endpoints like /v1/chat/completions) has become the de facto standard for LLM API calls — the vast majority of AI development tools, frameworks, and plugins on the market prioritize support for this format. The core design of this API is based on a "message list" conversation structure, where each message contains a role (system/user/assistant) and content, and the model generates the next reply based on the complete conversation history. Ollama achieves this by launching a locally running HTTP service compatible with the OpenAI format (listening on localhost:11434 by default), enabling applications originally developed for the OpenAI API to seamlessly switch to local models by simply changing the base_url parameter without modifying any business code. This "API compatibility" strategy allows Ollama to directly leverage the entire OpenAI ecosystem toolchain, including hundreds of open-source projects like LangChain, AutoGen, Open WebUI, and more.
Common use cases include:
-
Building RAG Applications: Combining frameworks like LangChain to use local models for knowledge base Q&A. RAG (Retrieval-Augmented Generation) is one of the most mainstream architectural patterns in enterprise AI applications. Its core approach is: before the LLM generates an answer, relevant document fragments are first retrieved from an external knowledge base, injected into the Prompt as context, and then the model generates the final response. This approach both solves the LLM's knowledge cutoff date problem and significantly reduces "hallucinations" (the model fabricating facts). A typical RAG pipeline includes: document chunking → vectorization (Embedding) → storage in a vector database → similar document retrieval when users ask questions → Prompt assembly → model inference. Among these, vector databases (such as Chroma, Milvus, Qdrant, FAISS, etc.) are core components of the RAG architecture, specifically designed for storing and retrieving high-dimensional vectors. After text is converted into numerical vectors of hundreds of dimensions through Embedding models, vector databases achieve millisecond-level semantic similarity retrieval through Approximate Nearest Neighbor (ANN) algorithms, far better at understanding user intent than traditional keyword search. Ollama itself also supports running Embedding models (such as
nomic-embed-text,mxbai-embed-large, etc.), enabling the complete pipeline from text vectorization to semantic retrieval to final answer generation in a fully local environment, with data never leaving the local network. -
Developing AI Agents: Serving as a local inference engine to power intelligent agents. AI Agents are AI systems capable of autonomously perceiving their environment, making plans, invoking tools, and executing tasks — considered the key form factor for LLMs evolving from "chat tools" to "productivity tools." A typical Agent workflow includes: understanding user intent → decomposing tasks into sub-steps → calling external tools like search engines, code executors, databases → integrating results and providing feedback. The core capability of Agents relies on the LLM's Function Calling ability — the model needs to determine when to call which tool, what parameters to pass, and continue reasoning based on tool return results. Using Ollama as a local inference engine means all of the Agent's reasoning processes happen locally, not only providing faster response times (eliminating network latency) but also preventing sensitive business logic from being exposed to third parties through APIs. Currently, mainstream Agent frameworks like LangChain, CrewAI, and AutoGen all support Ollama as a backend.
-
Model Evaluation and Comparison: Horizontally testing different models' performance in the same environment. Since Ollama supports dozens of models with minimal switching cost (one command to switch), developers can compare different models' performance on specific tasks under completely identical hardware environments and test cases, including answer quality, inference speed, memory usage, and other dimensions, providing reliable evidence for technology selection.
-
IDE Code Assistants: Paired with tools like Continue and Cursor for local code completion. Continue is an open-source IDE plugin (supporting VS Code and JetBrains) that can directly connect to Ollama local models to provide code completion, code explanation, refactoring suggestions, and other features, giving developers an AI-assisted programming experience without relying on cloud services like GitHub Copilot.
Data Privacy Protection
All data is processed locally and never sent to any third-party server. For scenarios involving trade secrets, personal privacy, or data compliance requirements, local deployment is a safer choice than cloud APIs.
Globally, data privacy regulations are becoming increasingly strict — the EU's GDPR (General Data Protection Regulation), China's Personal Information Protection Law, and Data Security Law all impose explicit restrictions on cross-border data transfer and third-party processing. Using cloud APIs means user input data (potentially containing customer information, business strategies, source code, and other sensitive content) needs to be sent over the network to the model provider's servers. Even if the provider promises not to retain data, the transmission process itself poses compliance risks. Ollama's local execution mode fundamentally eliminates this concern — data from input to output never leaves the user's device, naturally meeting the strictest Data Residency requirements.
More Cost-Effective for Long-Term Use
Cloud APIs charge per token — the more you use, the more you pay. Ollama's local execution only requires a one-time hardware investment, with all subsequent inference being completely free. If you're using LLMs at high frequency every day, the cost advantage of a local solution becomes very apparent.
Specifically, a Token is the basic unit the model uses to process text — Chinese characters correspond to roughly 1-2 Tokens each, while English words correspond to approximately 1-1.5 Tokens each. Different models use different Tokenizers, and Token segmentation methods vary — for example, BPE (Byte Pair Encoding) is the most commonly used tokenization algorithm, which builds a vocabulary by analyzing high-frequency character combinations in the corpus, allowing common words to be represented with fewer Tokens, thereby improving encoding efficiency. Taking GPT-4o as an example, input pricing is approximately $2.5 per million Tokens, and output is approximately $10 per million Tokens. For casual light use, this cost is acceptable; but in enterprise scenarios, if processing hundreds of thousands of customer service conversations daily or conducting large-scale document analysis, monthly API costs could reach thousands or even tens of thousands of dollars. In comparison, a local workstation equipped with an RTX 4090 (24GB VRAM, approximately $1,400 USD) can smoothly run most quantized models under 70B parameters, with the hardware investment typically paying for itself in 2-3 months under high-frequency use. Additionally, local inference eliminates network latency — cloud API time-to-first-token latency is typically 500ms-2s, while local inference can keep time-to-first-token under 100ms, making a significant experiential difference for applications requiring real-time interaction (such as code completion and conversational systems).
Ollama Compared to Similar Tools
In the local LLM tool space, besides Ollama there are several other noteworthy projects: LM Studio provides an elegant graphical interface supporting model browsing, downloading, and conversations, better suited for non-technical users and first-time explorers; vLLM focuses on high-throughput inference, employing advanced memory management techniques like PagedAttention, better suited for production environments needing to serve large numbers of concurrent requests; LocalAI is another local inference solution compatible with the OpenAI API, supporting a more diverse range of model formats (including image and audio models); text-generation-webui (also known as oobabooga) provides a rich parameter tuning interface, suitable for advanced users who need fine-grained control over generation parameters.
Ollama's core differentiating advantages lie in three points: a CLI-first minimalist design that lets developers easily integrate it into scripts and automation workflows; the fastest new model adoption speed ensuring users can always experience the latest models first; and the largest community ecosystem meaning it's easier to find solutions when encountering problems, with more third-party tools available for integration.
Conclusion: Start Your Local LLM Journey with Ollama
Ollama has become the de facto standard for running large language models locally. A continuously expanding model ecosystem, sufficiently low barrier to entry, and a sufficiently active community — these three factors make it stand out among similar tools.
Whether you want to experience DeepSeek's reasoning capabilities locally or build your own AI application with Qwen, Ollama is the tool most worth trying first. As new models like Kimi-K2.5 and GLM-5 continue to be added, and local hardware performance continues to improve (expanding Apple Silicon unified memory, growing NVIDIA consumer GPU VRAM), Ollama's ecosystem value will only increase. It's foreseeable that local LLM inference will gradually evolve from a developer's "novelty tool" to an important component of enterprise AI infrastructure, and Ollama sits at the center of this trend.
Key Takeaways
- Ollama has earned over 170K Stars on GitHub, making it the most popular local LLM tool
- Supports the latest mainstream open-source models including Kimi-K2.5, GLM-5, DeepSeek, and Qwen
- Built with Go, providing a minimalist one-click experience and cross-platform support
- Powered by the llama.cpp inference engine, enabling efficient inference on consumer hardware through GGUF quantization
- Compatible with the OpenAI API format, seamlessly integrating with hundreds of ecosystem tools including LangChain and Agent frameworks
- Local execution mode balances data privacy security with long-term cost advantages
- A continuously updated model library and active open-source community form strong ecosystem competitiveness
Related articles
TutorialsChatGPT Plus Subscription Guide: Are GPT-5.5, image-2, and Codex Worth the Upgrade?
A detailed look at ChatGPT Plus features — GPT-5.5, image-2, and Codex — with a Plus vs Pro comparison and a complete step-by-step subscription guide for users outside the US.
TutorialsHarness AI Engineering in Practice: Using Claude Code to Master Enterprise-Level E-Commerce Development
Deep dive into Harness AI Engineering: master enterprise e-commerce development with Claude Code using the Rules, Skills, Wiki, and Changes framework.
TutorialsCursor + Codex Dual-IDE Collaboration: A Practical Methodology for Open-Source Project Customization
A complete methodology for open-source project customization based on real-world experience, detailing the Cursor+Codex dual-IDE workflow, seven-stage process, MVP validation, and AI source code reading techniques.