mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-07 08:26:10 +00:00
(docs) test proxy
This commit is contained in:
parent
54b6a767f4
commit
c162f8b4b0
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
Reference in a new issue