Files
nexus/wiki/sources/在-ubuntu-安装-ollama-并运行-qwen2-5‑coder-7b.md
2026-04-28 12:03:10 +08:00

53 lines
2.9 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: 在 Ubuntu 安装 Ollama 并运行 Qwen2.5Coder 7B
type: source
tags: [ollama, qwen, qwen-coder, ubuntu, 本地大模型, ai-coding]
date: 2026-04-28
---
## Source File
- [[AI/在 Ubuntu 安装 Ollama 并运行 Qwen2.5Coder 7B]]
## Summary用中文描述
- 核心主题:在 Ubuntu 系统上通过 Ollama 本地部署 Qwen2.5-Coder 7B 代码大模型,并支持 REST API 和多语言 SDK 调用
- 问题域:本地 AI 推理环境搭建、代码助手部署
- 方法/机制Ollama 作为本地大模型运行时,通过 systemd 服务管理,支持 GPU 加速,提供 REST API 和 Python/NodeJS SDK
- 结论/价值3 条命令完成安装部署,适合开发者本地 AI Coding 基础设施搭建
## Key Claims用中文描述
- Ollama 官方安装脚本自动完成 CLI 安装、systemd 服务创建和 API 启动
- qwen2.5-coder:7b 模型约 4.5GB,最低 8GB RAM 推荐 16GB无需 GPU 也可运行
- Ollama 默认仅监听 127.0.0.1,通过 OLLAMA_HOST=0.0.0.0 环境变量开放远程 API 访问
- 安装 CUDA 后 Ollama 自动使用 NVIDIA GPU 加速,无需额外配置
- qwen2.5-coder:7b 在 Tool usage、Shell/Python/SQL 理解和 Repo 级代码理解方面优于普通 qwen2.5:7b
## Key Quotes
> "qwen2.5-coder:7b" — 模型推荐,适用于 DevOps automation、SQL Agent、Kubernetes troubleshooting、n8n workflow AI
> "curl -fsSL https://ollama.com/install.sh | sh" — 最简安装命令,一条命令完成 Ollama 安装
> "Ollama 默认提供 REST API: http://localhost:11434" — API 端点说明
## Key Concepts
- [[Ollama]]:本地大模型运行时,通过单一命令安装,支持 systemd 管理,提供 REST API 和多语言 SDK
- [[Qwen2.5-Coder]]通义千问代码大模型系列7B 参数规模约 4.5GB,擅长 Tool usage、代码理解和生成
- [[本地大模型部署]]:在本地机器而非云端运行 LLM适合隐私敏感和离线场景
- [[GPU 加速]]:通过 NVIDIA CUDA 自动加速 Ollama 推理性能
- [[REST API]]Ollama 提供的 HTTP API可被 n8n、WebUI、Agent 等外部工具调用
## Key Entities
- [[Ollama]]Ollama 公司开发的本地 LLM 运行时工具,安装地址 ollama.com
- [[Qwen2.5-Coder]]:阿里云通义千问团队开发的代码专用大模型
- [[Open WebUI]]:开源的 ChatGPT 风格 Web 界面,可搭配 Ollama 使用
- [[n8n]]:开源工作流自动化平台,可通过 API 调用 Ollama 实现 AI 自动化
- [[LangChain]]Agent 开发框架,可集成 Ollama 作为 LLM 后端
- [[OpenClaw]]AI Coding Agent可配置使用 ollama/qwen2.5-coder:7b 作为后端
## Connections
- [[Ollama]] ← runs ← [[Qwen2.5-Coder]]
- [[Open WebUI]] ← connects_to ← [[Ollama]] API
- [[n8n]] ← calls ← [[Ollama]] REST API
- [[LangChain]] ← uses ← [[Ollama]] as LLM backend
- [[OpenClaw]] ← configured_with ← [[Qwen2.5-Coder]]
## Contradictions
- 暂无发现与其他 Wiki 页面的冲突内容。