mirror of
https://github.com/tiennm99/litellm.git
synced 2026-08-06 20:25:29 +00:00
(docs) new ollama_docker image
This commit is contained in:
@@ -0,0 +1,92 @@
|
||||
# LiteLLM/Ollama Docker Image
|
||||
[](https://wa.link/huol9n) [](https://discord.gg/wuPM9dRgDw)
|
||||
## An OpenAI API compatible server for local LLMs - llama2, mistral, codellama
|
||||
|
||||
## Quick Start:
|
||||
Docker Hub:
|
||||
https://hub.docker.com/repository/docker/litellm/ollama/general
|
||||
|
||||
```shell
|
||||
docker pull litellm/ollama
|
||||
```
|
||||
|
||||
```shell
|
||||
docker run --name ollama litellm/ollama
|
||||
```
|
||||
|
||||
### Test the server container
|
||||
On the docker container run the `test.py` file using `python3 test.py`
|
||||
|
||||
|
||||
## Supported Models
|
||||
|
||||
| Model | Parameters | Size | Download |
|
||||
| ------------------ | ---------- | ----- | ------------------------------ |
|
||||
| Mistral | 7B | 4.1GB | `ollama run mistral` |
|
||||
| Llama 2 | 7B | 3.8GB | `ollama run llama2` |
|
||||
| Code Llama | 7B | 3.8GB | `ollama run codellama` |
|
||||
| Llama 2 Uncensored | 7B | 3.8GB | `ollama run llama2-uncensored` |
|
||||
| Llama 2 13B | 13B | 7.3GB | `ollama run llama2:13b` |
|
||||
| Llama 2 70B | 70B | 39GB | `ollama run llama2:70b` |
|
||||
| Orca Mini | 3B | 1.9GB | `ollama run orca-mini` |
|
||||
| Vicuna | 7B | 3.8GB | `ollama run vicuna` |
|
||||
|
||||
|
||||
## Making a request to this server
|
||||
```python
|
||||
import openai
|
||||
|
||||
api_base = f"http://0.0.0.0:8000" # base url for server
|
||||
|
||||
openai.api_base = api_base
|
||||
openai.api_key = "temp-key"
|
||||
print(openai.api_base)
|
||||
|
||||
|
||||
print(f'LiteLLM: response from proxy with streaming')
|
||||
response = openai.ChatCompletion.create(
|
||||
model="ollama/llama2",
|
||||
messages = [
|
||||
{
|
||||
"role": "user",
|
||||
"content": "this is a test request, acknowledge that you got it"
|
||||
}
|
||||
],
|
||||
stream=True
|
||||
)
|
||||
|
||||
for chunk in response:
|
||||
print(f'LiteLLM: streaming response from proxy {chunk}')
|
||||
```
|
||||
|
||||
## Responses from this server
|
||||
```json
|
||||
{
|
||||
"object": "chat.completion",
|
||||
"choices": [
|
||||
{
|
||||
"finish_reason": "stop",
|
||||
"index": 0,
|
||||
"message": {
|
||||
"content": " Hello! I acknowledge receipt of your test request. Please let me know if there's anything else I can assist you with.",
|
||||
"role": "assistant",
|
||||
"logprobs": null
|
||||
}
|
||||
}
|
||||
],
|
||||
"id": "chatcmpl-403d5a85-2631-4233-92cb-01e6dffc3c39",
|
||||
"created": 1696992706.619709,
|
||||
"model": "ollama/llama2",
|
||||
"usage": {
|
||||
"prompt_tokens": 18,
|
||||
"completion_tokens": 25,
|
||||
"total_tokens": 43
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
# Support / talk with founders
|
||||
- [Schedule Demo 👋](https://calendly.com/d/4mp-gd3-k5k/berriai-1-1-onboarding-litellm-hosted-version)
|
||||
- [Community Discord 💭](https://discord.gg/wuPM9dRgDw)
|
||||
- Our numbers 📞 +1 (770) 8783-106 / +1 (412) 618-6238
|
||||
- Our emails ✉️ ishaan@berri.ai / krrish@berri.ai
|
||||
Reference in New Issue
Block a user