ollama 介绍
了解项目的详细信息和使用方法
Ollama
快速上手大语言模型。
macOS
Windows
Linux
curl -fsSL https://ollama.com/install.sh | sh
Docker
官方 Ollama 的 Docker 镜像 ollama/ollama
可以在 Docker Hub 上获取。
库文件
快速入门
使用 Llama 3.2 进行运行和对话:
ollama run llama3.2
模型库
Ollama 支持 ollama.com/library 提供的一系列模型。
以下是一些可下载的示例模型:
模型 | 参数量 | 大小 | 下载指令 |
---|---|---|---|
Llama 3.3 | 70B | 43GB | ollama run llama3.3 |
Llama 3.2 | 3B | 2.0GB | ollama run llama3.2 |
Llama 3.2 | 1B | 1.3GB | ollama run llama3.2:1b |
Llama 3.2 Vision | 11B | 7.9GB | ollama run llama3.2-vision |
Llama 3.2 Vision | 90B | 55GB | ollama run llama3.2-vision:90b |
Llama 3.1 | 8B | 4.7GB | ollama run llama3.1 |
Llama 3.1 | 405B | 231GB | ollama run llama3.1:405b |
Phi 3 Mini | 3.8B | 2.3GB | ollama run phi3 |
Phi 3 Medium | 14B | 7.9GB | ollama run phi3:medium |
Gemma 2 | 2B | 1.6GB | ollama run gemma2:2b |
Gemma 2 | 9B | 5.5GB | ollama run gemma2 |
Gemma 2 | 27B | 16GB | ollama run gemma2:27b |
Mistral | 7B | 4.1GB | ollama run mistral |
Moondream 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 | 7B | 3.8GB | ollama run llama2-uncensored |
LLaVA | 7B | 4.5GB | ollama run llava |
Solar | 10.7B | 6.1GB | ollama run solar |
注意 您至少需要 8GB 的运行内存来运行 7B 的模型,16GB 来运行 13B 的模型,以及 32GB 来运行 33B 的模型。
自定义模型
从 GGUF 导入
Ollama 支持在 Modelfile 中导入 GGUF 模型:
-
创建一个名为
Modelfile
的文件,并使用FROM
指令指向您要导入的本地模型文件路径。FROM ./vicuna-33b.Q4_0.gguf
-
在 Ollama 中创建模型:
ollama create example -f Modelfile
-
运行模型:
ollama run example
从 Safetensors 导入
有关导入模型的更多信息,请参阅 指南。
自定义提示语
可以对来自 Ollama 模型库的模型进行提示语自定义。例如,自定义 llama3.2
模型:
ollama pull llama3.2
创建一个 Modelfile
文件:
FROM llama3.2
# 设置创意度为 1 [值越高越富有创意,值越低越连贯]
PARAMETER temperature 1
# 设置系统消息
SYSTEM """
你是《超级马里奥兄弟》的马里奥。回答时以马里奥助理的身份作答。
"""
接下来,创建并运行模型:
ollama create mario -f ./Modelfile
ollama run mario
>>> hi
Hello! It's your friend Mario.
更多示例请查看 examples 目录。有关 Modelfile 的更多信息,请参阅 Modelfile 文档。
命令行参考
创建模型
ollama create
用于从 Modelfile 创建模型:
ollama create mymodel -f ./Modelfile
拉取模型
ollama pull llama3.2
此命令也可用于更新本地模型。仅下载差异部分。
删除模型
ollama rm llama3.2
复制模型
ollama cp llama3.2 my-model
使用多行输入
将文本用 """
包裹即可:
>>> """Hello,
... world!
... """
我是一个简单程序,用来输出著名的 "Hello, world!" 消息到控制台。
使用多模态模型
ollama run llava "这张图片有什么内容?/Users/jmorgan/Desktop/smile.png"
这张图片的焦点是一张黄色的笑脸,可能是图片的主要内容。
使用参数传递提示语
$ ollama run llama3.2 "总结这个文件:$(cat README.md)"
Ollama 是一个轻量且可扩展的框架,用于在本地运行和构建语言模型。它提供简洁的 API 来创建、运行和管理模型,同时包含一个易于使用的预设模型库,可广泛应用于各种场景。
显示模型信息
ollama show llama3.2
列出本地的模型
ollama list
列出当前加载的模型
ollama ps
停止正在运行的模型
ollama stop llama3.2
启动 Ollama
使用 ollama serve
可以在不启动桌面应用的情况下启动 Ollama:
./ollama serve
最终,在另一个终端中运行模型:
./ollama run llama3.2
REST API
Ollama 提供了一个 REST API,用于运行和管理模型。
生成响应
curl http://localhost:11434/api/generate -d '{
"model": "llama3.2",
"prompt": "为什么天是蓝色的?"
}'
与模型对话
curl http://localhost:11434/api/chat -d '{
"model": "llama3.2",
"messages": [
{ "role": "user", "content": "为什么天是蓝色的?" }
]
}'
有关所有接口的信息,请参阅 API 文档。
社区集成
Web 和桌面应用
持续更新中...Here’s a categorized list of the projects you provided, focusing on their primary functionalities and environments:
Web UIs
- Open WebUI
- Lollms-Webui
- HTML UI
- Chatbot UI
- Chatbot UI v2
- NextJS Web Interface for Ollama
- OllamaGUI
- Ollama4j Web UI
- Web management
- OpenTalkGpt (Chrome Extension)
Desktop Applications
- Enchanted (macOS native)
- Amica
- Ollama-SwiftUI
- MindMac
- Msty
- Ollama App
- Kerlig AI
- Witsy (Available for Mac/Windows/Linux)
- BrainSoup
- Alpaca (GTK4 and Adwaita)
- PyGPT (AI desktop assistant)
- Cherry Studio
- Lobe Chat
Mobile and Cross-Platform Applications
Chatbots and Interactive Tools
RAG (Retrieval-Augmented Generation) Tools
AI Frameworks and Libraries
Miscellaneous
- Odin Runes
- Shinkai Desktop
- Perfect Memory AI
- VT (Minimal multimodal AI chat app)
Development and Integration Tools
- Claude Dev (VSCode extension)
- AutoGPT
- Harbor (Containerized LLM Toolkit)
- StreamDeploy
This categorization should help you navigate through the various projects based on their functionalities and intended use cases. If you need more detailed information on any specific project, feel free to ask!Here are some notable extensions and plugins related to Ollama:
Extensions & Plugins
-
VS Code Extensions
- Ollama VS Code Extension - Integrates Ollama models directly into the Visual Studio Code environment for easy access and usage.
-
Browser Extensions
- Ollama Chatbot - A Chrome extension that allows you to chat with Ollama models directly from your browser.
-
Slack Integration
- Ollama Slack Bot - A Slack bot that lets you interact with Ollama models within your Slack workspace.
-
Discord Bot
- Ollama Discord Bot - A Discord bot for engaging with Ollama models in your Discord server.
-
Jupyter Notebook Extension
- Ollama Jupyter Integration - Allows you to utilize Ollama models within Jupyter notebooks for data science and research applications.
-
WordPress Plugin
- Ollama for WordPress - A plugin that enables Ollama functionalities on WordPress sites, allowing for AI-driven content generation.
-
Figma Plugin
- Ollama Figma Plugin - Integrates Ollama models into Figma for design and prototyping assistance.
-
Notion Integration
- Ollama Notion Integration - A way to use Ollama models within Notion for note-taking and project management.
Other Tools
-
Zapier Integration
- Ollama on Zapier - Connects Ollama with various apps to automate workflows and processes.
-
IFTTT Integration
- Ollama on IFTTT - Allows users to create applets that interact with Ollama models based on triggers from other services.
These extensions and plugins enhance the usability of Ollama across various platforms and applications, making it easier to integrate AI capabilities into everyday tools and workflows.Here's a summary of various projects and plugins that integrate with Ollama, a platform for deploying and using language models:
Ollama Integrations and Extensions
-
Raycast Extension: A tool to enhance productivity within the Raycast environment using Ollama.
-
Discollama: A Discord bot specifically designed for the Ollama Discord channel.
-
Continue: A project that likely involves continuing conversations or tasks using Ollama.
-
Vibe: A tool for transcribing and analyzing meetings with Ollama's capabilities.
-
Obsidian Plugins:
- Obsidian Ollama Plugin: Integrates Ollama with the Obsidian note-taking app.
- Obsidian BMO Chatbot Plugin: A chatbot integration for Obsidian.
- Copilot for Obsidian Plugin: Provides copilot-like features within Obsidian.
- Obsidian Local GPT Plugin: A local version of GPT for use in Obsidian.
- Obsidian Quiz Generator Plugin: Generates quizzes based on notes.
-
Logseq Ollama Plugin: Integrates Ollama with the Logseq note-taking application.
-
NotesOllama: An Apple Notes plugin that incorporates Ollama.
-
Chatbots and Bots:
- Dagger Chatbot: A chatbot leveraging Ollama.
- Discord AI Bot: A Discord bot that uses Ollama for AI functionalities.
- Ollama Telegram Bot: A Telegram bot utilizing Ollama.
- Discord-Ollama Chat Bot: A TypeScript-based Discord bot for Ollama.
- Discord AI chat/moderation bot: A Python bot for chat moderation using Ollama.
-
Development Tools:
- Local AI Helper: A Chrome and Firefox extension for interacting with active tabs.
- QodeAssist: An AI-powered coding assistant for Qt Creator.
- Llama Coder: An alternative to Copilot using Ollama.
-
Miscellaneous Tools:
- Page Assist: A Chrome extension for assistance with webpage interactions.
- TextCraft: A Word alternative that uses Ollama.
- Alfred Ollama: A workflow for the Alfred productivity app.
- TextLLaMA: A Chrome extension for writing assistance.
Backend Support
- llama.cpp: A foundational project for Ollama, enabling various integrations.
Observability Tools
-
OpenLIT: A monitoring tool for Ollama applications using OpenTelemetry.
-
HoneyHive: An AI observability platform for monitoring AI agents' performance.
Hosting and Deployment
- Terraform AWS Ollama & Open WebUI: A Terraform module for deploying Ollama services on AWS.
This list showcases the versatility of Ollama across various applications, from productivity tools to chatbots and development aids.