### Launch OpenClaw Source: https://docs.ollama.com/integrations/openclaw Launches OpenClaw, handling installation, security prompts, model selection, and gateway setup automatically. This is the recommended starting point. ```bash ollama launch openclaw ``` -------------------------------- ### Quick Ollama Droid Setup Source: https://docs.ollama.com/integrations/droid Launches Droid with Ollama using a simple command. This is the fastest way to get started. ```bash ollama launch droid ``` -------------------------------- ### Manual Hermes Installation Source: https://docs.ollama.com/integrations/hermes Install Hermes directly by running the setup wizard via curl. ```shellscript curl -fsSL ``` -------------------------------- ### Python: Install Ollama SDK Source: https://docs.ollama.com/llms-full.txt Install the Ollama Python SDK using pip or uv. This is a prerequisite for using the Python code examples. ```bash # with pip pip install ollama -U # with uv uv add ollama ``` -------------------------------- ### Manual Setup for Oh My Pi with Ollama Source: https://docs.ollama.com/integrations/oh-my-pi After installing Oh My Pi from omp.sh, use this command to launch it with Ollama integration, which prompts for configuration. ```bash ollama launch omp --config ``` -------------------------------- ### Hermes Setup Options Source: https://docs.ollama.com/integrations/hermes When setting up Hermes, you can choose between a quick setup or a full configuration. The quick setup is recommended for most users. ```text How would you like to set up Hermes? → Quick setup — provider, model & messaging (recommended) Full setup — configure everything ``` -------------------------------- ### Launch Pi with Ollama Source: https://docs.ollama.com/integrations/pi Installs Pi, configures Ollama as a provider, and starts an interactive session. Use the --config flag to configure without launching. ```bash ollama launch pi ``` ```bash ollama launch pi --config ``` -------------------------------- ### Launch Pi with Ollama Source: https://docs.ollama.com/integrations/pi This command installs Pi if needed, configures Ollama as a provider, and starts an interactive session. ```shellscript ollama launch pi ``` -------------------------------- ### Install Pi Source: https://docs.ollama.com/integrations/pi Install Pi using the provided shell command. This is the initial step for setting up Pi. ```shellscript ollama run pi ``` -------------------------------- ### Launch Applications with GPT-OSS Model Source: https://ollama.com/library/gpt-oss Examples of launching various applications using the GPT-OSS model. These commands assume Ollama is installed and the model is available. ```bash ollama launch claude --model gpt-oss ``` ```bash ollama launch codex-app --model gpt-oss ``` ```bash ollama launch openclaw --model gpt-oss ``` ```bash ollama launch hermes --model gpt-oss ``` ```bash ollama launch codex --model gpt-oss ``` ```bash ollama launch opencode --model gpt-oss ``` -------------------------------- ### Quick Setup: Configure Ollama for Codex without Launching Source: https://docs.ollama.com/integrations/codex Opens the configuration for Ollama's Codex profile without immediately launching the application. Use this to modify settings before starting. ```bash ollama launch codex --config ``` -------------------------------- ### Manual Hermes Installation Source: https://docs.ollama.com/integrations/hermes Install Hermes directly by downloading and executing the installation script. This bypasses the default `ollama launch hermes` command. ```shellscript curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash ``` -------------------------------- ### Install Pi Agent Source: https://docs.ollama.com/integrations/pi Install the Pi agent using the provided shell command. This is the initial step for setting up the agent. ```shellscript curl -fsSL https://pi.ai/install.sh | bash ``` -------------------------------- ### Enable and start Ollama service Source: https://docs.ollama.com/llms-full.txt Reload systemd, enable the Ollama service to start on boot, and start it immediately. ```shell sudo systemctl daemon-reload sudo systemctl enable ollama ``` -------------------------------- ### Launch Oh My Pi with Ollama Default Configuration Source: https://docs.ollama.com/integrations/oh-my-pi This command launches Oh My Pi, configuring Ollama as the model provider and enabling web search tools. It's the quickest way to get started. ```bash ollama launch omp ``` -------------------------------- ### Install OpenCode CLI Source: https://docs.ollama.com/integrations/opencode Use this command to install the OpenCode CLI. Ensure you have curl installed. ```bash curl -fsSL https://opencode.ai/install | bash ``` -------------------------------- ### Install Cline CLI Source: https://docs.ollama.com/integrations/cline-cli Install the Cline CLI globally using npm. If npm is available, `ollama launch cline` will prompt for installation. ```bash npm install -g cline ``` -------------------------------- ### Install Marimo with uvx for Sandboxing Source: https://docs.ollama.com/integrations/marimo Installs Marimo and creates a sandboxed environment for running notebooks using uvx. ```bash uvx marimo edit --sandbox notebook.py ``` -------------------------------- ### Install Pool Source: https://docs.ollama.com/integrations/pool Install the Pool software agent from its GitHub repository. ```bash ollama launch pool ``` -------------------------------- ### Install Copilot CLI using npm Source: https://docs.ollama.com/integrations/copilot-cli Install Copilot CLI globally on any platform using npm. ```shellscript npm install -g @github/copilot ``` -------------------------------- ### Install Copilot CLI using a script Source: https://docs.ollama.com/integrations/copilot-cli Install Copilot CLI on macOS or Linux by downloading and executing an installation script. ```shellscript curl -fsSL https://gh.io/copilot-install | bash ``` -------------------------------- ### Install Copilot CLI with Homebrew Source: https://docs.ollama.com/integrations/copilot-cli Install Copilot CLI on macOS or Linux using Homebrew. ```bash brew install copilot-cli ``` -------------------------------- ### Start Ollama Serve Source: https://docs.ollama.com/llms-full.txt Start the Ollama server process. This command makes Ollama available for use by other applications. ```bash ollama serve ``` -------------------------------- ### Install Marimo with pip Source: https://docs.ollama.com/llms-full.txt Install the Marimo data notebook library using pip. This is a prerequisite for using Marimo. ```bash pip install marimo ``` -------------------------------- ### Quick Ollama Setup for Claude Code Source: https://docs.ollama.com/integrations/claude-code This command is used for a quick setup when integrating Claude Code with Ollama. ```shellscript ollama run claude-code ``` -------------------------------- ### Install Copilot CLI on Windows using WinGet Source: https://docs.ollama.com/integrations/copilot-cli Install Copilot CLI on Windows using the WinGet package manager. ```powershell winget install GitHub.Copilot ``` -------------------------------- ### JavaScript Parallel Tool Calling with Ollama Source: https://docs.ollama.com/llms-full.txt This JavaScript example demonstrates parallel tool calling with Ollama. It defines functions for getting temperature and conditions, sets up tool definitions, and processes tool calls to generate a final response. Ensure the 'ollama' npm package is installed. ```typescript import ollama from 'ollama' function getTemperature(city: string): string { const temperatures: { [key: string]: string } = { "New York": "22°C", "London": "15°C", "Tokyo": "18°C" } return temperatures[city] || "Unknown" } function getConditions(city: string): string { const conditions: { [key: string]: string } = { "New York": "Partly cloudy", "London": "Rainy", "Tokyo": "Sunny" } return conditions[city] || "Unknown" } const tools = [ { type: 'function', function: { name: 'get_temperature', description: 'Get the current temperature for a city', parameters: { type: 'object', required: ['city'], properties: { city: { type: 'string', description: 'The name of the city' }, }, }, }, }, { type: 'function', function: { name: 'get_conditions', description: 'Get the current weather conditions for a city', parameters: { type: 'object', required: ['city'], properties: { city: { type: 'string', description: 'The name of the city' }, }, }, }, } ] const messages = [{ role: 'user', content: 'What are the current weather conditions and temperature in New York and London?' }] const response = await ollama.chat({ model: 'qwen3', messages, tools, think: true }) // add the assistant message to the messages messages.push(response.message) if (response.message.tool_calls) { // process each tool call for (const call of response.message.tool_calls) { // execute the appropriate tool let result: string if (call.function.name === 'get_temperature') { const args = call.function.arguments as { city: string } result = getTemperature(args.city) } else if (call.function.name === 'get_conditions') { const args = call.function.arguments as { city: string } result = getConditions(args.city) } else { result = 'Unknown tool' } // add the tool result to the messages messages.push({ role: 'tool', tool_name: call.function.name, content: result }) } // generate the final response const finalResponse = await ollama.chat({ model: 'qwen3', messages, tools, think: true }) console.log(finalResponse.message.content) } ``` -------------------------------- ### Download Ollama Source: https://docs.ollama.com/quickstart Click the download link to get Ollama for your operating system. This is the first step to getting started. ```html

