docs ollama add acompletion + straming

This commit is contained in:
ishaan-jaff
2023-09-21 11:09:57 -07:00
parent ac90c5286f
commit b7e3fbc22b
+18
View File
@@ -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