From 0f7bf277455e95d57a57732eda0d2fda6aa4c991 Mon Sep 17 00:00:00 2001 From: Erik Weisser Date: Thu, 10 Apr 2025 10:49:13 +0200 Subject: [PATCH] add ollama api proxy support to api doc --- docs/getting-started/api-endpoints.md | 33 +++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/docs/getting-started/api-endpoints.md b/docs/getting-started/api-endpoints.md index fb77635..792eac8 100644 --- a/docs/getting-started/api-endpoints.md +++ b/docs/getting-started/api-endpoints.md @@ -66,6 +66,39 @@ To ensure secure access to the API, authentication is required 🛡️. You can return response.json() ``` +### 🦙 Ollama API Proxy Support + +If you want to interact directly with Ollama models—including for embedding generation or raw prompt streaming—Open WebUI offers a transparent passthrough to the native Ollama API via a proxy route. + +- **Base URL**: `/ollama/` +- **Reference**: [Ollama API Documentation](https://github.com/ollama/ollama/blob/main/docs/api.md) + +#### 🔁 Generate Completion (Streaming) + +```bash +curl http://localhost:3000/ollama/api/generate -d '{ + "model": "llama3.2", + "prompt": "Why is the sky blue?" +}' +``` + +#### 📦 List Available Models + +```bash +curl http://localhost:3000/ollama/api/tags +``` + +#### 🧠 Generate Embeddings + +```bash +curl -X POST http://localhost:3000/ollama/api/embed -d '{ + "model": "llama3.2", + "input": ["Open WebUI is great!", "Let's generate embeddings."] +}' +``` + +This is ideal for building search indexes, retrieval systems, or custom pipelines using Ollama models behind the Open WebUI. + ### 🧩 Retrieval Augmented Generation (RAG) The Retrieval Augmented Generation (RAG) feature allows you to enhance responses by incorporating data from external sources. Below, you will find the methods for managing files and knowledge collections via the API, and how to use them in chat completions effectively.