mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 03:34:10 +00:00
(fix) locust load test
This commit is contained in:
parent
abd15f4421
commit
c0af9dc4f6
2 changed files with 3 additions and 1 deletions
|
@ -8,6 +8,7 @@ class MyUser(HttpUser):
|
||||||
def chat_completion(self):
|
def chat_completion(self):
|
||||||
headers = {
|
headers = {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
|
"Authorization": f"Bearer sk-1234",
|
||||||
# Include any additional headers you may need for authentication, etc.
|
# Include any additional headers you may need for authentication, etc.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,7 @@ from fastapi import FastAPI, Request, status, HTTPException, Depends
|
||||||
from fastapi.responses import StreamingResponse
|
from fastapi.responses import StreamingResponse
|
||||||
from fastapi.security import OAuth2PasswordBearer
|
from fastapi.security import OAuth2PasswordBearer
|
||||||
from fastapi.middleware.cors import CORSMiddleware
|
from fastapi.middleware.cors import CORSMiddleware
|
||||||
|
import uuid
|
||||||
|
|
||||||
app = FastAPI()
|
app = FastAPI()
|
||||||
|
|
||||||
|
@ -23,7 +24,7 @@ app.add_middleware(
|
||||||
@app.post("/v1/chat/completions")
|
@app.post("/v1/chat/completions")
|
||||||
async def completion(request: Request):
|
async def completion(request: Request):
|
||||||
return {
|
return {
|
||||||
"id": "chatcmpl-123",
|
"id": f"chatcmpl-{uuid.uuid4().hex}",
|
||||||
"object": "chat.completion",
|
"object": "chat.completion",
|
||||||
"created": 1677652288,
|
"created": 1677652288,
|
||||||
"model": "gpt-3.5-turbo-0125",
|
"model": "gpt-3.5-turbo-0125",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue