大模型应用开源技术

ollama

作者头像
项目作者ollama

Get up and running with OpenAI gpt-oss, DeepSeek-R1, Gemma 3 and other models.

ollama 预览图

ollama 介绍

了解项目的详细信息和使用方法

Ollama

Discord

快速上手大语言模型。

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.370B43GBollama run llama3.3
Llama 3.23B2.0GBollama run llama3.2
Llama 3.21B1.3GBollama run llama3.2:1b
Llama 3.2 Vision11B7.9GBollama run llama3.2-vision
Llama 3.2 Vision90B55GBollama run llama3.2-vision:90b
Llama 3.18B4.7GBollama run llama3.1
Llama 3.1405B231GBollama run llama3.1:405b
Phi 3 Mini3.8B2.3GBollama run phi3
Phi 3 Medium14B7.9GBollama run phi3:medium
Gemma 22B1.6GBollama run gemma2:2b
Gemma 29B5.5GBollama run gemma2
Gemma 227B16GBollama run gemma2:27b
Mistral7B4.1GBollama run mistral
Moondream 21.4B829MBollama run moondream
Neural Chat7B4.1GBollama run neural-chat
Starling7B4.1GBollama run starling-lm
Code Llama7B3.8GBollama run codellama
Llama 2 Uncensored7B3.8GBollama run llama2-uncensored
LLaVA7B4.5GBollama run llava
Solar10.7B6.1GBollama run solar

注意 您至少需要 8GB 的运行内存来运行 7B 的模型,16GB 来运行 13B 的模型,以及 32GB 来运行 33B 的模型。

自定义模型

从 GGUF 导入

Ollama 支持在 Modelfile 中导入 GGUF 模型:

  1. 创建一个名为 Modelfile 的文件,并使用 FROM 指令指向您要导入的本地模型文件路径。

    FROM ./vicuna-33b.Q4_0.gguf
    
  2. 在 Ollama 中创建模型:

    ollama create example -f Modelfile
    
  3. 运行模型:

    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

Desktop Applications

Mobile and Cross-Platform Applications

Chatbots and Interactive Tools

RAG (Retrieval-Augmented Generation) Tools

AI Frameworks and Libraries

Miscellaneous

Development and Integration Tools

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

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

  1. Raycast Extension: A tool to enhance productivity within the Raycast environment using Ollama.

  2. Discollama: A Discord bot specifically designed for the Ollama Discord channel.

  3. Continue: A project that likely involves continuing conversations or tasks using Ollama.

  4. Vibe: A tool for transcribing and analyzing meetings with Ollama's capabilities.

  5. Obsidian Plugins:

  6. Logseq Ollama Plugin: Integrates Ollama with the Logseq note-taking application.

  7. NotesOllama: An Apple Notes plugin that incorporates Ollama.

  8. 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.
  9. 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.
  10. 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

  1. OpenLIT: A monitoring tool for Ollama applications using OpenTelemetry.

  2. HoneyHive: An AI observability platform for monitoring AI agents' performance.

Hosting and Deployment

This list showcases the versatility of Ollama across various applications, from productivity tools to chatbots and development aids.

Stars
157.6k
Forks
13.9k
Watch
890
版本 v0.13.4
MIT License
更新于 2025年12月12日
deepseek, gemma, gemma3, gemma3n, go, golang, gpt-oss, llama, llama2, llama3, llava, llm, llms, mistral, ollama, phi4, qwen
免责声明:本站大资源来自网络收集整理,小部分资源来自原创,如有侵权等,请联系处理。

相关项目

探索更多类似的开源项目