From 0db0652ad31f178cb90776a6011f9f911c2f4ee3 Mon Sep 17 00:00:00 2001 From: ishaan-jaff Date: Tue, 26 Dec 2023 00:05:16 +0530 Subject: [PATCH] (docs) ollama api/chat --- docs/my-website/docs/providers/ollama.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/my-website/docs/providers/ollama.md b/docs/my-website/docs/providers/ollama.md index 0aa571e2a80..51d91ccb6fb 100644 --- a/docs/my-website/docs/providers/ollama.md +++ b/docs/my-website/docs/providers/ollama.md @@ -77,6 +77,19 @@ response = completion( format = "json" ) ``` + +## Using ollama `api/chat` +In order to send ollama requests to `POST /api/chat` on your ollama server, set the model prefix to `ollama_chat` + +```python +from litellm import completion + +response = completion( + model="ollama_chat/llama2", + messages=[{ "content": "respond in 20 words. who are you?","role": "user"}], +) +print(response) +``` ## Ollama Models Ollama supported models: https://github.com/jmorganca/ollama