forked from phoenix/litellm-mirror
docs
This commit is contained in:
parent
fdf0dd0d11
commit
2d09f2a373
1 changed files with 20 additions and 3 deletions
|
@ -51,17 +51,34 @@ This variable is checked for all providers
|
||||||
```python
|
```python
|
||||||
import litellm
|
import litellm
|
||||||
# openai call
|
# openai call
|
||||||
litellm.api_key = "sk-OpenAIKey
|
litellm.api_key = "sk-OpenAIKey"
|
||||||
response = litellm.completion(messages=messages, model="gpt-3.5-turbo")
|
response = litellm.completion(messages=messages, model="gpt-3.5-turbo")
|
||||||
|
|
||||||
# anthropic call
|
# anthropic call
|
||||||
litellm.api_key = "sk-AnthropicKey
|
litellm.api_key = "sk-AnthropicKey"
|
||||||
|
response = litellm.completion(messages=messages, model="claude-2")
|
||||||
|
```
|
||||||
|
|
||||||
|
### litellm.provider_key (example litellm.openai_key)
|
||||||
|
|
||||||
|
```python
|
||||||
|
litellm.openai_key = "sk-OpenAIKey"
|
||||||
|
response = litellm.completion(messages=messages, model="gpt-3.5-turbo")
|
||||||
|
|
||||||
|
# anthropic call
|
||||||
|
litellm.anthropic_key = "sk-AnthropicKey"
|
||||||
response = litellm.completion(messages=messages, model="claude-2")
|
response = litellm.completion(messages=messages, model="claude-2")
|
||||||
```
|
```
|
||||||
|
|
||||||
### litellm.api_base
|
### litellm.api_base
|
||||||
|
|
||||||
### litellm.provider_key (example litellm.openai_key)
|
```python
|
||||||
|
import litellm
|
||||||
|
litellm.api_base = "https://hosted-llm-api.co"
|
||||||
|
response = litellm.completion(messages=messages, model="gpt-3.5-turbo")
|
||||||
|
```
|
||||||
|
se = litellm.completion(messages=messages, model="gpt-3.5-turbo")
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue