Files
nexus/wiki/entities/Ollama.md
2026-04-23 05:51:04 +08:00

78 lines
2.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: "Ollama"
type: entity
tags: []
last_updated: 2026-04-23
---
# Ollama
## Overview
Ollama 是一个开源的本地大语言模型LLM运行框架让用户可以在本地机器上部署和运行大型语言模型实现**免费离线使用 LLM 能力**,同时确保私有数据的隐私和安全性。
## Aliases
- Ollama
- ollama
## Key Facts
- **官网**: https://ollama.com
- **中文站**: https://ollama.org.cn
- **GitHub**: https://github.com/ollama/ollama
- **支持平台**: macOS, Windows, Linux, Docker
- **API 端口**: localhost:11434
## Supported Models
- DeepSeek-R1 系列1.5B ~ 671B 参数)
- Qwen 系列
- Llama 系列
- 第三方模型HuggingFace、魔塔社区
## Core Commands
| 命令 | 功能 |
|------|------|
| `ollama run <model:size>` | 下载并运行模型 |
| `ollama pull <model:size>` | 拉取模型 |
| `ollama create <name> -f <Modelfile>` | 从 Modelfile 导入本地 GGUF 模型 |
| `ollama list` | 列出所有已下载模型 |
| `ollama ps` | 列出正在运行的模型 |
| `ollama serve` | 启动 Ollama 服务 |
## Hardware Requirements
| 模型 | 建议内存 | 建议显存 | 适用场景 |
|------|---------|---------|---------|
| 1.5B | 4~8 GB | 4 GB | 轻量快速 |
| 7B | 16 GB | 14 GB | 日常使用 |
| 8B | 16 GB | 14 GB | 较高精度 |
| 14B | 32 GB | 26 GB | 复杂任务 |
| 32B | 64 GB | 48 GB | 专业级 |
| 70B+ | 128+ GB | 140+ GB | 超大规模 |
## Docker Deployment
```bash
# CPU 模式
docker run -d -p 11434:11434 -v /data/ollama:/root/.ollama --name ollama ollama/ollama
# GPU 模式
docker run --gpus=all -d -p 11434:11434 -v /data/ollama:/root/.ollama --name ollama ollama/ollama
```
## Environment Variables
| 变量 | 默认值 | 说明 |
|------|--------|------|
| OLLAMA_MODELS | ~/.ollama/models | 模型存储路径 |
| OLLAMA_HOST | 127.0.0.1 | 服务绑定地址 |
| OLLAMA_ORIGINS | * | 允许的来源域名 |
## Key Concepts
- [[Local LLM Deployment]]Ollama 是实现本地 LLM 部署的核心工具
- [[Docker LLM Deployment]]Ollama 支持 Docker 部署模式
- [[Model Quantization]]GGUF 格式量化模型可通过 `ollama create` 导入
## Related Entities
- [[DeepSeek]]Ollama 官方支持的深度求索推理模型
- [[Open WebUI]]:基于 Ollama API 的开源 Web 界面
- [[HuggingFace]]:第三方模型来源
## Sources
- [[详细-离线部署大模型-ollama-deepseek-open-webui安装使用方法及常见问题解决-1]]