Get up and running with large language models locally.
在本地启动并运行大型语言模型。
curl -fsSL https://ollama.com/install.sh | sh
Manual install instructions
手动安装说明
The official Ollama Docker image ollama/ollama
is available on Docker Hub.
官方的 Ollama Docker 镜像 ollama/ollama
可在 Docker Hub 上找到。
To run and chat with Llama 3:
要运行并与 Llama 3 聊天:
ollama run llama3
Ollama supports a list of models available on ollama.com/library
Ollama 支持 ollama.com/library 上可用的模型列表
Here are some example models that can be downloaded:
以下是一些可以下载的示例模型:
Model 型 | Parameters 参数 | Size 大小 | Download 下载 |
---|---|---|---|
Llama 3 致电 3 | 8B | 4.7GB | ollama run llama3 |
Llama 3 致电 3 | 70B | 40GB | ollama run llama3:70b |
Phi 3 Mini Phi 3 迷你 | 3.8B | 2.3GB | ollama run phi3 |
Phi 3 Medium Phi 3 培养基 | 14B | 7.9GB | ollama run phi3:medium |
Gemma 杰玛 | 2B | 1.4GB | ollama run gemma:2b |
Gemma 杰玛 | 7B | 4.8GB | ollama run gemma:7b |
Mistral 米斯特拉尔 | 7B | 4.1GB | ollama run mistral |
Moondream 2 月梦2 | 1.4B | 829MB | ollama run moondream |
Neural Chat 神经聊天 | 7B | 4.1GB | ollama run neural-chat |
Starling 椋 | 7B | 4.1GB | ollama run starling-lm |
Code Llama 代码骆驼 | 7B | 3.8GB | ollama run codellama |
Llama 2 Uncensored 呼叫 2 未经审查 | 7B | 3.8GB | ollama run llama2-uncensored |
LLaVA LLaVA公司 | 7B | 4.5GB | ollama run llava |
Solar 太阳的 | 10.7B | 6.1GB | ollama run solar |
Note: You should have at least 8 GB of RAM available to run the 7B models, 16 GB to run the 13B models, and 32 GB to run the 33B models.
注意:您应该至少有 8 GB 的 RAM 可用于运行 7B 型号,16 GB 可用于运行 13B 型号,32 GB 可用于运行 33B 型号。
Ollama supports importing GGUF models in the Modelfile:
Ollama 支持在 Modelfile 中导入 GGUF 模型:
-
Create a file named
Modelfile
, with aFROM
instruction with the local filepath to the model you want to import.
创建一个名为Modelfile
的文件,其中包含一条FROM
指令,其中包含要导入的模型的本地文件路径。FROM ./vicuna-33b.Q4_0.gguf
-
Create the model in Ollama
在 Ollama 中创建模型ollama create example -f Modelfile
-
Run the model 运行模型
ollama run example
See the guide on importing models for more information.
有关详细信息,请参阅有关导入模型的指南。
Models from the Ollama library can be customized with a prompt. For example, to customize the llama3
model:
Ollama 库中的模型可以通过提示进行自定义。例如,要自定义 llama3
模型:
ollama pull llama3
Create a Modelfile
: 创建一个 Modelfile
:
FROM llama3
# set the temperature to 1 [higher is more creative, lower is more coherent]
PARAMETER temperature 1
# set the system message
SYSTEM """
You are Mario from Super Mario Bros. Answer as Mario, the assistant, only.
"""
Next, create and run the model:
接下来,创建并运行模型:
ollama create mario -f ./Modelfile
ollama run mario
>>> hi
Hello! It's your friend Mario.
For more examples, see the examples directory. For more information on working with a Modelfile, see the Modelfile documentation.
有关更多示例,请参阅 examples 目录。有关使用 Modelfile 的详细信息,请参阅 Modelfile 文档。
ollama create
is used to create a model from a Modelfile.
ollama create
用于从 Modelfile 创建模型。
ollama create mymodel -f ./Modelfile
ollama pull llama3
This command can also be used to update a local model. Only the diff will be pulled.
此命令还可用于更新本地模型。只会拉取差异。
ollama rm llama3
ollama cp llama3 my-model
For multiline input, you can wrap text with """
:
对于多行输入,您可以使用以下命令 """
换行文本:
>>> """Hello,
... world!
... """
I'm a basic program that prints the famous "Hello, world!" message to the console.
>>> What's in this image? /Users/jmorgan/Desktop/smile.png
The image features a yellow smiley face, which is likely the central focus of the picture.
$ ollama run llama3 "Summarize this file: $(cat README.md)"
Ollama is a lightweight, extensible framework for building and running language models on the local machine. It provides a simple API for creating, running, and managing models, as well as a library of pre-built models that can be easily used in a variety of applications.
ollama list
ollama serve
is used when you want to start ollama without running the desktop application.
ollama serve
当您想要在不运行桌面应用程序的情况下启动 Ollama 时使用。
See the developer guide 请参阅开发人员指南
Next, start the server:
接下来,启动服务器:
./ollama serve
Finally, in a separate shell, run a model:
最后,在单独的 shell 中,运行一个模型:
./ollama run llama3
Ollama has a REST API for running and managing models.
Ollama 有一个用于运行和管理模型的 REST API。
curl http://localhost:11434/api/generate -d '{
"model": "llama3",
"prompt":"Why is the sky blue?"
}'
curl http://localhost:11434/api/chat -d '{
"model": "llama3",
"messages": [
{ "role": "user", "content": "why is the sky blue?" }
]
}'
See the API documentation for all endpoints.
请参阅所有端点的 API 文档。
- Open WebUI 打开 WebUI
- Enchanted (macOS native)
魔法(macOS 原生) - Hollama 霍拉玛
- Lollms-Webui
- LibreChat LibreChat的
- Bionic GPT 仿生GPT
- HTML UI HTML 用户界面
- Saddle 鞍
- Chatbot UI 聊天机器人用户界面
- Chatbot UI v2 聊天机器人 We V2
- Typescript UI 打字稿 UI
- Minimalistic React UI for Ollama Models
Ollama 模型的简约 React UI - Ollamac 奥拉马克
- big-AGI 大AGI
- Cheshire Cat assistant framework
柴郡猫助手框架 - Amica 朋友
- chatd 聊天
- Ollama-SwiftUI Ollama-SwiftUI操作系统
- Dify.AI
- MindMac
- NextJS Web Interface for Ollama
- Msty
- Chatbox 聊天框
- WinForm Ollama Copilot
- NextChat with Get Started Doc
NextChat with 入门文档 - Alpaca WebUI 羊驼 WebUI
- OllamaGUI OllamaGUI的
- OpenAOE 开放AOE
- Odin Runes 奥丁符文
- LLM-X (Progressive Web App)
LLM-X(渐进式 Web 应用) - AnythingLLM (Docker + MacOs/Windows/Linux native app)
AnythingLLM(Docker + MacOs/Windows/Linux 原生应用程序) - Ollama Basic Chat: Uses HyperDiv Reactive UI
Ollama 基本聊天:使用 HyperDiv 响应式 UI - Ollama-chats RPG Ollama-chats 角色扮演游戏
- QA-Pilot (Chat with Code Repository)
QA-Pilot(与代码库聊天) - ChatOllama (Open Source Chatbot based on Ollama with Knowledge Bases)
ChatOllama (基于 Ollama 的开源聊天机器人,具有知识库) - CRAG Ollama Chat (Simple Web Search with Corrective RAG)
CRAG Ollama Chat(使用校正 RAG 进行简单 Web 搜索) - RAGFlow (Open-source Retrieval-Augmented Generation engine based on deep document understanding)
RAGFlow(基于深度文档理解的开源检索增强生成引擎) - StreamDeploy (LLM Application Scaffold)
StreamDeploy (LLM Application Scaffold) - chat (chat web app for teams)
聊天(适用于 Teams 的聊天 Web 应用)Chat (Chat Web App for Teams) - Lobe Chat with Integrating Doc
Lobe Chat 与集成文档 - Ollama RAG Chatbot (Local Chat with multiple PDFs using Ollama and RAG)
Ollama RAG 聊天机器人(使用 Ollama 和 RAG 与多个 PDF 进行本地聊天) - BrainSoup (Flexible native client with RAG & multi-agent automation)
BrainSoup(具有RAG和多代理自动化的灵活本机客户端) - macai (macOS client for Ollama, ChatGPT, and other compatible API back-ends)
macai(适用于 Ollama、ChatGPT 和其他兼容 API 后端的 macOS 客户端) - Olpaka (User-friendly Flutter Web App for Ollama)
Olpaka (用户友好的 Flutter Web 应用程序 for Ollama) - OllamaSpring (Ollama Client for macOS)
OllamaSpring (适用于 macOS 的 Ollama 客户端)
- oterm
- Ellama Emacs client Ellama Emacs 客户端
- Emacs client Emacs 客户端
- gen.nvim
- ollama.nvim
- ollero.nvim
- ollama-chat.nvim
- ogpt.nvim ospt.nvim
- gptel Emacs client gptel Emacs 客户端
- Oatmeal 燕麦片
- cmdh CMDH的
- ooo 呜呜
- shell-pilot 壳体飞行员
- tenere 拿
- llm-ollama for Datasette's LLM CLI.
llm-ollama 用于 Datasette 的 LLM CLI。 - typechat-cli 类型聊天-cli
- ShellOracle 壳牌甲骨文
- tlm TLM的
- podman-ollama 波德曼-奥拉马
- MindsDB (Connects Ollama models with nearly 200 data platforms and apps)
MindsDB(将 Ollama 模型与近 200 个数据平台和应用程序连接起来) - chromem-go with example chromem-go 示例
- LangChain and LangChain.js with example
LangChain 和 LangChain.js 示例 - LangChainGo with example
LangChainGo 示例 - LangChain4j with example
LangChain4j 示例 - LlamaIndex 骆驼指数
- LiteLLM 精简版法学硕士
- OllamaSharp for .NET
- Ollama for Ruby 用于 Ruby 的 Ollama
- Ollama-rs for Rust 用于 Rust 的 Ollama-rs
- Ollama4j for Java
- ModelFusion Typescript Library
ModelFusion 打字稿库 - OllamaKit for Swift 适用于 Swift 的 OllamaKit
- Ollama for Dart 飞镖的奥拉玛
- Ollama for Laravel Ollama for Laravel(拉拉维尔的奥拉玛)
- LangChainDart LangChain飞镖
- Semantic Kernel - Python
语义内核 - Python - Haystack 草垛
- Elixir LangChain Elixir LangChain(长生不老药朗链)
- Ollama for R - rollama
Ollama for R - 罗拉玛 - Ollama for R - ollama-r
- Ollama-ex for Elixir
- Ollama Connector for SAP ABAP
适用于 SAP ABAP 的 Ollama 连接器 - Testcontainers 测试容器
- Portkey 端口键
- PromptingTools.jl with an example
PromptingTools.jl 示例 - LlamaScript Llama脚本
- Raycast extension Raycast 扩展
- Discollama (Discord bot inside the Ollama discord channel)
Discollama(Ollama discord 频道内的 Discord 机器人) - Continue 继续
- Obsidian Ollama plugin Obsidian Ollama 插件
- Logseq Ollama plugin Logseq Ollama 插件
- NotesOllama (Apple Notes Ollama plugin)
NotesOllama (Apple Notes Ollama 插件) - Dagger Chatbot 匕首聊天机器人
- Discord AI Bot Discord AI 机器人
- Ollama Telegram Bot 不要创建电报机器人
- Hass Ollama Conversation
哈斯·奥拉玛对话 - Rivet plugin 铆钉插件
- Obsidian BMO Chatbot plugin
黑曜石BMO聊天机器人插件 - Cliobot (Telegram bot with Ollama support)
Cliobot(支持 Ollama 的 Telegram 机器人) - Copilot for Obsidian plugin
Copilot for Obsidian 插件 - Obsidian Local GPT plugin
黑曜石本地 GPT 插件 - Open Interpreter 开放口译员
- Llama Coder (Copilot alternative using Ollama)
Llama Coder(使用 Ollama 的 Copilot 替代方案) - Ollama Copilot (Proxy that allows you to use ollama as a copilot like Github copilot)
Ollama Copilot(允许您使用 ollama 作为 Github copilot 等副驾驶的代理) - twinny (Copilot and Copilot chat alternative using Ollama)
twinny(使用 Ollama 的 Copilot 和 Copilot 聊天替代方案) - Wingman-AI (Copilot code and chat alternative using Ollama and HuggingFace)
Wingman-AI(使用 Ollama 和 HuggingFace 的 Copilot 代码和聊天替代方案) - Page Assist (Chrome Extension)
页面助手(Chrome 扩展程序) - AI Telegram Bot (Telegram bot using Ollama in backend)
AI Telegram Bot(在后端使用 Ollama 的 Telegram 机器人) - AI ST Completion (Sublime Text 4 AI assistant plugin with Ollama support)
AI ST Complete(Sublime Text 4 AI 助手插件,支持 Ollama) - Discord-Ollama Chat Bot (Generalized TypeScript Discord Bot w/ Tuning Documentation)
Discord-Ollama 聊天机器人(通用 TypeScript Discord 机器人,带调整文档) - Discord AI chat/moderation bot Chat/moderation bot written in python. Uses Ollama to create personalities.
Discord AI 聊天/审核机器人 用 python 编写的聊天/审核机器人。使用 Ollama 创造个性。
- llama.cpp project founded by Georgi Gerganov.
llama.cpp由Georgi Gerganov创立的项目。