mirror of
https://github.com/tiennm99/litellm.git
synced 2026-08-10 16:22:17 +00:00
docs ollama add acompletion + straming
This commit is contained in:
@@ -32,6 +32,24 @@ print(response)
|
||||
for chunk in response:
|
||||
print(chunk['choices'][0]['delta'])
|
||||
|
||||
```
|
||||
|
||||
## Example usage - Streaming + Acompletion
|
||||
```python
|
||||
async def async_ollama():
|
||||
response = await litellm.acompletion(
|
||||
model="ollama/llama2",
|
||||
messages=[{ "content": "what's the weather" ,"role": "user"}],
|
||||
api_base="http://localhost:11434",
|
||||
stream=True
|
||||
)
|
||||
async for chunk in response:
|
||||
print(chunk)
|
||||
|
||||
# call async_ollama
|
||||
import asyncio
|
||||
asyncio.run(async_ollama())
|
||||
|
||||
```
|
||||
### Ollama Models
|
||||
Ollama supported models: https://github.com/jmorganca/ollama
|
||||
|
||||
Reference in New Issue
Block a user