Ollama
Ollama runs open models locally on macOS, Windows, and Linux, and also exposes the same API for Ollama cloud models. This Dify plugin integrates Ollama chat/completion models, vision-capable models, text embeddings, tool calling, streamed responses, and thinking output.
Use the Ollama host root as the Base URL. For a local server, use or another reachable host root. For Ollama cloud models, use and provide an Ollama API key. Do not include in the Base URL because the plugin appends , , and .
Download Ollama from ollama.com/download.
Pull or run the model you want to use:
After startup, the local API is available at .
In Dify, go to the Marketplace and install the Ollama plugin.

Go to and add a model.

For Docker deployments, use a host address reachable from the Dify container, such as or a LAN IP address.
In model parameters:
Thinking output is preserved in Dify responses with so it can be displayed, hidden, or passed back in tool loops.
Use a vision model and set to . Dify image inputs are sent to Ollama in the message array. The Ollama REST API expects base64 image data.
Use a tool-capable chat model and set to . Dify will pass available tools to Ollama, execute returned tool calls, and send tool results back with Ollama's message field.
Streaming tool calls are supported. The plugin accumulates streamed , , and so the next agent turn can continue the tool loop.
Add a model with Model Type .
Recommended Ollama embedding models include:
The plugin sends arrays of text to , which returns L2-normalized vectors.
Ollama web search and web fetch are cloud APIs. They require an Ollama account and API key, and they are separate from the local model server endpoints.
This plugin is a model provider, so it does not include Ollama web search as bundled Dify tools. To use web search with an Ollama model in a Dify agent, configure a separate search tool or dedicated Ollama web tool plugin, then enable on the Ollama chat model so it can call the external tool.
Ollama does not currently provide a native rerank model endpoint. To use rerank in this plugin, deploy a compatible rerank service such as , , , or Xinference and configure the full rerank endpoint URL.

If the URL does not end with , the plugin appends .