mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-28 04:04:31 +00:00
(docs) proxy server
This commit is contained in:
parent
f716bee7a1
commit
7e8875b29a
1 changed files with 7 additions and 5 deletions
|
@ -25,12 +25,14 @@ $ uvicorn main:app --host 0.0.0.0 --port 8000
|
|||
## Replace openai base
|
||||
```python
|
||||
import openai
|
||||
openai.api_base = "http://0.0.0.0:8000"
|
||||
|
||||
openai.api_base = "http://0.0.0.0:8000" # proxy url
|
||||
openai.api_key = "does-not-matter"
|
||||
# call cohere
|
||||
openai.api_key = "my-cohere-key" # this gets passed as a header
|
||||
|
||||
response = openai.ChatCompletion.create(model="command-nightly", messages=[{"role":"user", "content":"Hey!"}])
|
||||
response = openai.ChatCompletion.create(
|
||||
model="command-nightly",
|
||||
messages=[{"role":"user", "content":"Hey!"}],
|
||||
api_key="your-cohere-api-key", # enter your key here
|
||||
)
|
||||
|
||||
# call bedrock
|
||||
response = openai.ChatCompletion.create(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue