mirror of
https://github.com/tiennm99/litellm.git
synced 2026-08-17 02:23:32 +00:00
ollama docs
This commit is contained in:
@@ -9,10 +9,9 @@ Ensure you have your ollama server running
|
||||
from litellm import completion
|
||||
|
||||
response = completion(
|
||||
model="llama2",
|
||||
model="ollama/llama2",
|
||||
messages=[{ "content": "respond in 20 words. who are you?","role": "user"}],
|
||||
api_base="http://localhost:11434",
|
||||
custom_llm_provider="ollama"
|
||||
api_base="http://localhost:11434"
|
||||
)
|
||||
print(response)
|
||||
|
||||
@@ -23,7 +22,7 @@ print(response)
|
||||
from litellm import completion
|
||||
|
||||
response = completion(
|
||||
model="llama2",
|
||||
model="ollama/llama2",
|
||||
messages=[{ "content": "respond in 20 words. who are you?","role": "user"}],
|
||||
api_base="http://localhost:11434",
|
||||
custom_llm_provider="ollama",
|
||||
@@ -34,18 +33,17 @@ for chunk in response:
|
||||
print(chunk['choices'][0]['delta'])
|
||||
|
||||
```
|
||||
|
||||
### Ollama Models
|
||||
Ollama supported models: https://github.com/jmorganca/ollama
|
||||
|
||||
| Model Name | Function Call | Required OS Variables |
|
||||
|----------------------|-----------------------------------------------------------------------------------|--------------------------------|
|
||||
| Llama2 7B | `completion(model='llama2', messages, api_base="http://localhost:11434", custom_llm_provider="ollama", stream=True)` | No API Key required |
|
||||
| Llama2 13B | `completion(model='llama2:13b', messages, api_base="http://localhost:11434", custom_llm_provider="ollama", stream=True)` | No API Key required |
|
||||
| Llama2 70B | `completion(model='llama2:70b', messages, api_base="http://localhost:11434", custom_llm_provider="ollama", stream=True)` | No API Key required |
|
||||
| Llama2 Uncensored | `completion(model='llama2-uncensored', messages, api_base="http://localhost:11434", custom_llm_provider="ollama", stream=True)` | No API Key required |
|
||||
| Orca Mini | `completion(model='orca-mini', messages, api_base="http://localhost:11434", custom_llm_provider="ollama", stream=True)` | No API Key required |
|
||||
| Vicuna | `completion(model='vicuna', messages, api_base="http://localhost:11434", custom_llm_provider="ollama", stream=True)` | No API Key required |
|
||||
| Nous-Hermes | `completion(model='nous-hermes', messages, api_base="http://localhost:11434", custom_llm_provider="ollama", stream=True)` | No API Key required |
|
||||
| Nous-Hermes 13B | `completion(model='nous-hermes:13b', messages, api_base="http://localhost:11434", custom_llm_provider="ollama", stream=True)` | No API Key required |
|
||||
| Wizard Vicuna Uncensored | `completion(model='wizard-vicuna', messages, api_base="http://localhost:11434", custom_llm_provider="ollama", stream=True)` | No API Key required |
|
||||
| Llama2 7B | `completion(model='ollama/llama2', messages, api_base="http://localhost:11434", stream=True)` | No API Key required |
|
||||
| Llama2 13B | `completion(model='ollama/llama2:13b', messages, api_base="http://localhost:11434", stream=True)` | No API Key required |
|
||||
| Llama2 70B | `completion(model='ollama/llama2:70b', messages, api_base="http://localhost:11434", stream=True)` | No API Key required |
|
||||
| Llama2 Uncensored | `completion(model='ollama/llama2-uncensored', messages, api_base="http://localhost:11434", stream=True)` | No API Key required |
|
||||
| Orca Mini | `completion(model='ollama/orca-mini', messages, api_base="http://localhost:11434", stream=True)` | No API Key required |
|
||||
| Vicuna | `completion(model='ollama/vicuna', messages, api_base="http://localhost:11434", stream=True)` | No API Key required |
|
||||
| Nous-Hermes | `completion(model='ollama/nous-hermes', messages, api_base="http://localhost:11434", stream=True)` | No API Key required |
|
||||
| Nous-Hermes 13B | `completion(model='ollama/nous-hermes:13b', messages, api_base="http://localhost:11434", stream=True)` | No API Key required |
|
||||
| Wizard Vicuna Uncensored | `completion(model='ollama/wizard-vicuna', messages, api_base="http://localhost:11434", stream=True)` | No API Key required |
|
||||
|
||||
Reference in New Issue
Block a user