forked from phoenix/litellm-mirror
(feat) proxy_server add /v1
This commit is contained in:
parent
afa68026df
commit
329d27d1fa
1 changed files with 13 additions and 0 deletions
|
@ -379,6 +379,19 @@ async def chat_completion(request: Request):
|
|||
return response
|
||||
|
||||
|
||||
# V1 Endpoints - some apps expect a v1 endpoint - these call the regular function
|
||||
@router.post("/v1/completions")
|
||||
async def completion(request: Request):
|
||||
data = await request.json()
|
||||
return litellm_completion(data=data, type="completion")
|
||||
|
||||
@router.post("/v1/chat/completions")
|
||||
async def chat_completion(request: Request):
|
||||
data = await request.json()
|
||||
print_verbose(f"data passed in: {data}")
|
||||
response = litellm_completion(data, type="chat_completion")
|
||||
return response
|
||||
|
||||
def print_cost_logs():
|
||||
with open('cost.log', 'r') as f:
|
||||
# print this in green
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue