mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 03:04:13 +00:00
fix(proxy_cli): prints the location of the config file
This commit is contained in:
parent
4b0f8825f3
commit
098a86f678
5 changed files with 11 additions and 5 deletions
Binary file not shown.
Binary file not shown.
|
@ -7,3 +7,5 @@
|
||||||
2023-10-11 15:14:04 - Model gpt-4 Cost: $0.03291000
|
2023-10-11 15:14:04 - Model gpt-4 Cost: $0.03291000
|
||||||
2023-10-11 15:18:16 - Model gpt-4 Cost: $0.03669000
|
2023-10-11 15:18:16 - Model gpt-4 Cost: $0.03669000
|
||||||
2023-10-11 15:19:12 - Model gpt-4 Cost: $0.04806000
|
2023-10-11 15:19:12 - Model gpt-4 Cost: $0.04806000
|
||||||
|
2023-10-11 21:11:06 - Model claude-2 Cost: $0.00041534
|
||||||
|
2023-10-11 21:15:34 - Model claude-2 Cost: $0.00054606
|
||||||
|
|
|
@ -36,10 +36,14 @@ def open_config():
|
||||||
print(f"Failed to copy .template.secrets.toml: {e}")
|
print(f"Failed to copy .template.secrets.toml: {e}")
|
||||||
|
|
||||||
# Open the .env file in the default editor
|
# Open the .env file in the default editor
|
||||||
if os.name == 'nt': # For Windows
|
try:
|
||||||
os.startfile(user_config_path)
|
if os.name == 'nt': # For Windows
|
||||||
elif os.name == 'posix': # For MacOS, Linux, and anything using Bash
|
os.startfile(user_config_path)
|
||||||
subprocess.call(('open', '-t', user_config_path))
|
elif os.name == 'posix': # For MacOS, Linux, and anything using Bash
|
||||||
|
subprocess.call(('open', '-t', user_config_path))
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
print(f"LiteLLM: Proxy Server Config - {user_config_path}")
|
||||||
|
|
||||||
def is_port_in_use(port):
|
def is_port_in_use(port):
|
||||||
import socket
|
import socket
|
||||||
|
|
|
@ -353,7 +353,7 @@ async def completion(request: Request):
|
||||||
@router.post("/chat/completions")
|
@router.post("/chat/completions")
|
||||||
async def chat_completion(request: Request):
|
async def chat_completion(request: Request):
|
||||||
data = await request.json()
|
data = await request.json()
|
||||||
print_verbose(f"data passed in: {data}")
|
print(f"data passed in: {data}")
|
||||||
response = litellm_completion(data, type="chat_completion")
|
response = litellm_completion(data, type="chat_completion")
|
||||||
return response
|
return response
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue