Files
nexus/wiki/entities/Ollama.md

38 lines
1.3 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: [本地大模型, AI, 开源, 推理]
sources: ["https://ollama.com"]
last_updated: 2026-04-15
---
## 基本信息
- **类型**:本地大模型推理引擎
- **官网**https://ollama.com
- **支持模型**Llama3/Mistral/Qwen2.5-Coder/Gemma 等
- **代码专精模型**qwen2.5-coder:7b4.5GBShell/Python/SQL/Repo 级代码理解能力强于通用 Qwen2.5
## 核心机制
- **REST API**:通过 http://localhost:11434/api/generate 调用
- **模型管理**ollama pull 下载模型ollama list 查看已安装
- **无 GPU 依赖**:支持 CPU 推理(速度较慢)
- **跨平台**macOS/Linux/Windows 支持
- **远程 API**OLLAMA_HOST=0.0.0.0 环境变量开放外部访问,供 n8n/OpenClaw/OpenWebUI 调用
- **GPU 加速**CUDA 环境下自动使用 NVIDIA GPU无需额外配置
## 在 Wiki 中的角色
- [[可自动化可扩展AI增强的电商数据采集与处理系统]] 本地 AI 处理层
- 通过 n8n HTTP Request Node 调用,替代 OpenAI 等外部 API
- 支持 Mistral/Llama3 模型做本地摘要、分类、特征提取
## n8n 集成示例
```
URL: http://ollama:11434/api/generate
Method: POST
Body:
{
"model": "llama3",
"prompt": "分析以下产品信息:{{$json.title}},提取品牌、型号、价格区间"
}
```