ollama

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Ollama

Ollama

Ollama makes running LLMs locally as easy as
docker run
. 2025 updates include Windows/AMD support, Multimodal input, and Tool Calling.
Ollama让在本地运行LLM变得像
docker run
一样简单。2025年更新包括Windows/AMD支持、**多模态(Multimodal)**输入以及工具调用功能。

When to Use

使用场景

  • Local Development: Coding without wifi or API costs.
  • Privacy: Processing sensitive documents on-device.
  • Integration: Works with LangChain, LlamaIndex, and Obsidian natively.
  • 本地开发:无需网络或API费用即可进行编码工作。
  • 隐私保护:在设备端处理敏感文档。
  • 集成兼容:原生支持与LangChain、LlamaIndex和Obsidian协同工作。

Core Concepts

核心概念

Modelfile

Modelfile

Docker-like file to define a custom model (System prompt + Base model).
dockerfile
FROM llama3
SYSTEM You are Mario from Super Mario Bros.
类似Docker的文件,用于定义自定义模型(系统提示词 + 基础模型)。
dockerfile
FROM llama3
SYSTEM You are Mario from Super Mario Bros.

API

API

Ollama runs a local server (
localhost:11434
) compatible with OpenAI SDK.
Ollama会启动一个本地服务器(
localhost:11434
),兼容OpenAI SDK。

Best Practices (2025)

2025年最佳实践

Do:
  • Use high-speed RAM: Local LLM speed depends on memory bandwidth.
  • Use Quantized Models:
    q4_k_m
    is the sweet spot for speed/quality balance.
  • Unload:
    ollama stop
    when done to free VRAM for games/rendering.
Don't:
  • Don't expect GPT-4 level: Smaller local models (8B) are smart but lack deep reasoning.
建议
  • 使用高速内存:本地LLM的运行速度取决于内存带宽。
  • 使用量化模型
    q4_k_m
    是速度与质量平衡的最优选择。
  • 释放资源:使用完成后执行
    ollama stop
    以释放显存,供游戏/渲染使用。
不建议
  • 不要期望达到GPT-4水平:小型本地模型(8B参数)虽智能,但缺乏深度推理能力。

References

参考资料