mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-08 22:21:35 +00:00
(docs) ollama api/chat
This commit is contained in:
parent
2690fe6dca
commit
0db0652ad3
1 changed files with 13 additions and 0 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue