mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-07 02:59:05 +00:00
Update README.md
This commit is contained in:
parent
aec4de68a7
commit
ae27d2e55f
1 changed files with 9 additions and 24 deletions
|
|
@ -35,30 +35,15 @@ curl http://0.0.0.0:8000/v1/chat/completions \
|
|||
}'
|
||||
```
|
||||
|
||||
### Replace openai base
|
||||
```python
|
||||
import openai
|
||||
openai.api_base = "http://0.0.0.0:8000"
|
||||
|
||||
# cohere call
|
||||
response = openai.ChatCompletion.create(
|
||||
model="command-nightly",
|
||||
messages=[{"role":"user", "content":"Say this is a test!"}],
|
||||
api_key = "your-cohere-api-key"
|
||||
)
|
||||
|
||||
# bedrock call
|
||||
response = openai.ChatCompletion.create(
|
||||
model = "bedrock/anthropic.claude-instant-v1",
|
||||
messages=[{"role":"user", "content":"Say this is a test!"}],
|
||||
aws_access_key_id="",
|
||||
aws_secret_access_key="",
|
||||
aws_region_name="us-west-2",
|
||||
)
|
||||
|
||||
print(response)
|
||||
```
|
||||
|
||||
```shell
|
||||
curl http://0.0.0.0:8000/v1/chat/completions \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"model": "claude-instant-1",
|
||||
"messages": [{"role": "user", "content": "Say this is a test!"}],
|
||||
"temperature": 0.7
|
||||
}'
|
||||
```
|
||||
|
||||
### Running Locally
|
||||
```shell
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue