ollama
https://github.com/ollama/ollama
开始使用大型语言模型。
macOS
下载
Windows 预览版
下载
Linux
curl -fsSL https://ollama.com/install.sh | sh
手动安装说明
Docker
官方Ollama Docker 镜像 ollama/ollama可在 Docker Hub 上获取。
图书馆
-
ollama-python
-
ollama-js
快速入门
要运行Llama 3.1并与它聊天:
ollama run llama3.1
模型库
Ollama 支持ollama.com/library上提供的一系列模型
以下是一些可供下载的示例模型:
笔记
您应该至少有 8 GB 的 RAM 来运行 7B 型号,16 GB 的 RAM 来运行 13B 型号,32 GB 的 RAM 来运行 33B 型号。
自定义模型
从 GGUF 导入
Ollama 支持在 Modelfile 中导入 GGUF 模型:
- 创建一个名为 的文件Modelfile,其中包含FROM要导入的模型的本地文件路径的指令。
FROM ./vicuna-33b.Q4_0.gguf
- 在 Ollama 中创建模型
ollama create example -f Modelfile
- 运行模型
ollama run example
从 PyTorch 或 Safetensors 导入
请参阅导入模型的指南以了解更多信息。
自定义提示
可以使用提示自定义 Ollama 库中的模型。例如,要自定义模型llama3.1:
ollama pull llama3.1
创建一个Modelfile:
FROM llama3.1
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.
"""
接下来创建并运行模型:
ollama create mario -f ./Modelfile
ollama run mario
hi
Hello! It's your friend Mario.
有关更多示例,请参阅示例目录。有关使用 Modelfile 的更多信息,请参阅Modelfile文档。
CLI 参考
创建模型
ollama create用于从 Modelfile 创建模型。
ollama create mymodel -f ./Modelfile
拉取模型
ollama pull llama3.1
此命令还可用于更新本地模型。仅会提取差异。
删除模型
ollama rm llama3.1
复制模型
ollama cp llama3.1 my-model
多行输入
对于多行输入,你可以使用以下方式换行""":
"""Hello,
... world!
... """
I'm a basic program that prints the famous "Hello, world!" message to the console.
多模态模型
ollama run llava "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.1 "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 show llama3.1
列出计算机上的模型
ollama list
启动 Ollama
ollama serve当您想启动 ollama 而不运行桌面应用程序时使用。
建筑
查看开发者指南
运行本地构建
接下来启动服务器:
./ollama serve
最后,在一个单独的 shell 中运行一个模型:
./ollama run llama3.1
REST API
Ollama 有一个用于运行和管理模型的 REST API。
生成响应
curl http://localhost:11434/api/generate -d '{
"model": "llama3.1",
"prompt":"Why is the sky blue?"
}'
与模特聊天
curl http://localhost:11434/api/chat -d '{
"model": "llama3.1",
"messages": [
{ "role": "user", "content": "why is the sky blue?" }
]
}'
查看所有端点的API 文档。
社区整合
Web & Desktop
-
Open WebUI
-
Enchanted (macOS native)
-
Hollama
-
Lollms-Webui
-
LibreChat
-
Bionic GPT
-
HTML UI
-
Saddle
-
Chatbot UI
-
Chatbot UI v2
-
Typescript UI
-
Minimalistic React UI for Ollama Models
-
Ollamac
-
big-AGI
-
Cheshire Cat assistant framework
-
Amica
-
chatd
-
Ollama-SwiftUI
-
Dify.AI
-
MindMac
-
NextJS Web Interface for Ollama
-
Msty
-
Chatbox
-
WinForm Ollama Copilot
-
NextChat with Get Started Doc
-
Alpaca WebUI
-
OllamaGUI
-
OpenAOE
-
Odin Runes
-
LLM-X (Progressive Web App)
-
AnythingLLM (Docker + MacOs/Windows/Linux native app)
-
Ollama Basic Chat: Uses HyperDiv Reactive UI
-
Ollama-chats RPG
-
QA-Pilot (Chat with Code Repository)
-
ChatOllama (Open Source Chatbot based on Ollama with Knowledge Bases)
-
CRAG Ollama Chat (Simple Web Search with Corrective RAG)
-
RAGFlow (Open-source Retrieval-Augmented Generation engine based on deep document understanding)
-
StreamDeploy (LLM Application Scaffold)
-
chat (chat web app for teams)
-
Lobe Chat with Integrating Doc
-
Ollama RAG Chatbot (Local Chat with multiple PDFs using Ollama and RAG)
-
BrainSoup (Flexible native client with RAG & multi-agent automation)
-
macai (macOS client for Ollama, ChatGPT, and other compatible API back-ends)
-
Olpaka (User-friendly Flutter Web App for Ollama)
-
OllamaSpring (Ollama Client for macOS)
-
LLocal.in (Easy to use Electron Desktop Client for Ollama)
-
Ollama with Google Mesop (Mesop Chat Client implementation with Ollama)
-
Painting Droid (Painting app with AI integrations)
-
Kerlig AI (AI writing assistant for macOS)
-
AI Studio
-
Sidellama (browser-based LLM client)
-
LLMStack (No-code multi-agent framework to build LLM agents and workflows)
-
BoltAI for Mac (AI Chat Client for Mac)
-
Harbor (Containerized LLM Toolkit with Ollama as default backend)
-
Go-CREW (Powerful Offline RAG in Golang)
-
PartCAD (CAD model generation with OpenSCAD and CadQuery)
-
Ollama4j Web UI - Java-based Web UI for Ollama built with Vaadin, Spring Boot and Ollama4j
-
PyOllaMx - macOS application capable of chatting with both Ollama and Apple MLX models.
Terminal
-
oterm
-
Ellama Emacs client
-
Emacs client
-
gen.nvim
-
ollama.nvim
-
ollero.nvim
-
ollama-chat.nvim
-
ogpt.nvim
-
gptel Emacs client
-
Oatmeal
-
cmdh
-
ooo
-
shell-pilot
-
tenere
-
llm-ollama for Datasette's LLM CLI.
-
typechat-cli
-
ShellOracle
-
tlm
-
podman-ollama
-
gollama
-
Ollama eBook Summary
Database
-
MindsDB (Connects Ollama models with nearly 200 data platforms and apps)
-
chromem-go with example
Package managers
-
Pacman
-
Helm Chart
-
Guix channel
-
Nix package
-
Flox
Libraries
-
LangChain and LangChain.js with example
-
Firebase Genkit
-
LangChainGo with example
-
LangChain4j with example
-
LangChainRust with example
-
LlamaIndex
-
LiteLLM
-
OllamaFarm for Go
-
OllamaSharp for .NET
-
Ollama for Ruby
-
Ollama-rs for Rust
-
Ollama-hpp for C++
-
Ollama4j for Java
-
ModelFusion Typescript Library
-
OllamaKit for Swift
-
Ollama for Dart
-
Ollama for Laravel
-
LangChainDart
-
Semantic Kernel - Python
-
Haystack
-
Elixir LangChain
-
Ollama for R - rollama
-
Ollama for R - ollama-r
-
Ollama-ex for Elixir
-
Ollama Connector for SAP ABAP
-
Testcontainers
-
Portkey
-
PromptingTools.jl with an example
-
LlamaScript
-
Ollamaclient for Golang
Mobile
-
Enchanted
-
Maid
Extensions & Plugins
-
Raycast extension
-
Discollama (Discord bot inside the Ollama discord channel)
-
Continue
-
Obsidian Ollama plugin
-
Logseq Ollama plugin
-
NotesOllama (Apple Notes Ollama plugin)
-
Dagger Chatbot
-
Discord AI Bot
-
Ollama Telegram Bot
-
Hass Ollama Conversation
-
Rivet plugin
-
Obsidian BMO Chatbot plugin
-
Cliobot (Telegram bot with Ollama support)
-
Copilot for Obsidian plugin
-
Obsidian Local GPT plugin
-
Open Interpreter
-
Llama Coder (Copilot alternative using Ollama)
-
Ollama Copilot (Proxy that allows you to use ollama as a copilot like Github copilot)
-
twinny (Copilot and Copilot chat alternative using Ollama)
-
Wingman-AI (Copilot code and chat alternative using Ollama and Hugging Face)
-
Page Assist (Chrome Extension)
-
AI Telegram Bot (Telegram bot using Ollama in backend)
-
AI ST Completion (Sublime Text 4 AI assistant plugin with Ollama support)
-
Discord-Ollama Chat Bot (Generalized TypeScript Discord Bot w/ Tuning Documentation)
-
Discord AI chat/moderation bot Chat/moderation bot written in python. Uses Ollama to create personalities.
-
Headless Ollama (Scripts to automatically install ollama client & models on any OS for apps that depends on ollama server)
Supported backends
- llama.cpp project founded by Georgi Gerganov.