Download Ollama

``` -------------------------------- ### Manual Setup with Environment Variables Source: https://docs.ollama.com/integrations/pool Configure Pool to connect to Ollama by setting specific environment variables for the API base URL and API key. ```bash export POOLSIDE_STANDALONE_BASE_URL=http://localhost:11434/v1 export POOLSIDE_API_KEY=ollama ``` -------------------------------- ### Install Hermes Agent Manually Source: https://docs.ollama.com/integrations/hermes Manually install Hermes Agent using a curl script if you prefer to run its setup wizard directly instead of using 'ollama launch hermes'. ```bash curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash ``` -------------------------------- ### JavaScript Web Search Example Source: https://docs.ollama.com/capabilities/web-search This JavaScript example shows how to perform a web search using Ollama. It utilizes the Ollama API to get search results, including title, URL, and content. ```javascript const ollama = require('ollama') async function main() { const response = await ollama.chat({ model: 'ollama/ollama', messages: [ { role: 'user', content: 'Why is the sky blue?', }, ], }) console.log(response.message.content) } main() ``` -------------------------------- ### Manual Setup: Set Environment Variables and Launch Source: https://docs.ollama.com/llms-full.txt Manually configure Claude Code by setting environment variables for authentication and the base URL, then launch it with a specified Ollama model. ```shell ANTHROPIC_AUTH_TOKEN=ollama ANTHROPIC_BASE_URL=http://localhost:11434 claude --model qwen3-coder ``` -------------------------------- ### API Chat Endpoint Source: https://docs.ollama.com/quickstart Example of how to interact with the Ollama API to get a chat response. This uses curl to send a POST request. ```shellscript curl http://localhost:11434/api/chat -d '{ "model": "gemma4", "messages": [{"role": "user", "content": "Hello!"}] }' ``` -------------------------------- ### Example: Checking Open PRs with /loop Source: https://docs.ollama.com/integrations/claude-code This example demonstrates using the /loop command to check open pull requests every 30 minutes and summarize their status. ```text /loop 30m Check my open PRs and summarize their status ``` -------------------------------- ### Quick Setup for Copilot CLI with Ollama Source: https://docs.ollama.com/integrations/copilot-cli Launch Copilot CLI with Ollama for a quick setup. This command will typically prompt you to select a model if one is not already configured. ```bash ollama launch copilot ``` -------------------------------- ### Quick Setup for Cline CLI with Ollama Source: https://docs.ollama.com/integrations/cline-cli Launch Cline CLI with Ollama automatically configured as the provider, pointing to the local Ollama endpoint and selecting a default model. ```bash ollama launch cline ``` -------------------------------- ### Python Web Search Example Source: https://docs.ollama.com/capabilities/web-search This Python snippet demonstrates how to perform a web search using the Ollama library. Ensure you have the ollama-python library installed. ```python from ollama import Ollama client = Ollama("http://localhost:11434") response = client.chat( model="ollama/ollama", messages=[ { "role": "user", "content": "Why is the sky blue?" } ], options={"num_predict": 100}, stream=True, ) for chunk in response: print(chunk["message"]["content"], end="", flush=True) print() ``` -------------------------------- ### Launch Applications with Qwen3 Model Source: https://ollama.com/library/qwen3 Launch various applications pre-configured to use the Qwen3 model. ```bash ollama launch claude --model qwen3 ``` ```bash ollama launch codex-app --model qwen3 ``` ```bash ollama launch openclaw --model qwen3 ``` ```bash ollama launch hermes --model qwen3 ``` ```bash ollama launch codex --model qwen3 ``` ```bash ollama launch opencode --model qwen3 ``` -------------------------------- ### Generate Embeddings with Python Library Source: https://ollama.com/library/all-minilm Call the embeddings function from the Ollama Python library to get sentence embeddings. Requires the Ollama Python library to be installed. ```python ollama.embeddings(model='all-minilm', prompt='The sky is blue because of Rayleigh scattering') ``` -------------------------------- ### JavaScript Web Search Example Source: https://docs.ollama.com/capabilities/web-search This JavaScript snippet shows how to use the Ollama library for web search functionality. Make sure the ollama-javascript library is installed. ```tsx import { Ollama } from "ollama" const ollama = new Ollama() const response = await ollama.chat({ model: "ollama/ollama", messages: [ { role: "user", content: "Why is the sky blue?", }, ], stream: true, }) for await (const part of response) { process.stdout.write(part.message.content) } ``` -------------------------------- ### Example: Automating Research with /loop Source: https://docs.ollama.com/integrations/claude-code This example shows how to use the /loop command to research AI news hourly and summarize key developments. ```text /loop 1h Research the latest AI news and summarize key developments ``` -------------------------------- ### Run a Cloud Model with Ollama.js Source: https://docs.ollama.com/cloud Use the Ollama JavaScript library to instantiate an Ollama client and run a cloud model. This example shows basic setup and model execution. ```typescript import { Ollama } from "ollama"; const ollama = new Ollama({ host: "http://localhost:11434", // ... other options }); const stream = ollama.chat( { model: "gpt-oss:120b-cloud", messages: [{ role: "user", content: "Why is the sky blue?" }], stream: true, }, { on: { on_data: ({ message }) => { // do something with the stream process.stdout.write(message.content); }, }, } ); await stream.done(); ``` -------------------------------- ### Quick Setup: Launch Ollama with Codex Source: https://docs.ollama.com/integrations/codex Launches Ollama with a dedicated Codex profile for the current session. This automatically refreshes the model catalog. ```bash ollama launch codex ``` -------------------------------- ### Configure Apt Repository for NVIDIA Container Toolkit Source: https://docs.ollama.com/docker These commands set up the APT repository for the NVIDIA Container Toolkit, including adding the GPG key and the repository list. ```bash curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey \ | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg curl -fsSL https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list \ | sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' \ | sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list sudo apt-get update ``` -------------------------------- ### Profile-Based Setup: Ollama Launch Configuration Source: https://docs.ollama.com/integrations/codex Defines a persistent Codex CLI configuration for Ollama integration by creating a TOML file. This example sets the default model and provider. ```toml model = "gpt-oss:120b" model_provider = "ollama-launch" model_catalog_json = "/Users/you/.codex/model.json" [model_providers.ollama-launch] name = "Ollama" base_url = "http://localhost:11434/v1/" wire_api = "responses" ``` -------------------------------- ### Pi Introduction Source: https://docs.ollama.com/integrations/pi A brief introduction to Pi as a minimal and extensible coding agent. ```mdx Pi is a minimal and extensible coding agent. ``` -------------------------------- ### Example Pool Configuration Source: https://docs.ollama.com/integrations/pool This snippet shows how to configure the Pool API key and specify the model to use. It demonstrates setting the POOLSIDE_API_KEY environment variable and selecting a specific model like 'kimi-k2.6:cloud'. ```shell export POOLSIDE_API_KEY=ollama pool -m kimi-k2.6:cloud ``` -------------------------------- ### Simple Anthropic Messages API Example in JavaScript Source: https://docs.ollama.com/llms-full.txt Demonstrates a basic request to the Anthropic Messages API using Ollama's compatibility layer in JavaScript. Ensure the @anthropic-ai/sdk is installed. ```javascript import Anthropic from "@anthropic-ai/sdk"; const anthropic = new Anthropic({ baseURL: "http://localhost:11434", apiKey: "ollama", // required but ignored }); const message = await anthropic.messages.create({ model: "qwen3-coder", max_tokens: 1024, messages: [{ role: "user", content: "Hello, how are you?" }], }); console.log(message.content[0].text); ``` -------------------------------- ### Simple Anthropic Messages API Example in Python Source: https://docs.ollama.com/llms-full.txt Demonstrates a basic request to the Anthropic Messages API using Ollama's compatibility layer in Python. Ensure the anthropic library is installed. ```python import anthropic client = anthropic.Anthropic( base_url='http://localhost:11434', api_key='ollama', # required but ignored ) message = client.messages.create( model='qwen3-coder', max_tokens=1024, messages=[ {'role': 'user', 'content': 'Hello, how are you?'} ] ) print(message.content[0].text) ``` -------------------------------- ### Launch OpenClaw with Ollama Source: https://docs.ollama.com/integrations/openclaw This command launches OpenClaw using Ollama. Ollama handles the installation, security prompts, model selection, and gateway setup automatically. It also enables the bundled Ollama web search. ```shellscript ollama launch openclaw ``` -------------------------------- ### Install NVIDIA Container Toolkit Packages (Apt) Source: https://docs.ollama.com/docker Installs the NVIDIA Container Toolkit packages using APT after configuring the repository. ```bash sudo apt-get install -y nvidia-container-toolkit ``` -------------------------------- ### Verify Ollama installation Source: https://docs.ollama.com/llms-full.txt Check the installed Ollama version to confirm the installation was successful. ```shell ollama -v ``` -------------------------------- ### Hermes Gateway Setup Source: https://docs.ollama.com/integrations/hermes Use this command to set up the Hermes gateway. This command initiates the gateway setup process for Hermes. ```shellscript hermes gateway setup ``` -------------------------------- ### Install OMP Source: https://docs.ollama.com/integrations/oh-my-pi This command installs Oh My Pi. Ensure you have already installed Ollama and have it running. ```shellscript curl -fsSL https://omp.sh | sh ``` -------------------------------- ### Install Marimo with uv Source: https://docs.ollama.com/llms-full.txt Install the Marimo data notebook library using uv. This can also be used to create sandboxed environments. ```bash uv install marimo ``` -------------------------------- ### Install specific Ollama version Source: https://docs.ollama.com/llms-full.txt Use the OLLAMA_VERSION environment variable with the install script to install a particular version. ```shell curl -fsSL https://ollama.com/install.sh | OLLAMA_VERSION=0.5.7 sh ``` -------------------------------- ### Run Copilot CLI After Manual Setup Source: https://docs.ollama.com/integrations/copilot-cli Execute Copilot CLI after setting the necessary environment variables for manual API connection to Ollama. ```bash copilot ``` -------------------------------- ### Initialize Ollama Client and Perform Web Search Source: https://docs.ollama.com/capabilities/web-search Demonstrates how to create an Ollama client instance and use the webSearch function to query information from the web. The results are then logged to the console. ```javascript const client = new Ollama(); const results = await client.webSearch("what is ollama?"); console.log(JSON.stringify(results, null, 2)); ``` -------------------------------- ### Specify Base Model with Tag Source: https://docs.ollama.com/llms-full.txt Use the FROM instruction to specify the base model and its tag for creating a new model. ```shell FROM llama3.2 ```