forked from phoenix/litellm-mirror
Update README.md
This commit is contained in:
parent
947770457d
commit
34c75b8c0c
1 changed files with 14 additions and 17 deletions
|
@ -40,28 +40,25 @@ curl http://0.0.0.0:8000/v1/chat/completions \
|
||||||
}'
|
}'
|
||||||
```
|
```
|
||||||
|
|
||||||
### replace openai base
|
### Replace openai base
|
||||||
```python
|
```python
|
||||||
import openai
|
import openai
|
||||||
openai.api_base = "http://0.0.0.0:8000"
|
openai.api_base = "http://0.0.0.0:8000"
|
||||||
|
|
||||||
# call cohere
|
# cohere call
|
||||||
openai.api_key = "my-cohere-key" # this gets passed as a header
|
|
||||||
|
|
||||||
response = openai.ChatCompletion.create(model="command-nightly", messages=[{"role":"user", "content":"Hey!"}])
|
|
||||||
|
|
||||||
# call bedrock
|
|
||||||
response = openai.ChatCompletion.create(
|
response = openai.ChatCompletion.create(
|
||||||
model = "bedrock/anthropic.claude-instant-v1",
|
model="command-nightly",
|
||||||
messages = [
|
messages=[{"role":"user", "content":"Say this is a test!"}],
|
||||||
{
|
api_key = "your-cohere-api-key"
|
||||||
"role": "user",
|
)
|
||||||
"content": "Hey!"
|
|
||||||
}
|
# bedrock call
|
||||||
],
|
response = openai.ChatCompletion.create(
|
||||||
aws_access_key_id="",
|
model = "bedrock/anthropic.claude-instant-v1",
|
||||||
aws_secret_access_key="",
|
messages=[{"role":"user", "content":"Say this is a test!"}],
|
||||||
aws_region_name="us-west-2",
|
aws_access_key_id="",
|
||||||
|
aws_secret_access_key="",
|
||||||
|
aws_region_name="us-west-2",
|
||||||
)
|
)
|
||||||
|
|
||||||
print(response)
|
print(response)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue