mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 11:43:54 +00:00
(docs) test proxy
This commit is contained in:
parent
510a85a1d7
commit
160d8f9c55
1 changed files with 15 additions and 0 deletions
15
litellm/proxy/test_openai_request.py
Normal file
15
litellm/proxy/test_openai_request.py
Normal file
|
@ -0,0 +1,15 @@
|
|||
import openai
|
||||
client = openai.OpenAI(
|
||||
api_key="anything",
|
||||
base_url="http://0.0.0.0:8000"
|
||||
)
|
||||
|
||||
# request sent to model set on litellm proxy, `litellm --model`
|
||||
response = client.chat.completions.create(model="gpt-3.5-turbo", messages = [
|
||||
{
|
||||
"role": "user",
|
||||
"content": "this is a test request, write a short poem"
|
||||
}
|
||||
])
|
||||
|
||||
print(response)
|
Loading…
Add table
Add a link
Reference in a new issue