import os def show_missing_vars_in_env(): from fastapi.responses import HTMLResponse from litellm.proxy.proxy_server import master_key, prisma_client if prisma_client is None and master_key is None: return HTMLResponse( content=missing_keys_form( missing_key_names="DATABASE_URL, LITELLM_MASTER_KEY" ), status_code=200, ) if prisma_client is None: return HTMLResponse( content=missing_keys_form(missing_key_names="DATABASE_URL"), status_code=200 ) if master_key is None: return HTMLResponse( content=missing_keys_form(missing_key_names="LITELLM_MASTER_KEY"), status_code=200, ) return None # LiteLLM Admin UI - Non SSO Login url_to_redirect_to = os.getenv("PROXY_BASE_URL", "") url_to_redirect_to += "/login" html_form = f"""
Please add the following variables to your environment variables:
LITELLM_MASTER_KEY="sk-1234" # Your master key for the proxy server. Can use this to send /chat/completion requests etc LITELLM_SALT_KEY="sk-XXXXXXXX" # Can NOT CHANGE THIS ONCE SET - It is used to encrypt/decrypt credentials stored in DB. If value of 'LITELLM_SALT_KEY' changes your models cannot be retrieved from DB DATABASE_URL="postgres://..." # Need a postgres database? (Check out Supabase, Neon, etc) ## OPTIONAL ## PORT=4000 # DO THIS FOR RENDER/RAILWAY STORE_MODEL_IN_DB="True" # Allow storing models in db
{missing_keys}
The Admin UI has been disabled by the administrator. To re-enable it, please update the following environment variable:
DISABLE_ADMIN_UI="False" # Set this to "False" to enable the Admin UI.
After making this change, restart the application for it to take effect.