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.
```
### Multimodal models
```
ollama run llava "What's in this image? /Users/jmorgan/Desktop/smile.png"
```
> **Output**: The image features a yellow smiley face, which is likely the central focus of the picture.
### Pass the prompt as an argument
```shell
ollama run llama3.2 "Summarize this file: $(cat README.md)"
```
> **Output**: 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.
### Show model information
```shell
ollama show llama3.2
```
### List models on your computer
```shell
ollama list
```
### List which models are currently loaded
```shell
ollama ps
```
### Stop a model which is currently running
```shell
ollama stop llama3.2
```
### Start Ollama
`ollama serve` is used when you want to start ollama without running the desktop application.
## Building
See the [developer guide](https://github.com/ollama/ollama/blob/main/docs/development.md)
### Running local builds
Next, start the server:
```shell
./ollama serve
```
Finally, in a separate shell, run a model:
```shell
./ollama run llama3.2
```
## REST API
Ollama has a REST API for running and managing models.
### Generate a response
```shell
curl http://localhost:11434/api/generate -d'{
"model": "llama3.2",
"prompt":"Why is the sky blue?"
}'
```
### Chat with a model
```shell
curl http://localhost:11434/api/chat -d'{
"model": "llama3.2",
"messages": [
{ "role": "user", "content": "why is the sky blue?" }
]
}'
```
See the [API documentation](./docs/api.md) for all endpoints.
-[TagSpaces](https://www.tagspaces.org)(A platform for file-based apps, [utilizing Ollama](https://docs.tagspaces.org/ai/) for the generation of tags and descriptions)
-[IntelliBar](https://intellibar.app/)(AI-powered assistant for macOS)
-[Jirapt](https://github.com/AliAhmedNada/jirapt)(Jira Integration to generate issues, tasks, epics)
-[ojira](https://github.com/AliAhmedNada/ojira)(Jira chrome plugin to easily generate descriptions for tasks)
-[QA-Pilot](https://github.com/reid41/QA-Pilot)(Interactive chat tool that can leverage Ollama models for rapid understanding and navigation of GitHub code repositories)
-[ChatOllama](https://github.com/sugarforever/chat-ollama)(Open Source Chatbot based on Ollama with Knowledge Bases)
-[CRAG Ollama Chat](https://github.com/Nagi-ovo/CRAG-Ollama-Chat)(Simple Web Search with Corrective RAG)
-[RAGFlow](https://github.com/infiniflow/ragflow)(Open-source Retrieval-Augmented Generation engine based on deep document understanding)
-[chat](https://github.com/swuecho/chat)(chat web app for teams)
-[Lobe Chat](https://github.com/lobehub/lobe-chat) with [Integrating Doc](https://lobehub.com/docs/self-hosting/examples/ollama)
-[Ollama RAG Chatbot](https://github.com/datvodinh/rag-chatbot.git)(Local Chat with multiple PDFs using Ollama and RAG)
-[BrainSoup](https://www.nurgo-software.com/products/brainsoup)(Flexible native client with RAG & multi-agent automation)
-[macai](https://github.com/Renset/macai)(macOS client for Ollama, ChatGPT, and other compatible API back-ends)
-[RWKV-Runner](https://github.com/josStorer/RWKV-Runner)(RWKV offline LLM deployment tool, also usable as a client for ChatGPT and Ollama)
-[Ollama Grid Search](https://github.com/dezoito/ollama-grid-search)(app to evaluate and compare models)
-[Olpaka](https://github.com/Otacon/olpaka)(User-friendly Flutter Web App for Ollama)
-[Casibase](https://casibase.org)(An open source AI knowledge base and dialogue system combining the latest RAG, SSO, ollama support, and multiple large language models.)
-[OllamaSpring](https://github.com/CrazyNeil/OllamaSpring)(Ollama Client for macOS)
-[LLocal.in](https://github.com/kartikm7/llocal)(Easy to use Electron Desktop Client for Ollama)
-[Shinkai Desktop](https://github.com/dcSpark/shinkai-apps)(Two click install Local AI using Ollama + Files + RAG)
-[AiLama](https://github.com/zeyoyt/ailama)(A Discord User App that allows you to interact with Ollama anywhere in Discord)
-[Ollama with Google Mesop](https://github.com/rapidarchitect/ollama_mesop/)(Mesop Chat Client implementation with Ollama)
-[Local Multimodal AI Chat](https://github.com/Leon-Sander/Local-Multimodal-AI-Chat)(Ollama-based LLM Chat with support for multiple features, including PDF RAG, voice chat, image-based interactions, and integration with OpenAI.)
-[ARGO](https://github.com/xark-argo/argo)(Locally download and run Ollama and Huggingface models with RAG and deep research on Mac/Windows/Linux)
-[OrionChat](https://github.com/EliasPereirah/OrionChat) - OrionChat is a web interface for chatting with different AI providers
-[G1](https://github.com/bklieger-groq/g1)(Prototype of using prompting strategies to improve the LLM's reasoning through o1-like reasoning chains.)
-[Perfect Memory AI](https://www.perfectmemory.ai/)(Productivity AI assists personalized by what you have seen on your screen, heard, and said in the meetings)
-[Hexabot](https://github.com/hexastack/hexabot)(A conversational AI builder)
-[Reddit Rate](https://github.com/rapidarchitect/reddit_analyzer)(Search and Rate Reddit topics with a weighted summation)
-[OpenTalkGpt](https://github.com/adarshM84/OpenTalkGpt)(Chrome Extension to manage open-source models supported by Ollama, create custom models, and chat with models from a user-friendly UI)
-[VT](https://github.com/vinhnx/vt.ai)(A minimal multimodal AI chat app, with dynamic conversation routing. Supports local models via Ollama)
-[Nosia](https://github.com/nosia-ai/nosia)(Easy to install and use RAG platform based on Ollama)
-[Witsy](https://github.com/nbonamy/witsy)(An AI Desktop application available for Mac/Windows/Linux)
-[Abbey](https://github.com/US-Artificial-Intelligence/abbey)(A configurable AI interface server with notebooks, document storage, and YouTube support)
-[Minima](https://github.com/dmayboroda/minima)(RAG with on-premises or fully local workflow)
-[aidful-ollama-model-delete](https://github.com/AidfulAI/aidful-ollama-model-delete)(User interface for simplified model cleanup)
-[Perplexica](https://github.com/ItzCrazyKns/Perplexica)(An AI-powered search engine & an open-source alternative to Perplexity AI)
-[Ollama Chat WebUI for Docker ](https://github.com/oslook/ollama-webui)(Support for local docker deployment, lightweight ollama webui)
-[AI Toolkit for Visual Studio Code](https://aka.ms/ai-tooklit/ollama-docs)(Microsoft-official VSCode extension to chat, test, evaluate models with Ollama support, and use them in your AI applications.)
-[MinimalNextOllamaChat](https://github.com/anilkay/MinimalNextOllamaChat)(Minimal Web UI for Chat and Model Control)
-[Chipper](https://github.com/TilmanGriesel/chipper) AI interface for tinkerers (Ollama, Haystack RAG, Python)
-[ChibiChat](https://github.com/CosmicEventHorizon/ChibiChat)(Kotlin-based Android app to chat with Ollama and Koboldcpp API endpoints)
-[LocalLLM](https://github.com/qusaismael/localllm)(Minimal Web-App to run ollama models on it with a GUI)
-[Ollamazing](https://github.com/buiducnhat/ollamazing)(Web extension to run Ollama models)
-[OpenDeepResearcher-via-searxng](https://github.com/benhaotang/OpenDeepResearcher-via-searxng)(A Deep Research equivalent endpoint with Ollama support for running locally)
-[1Panel](https://github.com/1Panel-dev/1Panel/)(Web-based Linux Server Management Tool)
-[AstrBot](https://github.com/Soulter/AstrBot/)(User-friendly LLM-based multi-platform chatbot with a WebUI, supporting RAG, LLM agents, and plugins integration)
-[Reins](https://github.com/ibrahimcetin/reins)(Easily tweak parameters, customize system prompts per chat, and enhance your AI experiments with reasoning model support.)
-[Flufy](https://github.com/Aharon-Bensadoun/Flufy)(A beautiful chat interface for interacting with Ollama's API. Built with React, TypeScript, and Material-UI.)
-[Ellama](https://github.com/zeozeozeo/ellama)(Friendly native app to chat with an Ollama instance)
-[screenpipe](https://github.com/mediar-ai/screenpipe) Build agents powered by your screen history
-[Ollamb](https://github.com/hengkysteen/ollamb)(Simple yet rich in features, cross-platform built with Flutter and designed for Ollama. Try the [web demo](https://hengkysteen.github.io/demo/ollamb/).)
-[Writeopia](https://github.com/Writeopia/Writeopia)(Text editor with integration with Ollama)
-[AppFlowy](https://github.com/AppFlowy-IO/AppFlowy)(AI collaborative workspace with Ollama, cross-platform and self-hostable)
-[Lumina](https://github.com/cushydigit/lumina.git)(A lightweight, minimal React.js frontend for interacting with Ollama servers)
-[Tiny Notepad](https://pypi.org/project/tiny-notepad)(A lightweight, notepad-like interface to chat with ollama available on PyPI)
-[macLlama (macOS native)](https://github.com/hellotunamayo/macLlama)(A native macOS GUI application for interacting with Ollama models, featuring a chat interface.)
-[GPTranslate](https://github.com/philberndt/GPTranslate)(A fast and lightweight, AI powered desktop translation application written with Rust and Tauri. Features real-time translation with OpenAI/Azure/Ollama.)
-[ollama launcher](https://github.com/NGC13009/ollama-launcher)(A launcher for Ollama, aiming to provide users with convenient functions such as ollama server launching, management, or configuration.)
-[ai-hub](https://github.com/Aj-Seven/ai-hub)(AI Hub supports multiple models via API keys and Chat support via Ollama API.)
-[Mayan EDMS](https://gitlab.com/mayan-edms/mayan-edms)(Open source document management system to organize, tag, search, and automate your files with powerful Ollama driven workflows.)
-[Ollama Mixture of Experts (MOE) in 50 lines of code](https://github.com/rapidarchitect/ollama_moe)
-[vim-intelligence-bridge](https://github.com/pepo-ec/vim-intelligence-bridge) Simple interaction of "Ollama" with the Vim editor
-[x-cmd ollama](https://x-cmd.com/mod/ollama)
-[bb7](https://github.com/drunkwcodes/bb7)
-[SwollamaCLI](https://github.com/marcusziade/Swollama) bundled with the Swollama Swift package. [Demo](https://github.com/marcusziade/Swollama?tab=readme-ov-file#cli-usage)
-[aichat](https://github.com/sigoden/aichat) All-in-one LLM CLI tool featuring Shell Assistant, Chat-REPL, RAG, AI tools & agents, with access to OpenAI, Claude, Gemini, Ollama, Groq, and more.
-[PowershAI](https://github.com/rrg92/powershai) PowerShell module that brings AI to terminal on Windows, including support for Ollama
-[DeepShell](https://github.com/Abyss-c0re/deepshell) Your self-hosted AI assistant. Interactive Shell, Files and Folders analysis.
-[orbiton](https://github.com/xyproto/orbiton) Configuration-free text editor and IDE with support for tab completion with Ollama.
-[orca-cli](https://github.com/molbal/orca-cli) Ollama Registry CLI Application - Browse, pull, and download models from Ollama Registry in your terminal.
-[GGUF-to-Ollama](https://github.com/jonathanhecl/gguf-to-ollama) - Importing GGUF to Ollama made easy (multiplatform)
-[AWS-Strands-With-Ollama](https://github.com/rapidarchitect/ollama_strands) - AWS Strands Agents with Ollama Examples
-[ollama-multirun](https://github.com/attogram/ollama-multirun) - A bash shell script to run a single prompt against any or all of your locally installed ollama models, saving the output and performance statistics as easily navigable web pages. ([Demo](https://attogram.github.io/ai_test_zone/))
-[ollama-bash-toolshed](https://github.com/attogram/ollama-bash-toolshed) - Bash scripts to chat with tool using models. Add new tools to your shed with ease. Runs on Ollama.
### Apple Vision Pro
-[SwiftChat](https://github.com/aws-samples/swift-chat)(Cross-platform AI chat app supporting Apple Vision Pro via "Designed for iPad")
-[pgai](https://github.com/timescale/pgai) - PostgreSQL as a vector database (Create and search embeddings from Ollama models using pgvector)
-[Get started guide](https://github.com/timescale/pgai/blob/main/docs/vectorizer-quick-start.md)
-[MindsDB](https://github.com/mindsdb/mindsdb/blob/staging/mindsdb/integrations/handlers/ollama_handler/README.md)(Connects Ollama models with nearly 200 data platforms and apps)
-[chromem-go](https://github.com/philippgille/chromem-go/blob/v0.5.0/embed_ollama.go) with [example](https://github.com/philippgille/chromem-go/tree/v0.5.0/examples/rag-wikipedia-ollama)
-[Kangaroo](https://github.com/dbkangaroo/kangaroo)(AI-powered SQL client and admin tool for popular databases)
-[LangChain](https://python.langchain.com/docs/integrations/chat/ollama/) and [LangChain.js](https://js.langchain.com/docs/integrations/chat/ollama/) with [example](https://js.langchain.com/docs/tutorials/local_rag/)
-[Yacana](https://remembersoftwares.github.io/yacana/)(User-friendly multi-agent framework for brainstorming and executing predetermined flows with built-in tool integration)
-[Spring AI](https://github.com/spring-projects/spring-ai) with [reference](https://docs.spring.io/spring-ai/reference/api/chat/ollama-chat.html) and [example](https://github.com/tzolov/ollama-tools)
-[LangChainGo](https://github.com/tmc/langchaingo/) with [example](https://github.com/tmc/langchaingo/tree/main/examples/ollama-completion-example)
-[LangChain4j](https://github.com/langchain4j/langchain4j) with [example](https://github.com/langchain4j/langchain4j-examples/tree/main/ollama-examples/src/main/java)
-[LangChainRust](https://github.com/Abraxas-365/langchain-rust) with [example](https://github.com/Abraxas-365/langchain-rust/blob/main/examples/llm_ollama.rs)
-[LangChain for .NET](https://github.com/tryAGI/LangChain) with [example](https://github.com/tryAGI/LangChain/blob/main/examples/LangChain.Samples.OpenAI/Program.cs)
-[LlamaIndex](https://docs.llamaindex.ai/en/stable/examples/llm/ollama/) and [LlamaIndexTS](https://ts.llamaindex.ai/modules/llms/available_llms/ollama)
-[LiteLLM](https://github.com/BerriAI/litellm)
-[OllamaFarm for Go](https://github.com/presbrey/ollamafarm)
-[OllamaSharp for .NET](https://github.com/awaescher/OllamaSharp)
-[Ollama for Ruby](https://github.com/gbaptista/ollama-ai)
-[Ollama-rs for Rust](https://github.com/pepperoni21/ollama-rs)
-[Ollama-hpp for C++](https://github.com/jmont-dev/ollama-hpp)
-[Ollama4j for Java](https://github.com/ollama4j/ollama4j)
-[PromptingTools.jl](https://github.com/svilupp/PromptingTools.jl) with an [example](https://svilupp.github.io/PromptingTools.jl/dev/examples/working_with_ollama)
-[Agents-Flex for Java](https://github.com/agents-flex/agents-flex) with [example](https://github.com/agents-flex/agents-flex/tree/main/agents-flex-llm/agents-flex-llm-ollama/src/test/java/com/agentsflex/llm/ollama)
-[Parakeet](https://github.com/parakeet-nest/parakeet) is a GoLang library, made to simplify the development of small generative AI applications with Ollama.
-[Haverscript](https://github.com/andygill/haverscript) with [examples](https://github.com/andygill/haverscript/tree/main/examples)
-[Ollama for Swift](https://github.com/mattt/ollama-swift)
-[Swollama for Swift](https://github.com/marcusziade/Swollama) with [DocC](https://marcusziade.github.io/Swollama/documentation/swollama/)
-[GoLamify](https://github.com/prasad89/golamify)
-[Ollama for Haskell](https://github.com/tusharad/ollama-haskell)
-[multi-llm-ts](https://github.com/nbonamy/multi-llm-ts)(A Typescript/JavaScript library allowing access to different LLM in a unified API)
-[LlmTornado](https://github.com/lofcz/llmtornado)(C# library providing a unified interface for major FOSS & Commercial inference APIs)
-[Ollama for Zig](https://github.com/dravenk/ollama-zig)
-[Abso](https://github.com/lunary-ai/abso)(OpenAI-compatible TypeScript SDK for any LLM provider)
-[Nichey](https://github.com/goodreasonai/nichey) is a Python package for generating custom wikis for your research topic
-[Ollama for D](https://github.com/kassane/ollama-d)
-[OllamaPlusPlus](https://github.com/HardCodeDev777/OllamaPlusPlus)(Very simple C++ library for Ollama)
### Mobile
-[SwiftChat](https://github.com/aws-samples/swift-chat)(Lightning-fast Cross-platform AI chat app with native UI for Android, iOS, and iPad)
-[Ollama App](https://github.com/JHubi1/ollama-app)(Modern and easy-to-use multi-platform client for Ollama)
-[ConfiChat](https://github.com/1runeberg/confichat)(Lightweight, standalone, multi-platform, and privacy-focused LLM chat interface with optional encryption)
-[Ollama Android Chat](https://github.com/sunshine0523/OllamaServer)(No need for Termux, start the Ollama service with one click on an Android device)
-[Reins](https://github.com/ibrahimcetin/reins)(Easily tweak parameters, customize system prompts per chat, and enhance your AI experiments with reasoning model support.)
-[Plasmoid Ollama Control](https://github.com/imoize/plasmoid-ollamacontrol)(KDE Plasma extension that allows you to quickly manage/control Ollama model)
-[AI Telegram Bot](https://github.com/tusharhero/aitelegrambot)(Telegram bot using Ollama in backend)
-[AI ST Completion](https://github.com/yaroslavyaroslav/OpenAI-sublime-text)(Sublime Text 4 AI assistant plugin with Ollama support)
-[ChatGPTBox: All in one browser extension](https://github.com/josStorer/chatGPTBox) with [Integrating Tutorial](https://github.com/josStorer/chatGPTBox/issues/616#issuecomment-1975186467)
-[Discord AI chat/moderation bot](https://github.com/rapmd73/Companion) Chat/moderation bot written in python. Uses Ollama to create personalities.
-[Headless Ollama](https://github.com/nischalj10/headless-ollama)(Scripts to automatically install ollama client & models on any OS for apps that depend on ollama server)
-[Terraform AWS Ollama & Open WebUI](https://github.com/xuyangbocn/terraform-aws-self-host-llm)(A Terraform module to deploy on AWS a ready-to-use Ollama service, together with its front-end Open WebUI service.)
-[Local AI Helper](https://github.com/ivostoykov/localAI)(Chrome and Firefox extensions that enable interactions with the active tab and customisable API endpoints. Includes secure storage for user prompts.)
-[vnc-lm](https://github.com/jake83741/vnc-lm)(Discord bot for messaging with LLMs through Ollama and LiteLLM. Seamlessly move between local and flagship models.)
-[LSP-AI](https://github.com/SilasMarvin/lsp-ai)(Open-source language server for AI-powered functionality)
-[QodeAssist](https://github.com/Palm1r/QodeAssist)(AI-powered coding assistant plugin for Qt Creator)
-[LLM Telegram Bot](https://github.com/innightwolfsleep/llm_telegram_bot)(telegram bot, primary for RP. Oobabooga-like buttons, [A1111](https://github.com/AUTOMATIC1111/stable-diffusion-webui) API integration e.t.c)
-[mcp-llm](https://github.com/sammcj/mcp-llm)(MCP Server to allow LLMs to call other LLMs)
-[SimpleOllamaUnity](https://github.com/HardCodeDev777/SimpleOllamaUnity)(Unity Engine extension for communicating with Ollama in a few lines of code. Also works at runtime)
-[UnityCodeLama](https://github.com/HardCodeDev777/UnityCodeLama)(Unity Edtior tool to analyze scripts via Ollama)
-[NativeMind](https://github.com/NativeMindBrowser/NativeMindExtension)(Private, on-device AI Assistant, no cloud dependencies)
-[GMAI - Gradle Managed AI](https://gmai.premex.se/)(Gradle plugin for automated Ollama lifecycle management during build phases)
更多使用方式请参考[原项目](https://github.com/ollama/ollama)。
### Supported backends
注意:每次运行前请检查环境变量`HSA_OVERRIDE_GFX_VERSION`是否正确设置。
-[llama.cpp](https://github.com/ggml-org/llama.cpp) project founded by Georgi Gerganov.
## 参考资料
### Observability
-[Opik](https://www.comet.com/docs/opik/cookbook/ollama) is an open-source platform to debug, evaluate, and monitor your LLM applications, RAG systems, and agentic workflows with comprehensive tracing, automated evaluations, and production-ready dashboards. Opik supports native intergration to Ollama.
-[Lunary](https://lunary.ai/docs/integrations/ollama) is the leading open-source LLM observability platform. It provides a variety of enterprise-grade features such as real-time analytics, prompt templates management, PII masking, and comprehensive agent tracing.
-[OpenLIT](https://github.com/openlit/openlit) is an OpenTelemetry-native tool for monitoring Ollama Applications & GPUs using traces and metrics.
-[HoneyHive](https://docs.honeyhive.ai/integrations/ollama) is an AI observability and evaluation platform for AI agents. Use HoneyHive to evaluate agent performance, interrogate failures, and monitor quality in production.
-[Langfuse](https://langfuse.com/docs/integrations/ollama) is an open source LLM observability platform that enables teams to collaboratively monitor, evaluate and debug AI applications.
-[MLflow Tracing](https://mlflow.org/docs/latest/llms/tracing/index.html#automatic-tracing) is an open source LLM observability tool with a convenient API to log and visualize traces, making it easy to debug and evaluate GenAI applications.