mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 10:44:24 +00:00
feat(admin_ui.py): support creating keys on admin ui
This commit is contained in:
parent
01f7e85057
commit
cbcf406fd0
3 changed files with 144 additions and 37 deletions
|
@ -347,6 +347,12 @@ def load_from_azure_key_vault(use_azure_key_vault: bool = False):
|
|||
|
||||
|
||||
async def run_streamlit_ui():
|
||||
# Save the current working directory
|
||||
original_dir = os.getcwd()
|
||||
# set the working directory to where this script is
|
||||
abspath = os.path.abspath(__file__)
|
||||
dname = os.path.dirname(abspath)
|
||||
os.chdir(dname)
|
||||
try:
|
||||
# Start Streamlit without opening the browser automatically
|
||||
process = subprocess.Popen(
|
||||
|
@ -362,6 +368,7 @@ async def run_streamlit_ui():
|
|||
# Wait for the server to start before exiting the context manager
|
||||
await asyncio.sleep(1)
|
||||
print("Streamlit UI server has started successfully.")
|
||||
os.chdir(original_dir)
|
||||
# Keep the background task running
|
||||
while True:
|
||||
await asyncio.sleep(3600)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue