diff --git a/Dockerfile b/Dockerfile index 0c3a2a33c..b9dcc1f2c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -35,6 +35,9 @@ RUN pip wheel --no-cache-dir --wheel-dir=/wheels/ -r requirements.txt # install semantic-cache [Experimental]- we need this here and not in requirements.txt because redisvl pins to pydantic 1.0 RUN pip install redisvl==0.0.7 --no-deps +# Build Admin UI +RUN chmod +x build_admin_ui.sh && ./build_admin_ui.sh + # Runtime stage FROM $LITELLM_RUNTIME_IMAGE as runtime diff --git a/build_admin_ui.sh b/build_admin_ui.sh new file mode 100755 index 000000000..f3e27a5c2 --- /dev/null +++ b/build_admin_ui.sh @@ -0,0 +1,62 @@ +#!/bin/bash + +# # try except this script +# set -e + +# print current dir +echo +pwd + + +# only run this step for litellm enterprise, we run this if enterprise/enterprise_ui/_enterprise.json exists +if [ ! -f "enterprise/enterprise_ui/_enterprise_colors.json" ]; then + echo "Admin UI - using default LiteLLM UI" + exit 0 +fi + +echo "Building Custom Admin UI..." + +# Install dependencies +# Check if we are on macOS +if [[ "$(uname)" == "Darwin" ]]; then + # Install dependencies using Homebrew + if ! command -v brew &> /dev/null; then + echo "Error: Homebrew not found. Please install Homebrew and try again." + exit 1 + fi + brew update + brew install curl +else + # Assume Linux, try using apt-get + if command -v apt-get &> /dev/null; then + apt-get update + apt-get install -y curl + elif command -v apk &> /dev/null; then + # Try using apk if apt-get is not available + apk update + apk add curl + else + echo "Error: Unsupported package manager. Cannot install dependencies." + exit 1 + fi +fi +curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash +source ~/.nvm/nvm.sh +nvm install v18.17.0 +nvm use v18.17.0 +npm install -g npm + +# copy ui_colors.json from this directory to /ui/litellm-dashboard, replace any existing ui_colors.json +cp enterprise/enterprise_ui/_enterprise.json ui/litellm-dashboard/ui_colors.json + +# cd in to /ui/litellm-dashboard +cd ui/litellm-dashboard + +# ensure have access to build_ui.sh +chmod +x ./build_ui.sh + +# run ./build_ui.sh +./build_ui.sh + +# return to root directory +cd ../.. \ No newline at end of file diff --git a/enterprise/enterprise_ui/README.md b/enterprise/enterprise_ui/README.md new file mode 100644 index 000000000..f3cc85d83 --- /dev/null +++ b/enterprise/enterprise_ui/README.md @@ -0,0 +1,5 @@ +## Admin UI + +Customize the Admin UI to your companies branding / logo + +## Usage diff --git a/enterprise/enterprise_ui/_enterprise_colors.json b/enterprise/enterprise_ui/_enterprise_colors.json new file mode 100644 index 000000000..4706eb1d7 --- /dev/null +++ b/enterprise/enterprise_ui/_enterprise_colors.json @@ -0,0 +1,11 @@ +{ + "brand": { + "DEFAULT": "teal", + "faint": "teal", + "muted": "teal", + "subtle": "teal", + "emphasis": "teal", + "inverted": "teal" + } + } + \ No newline at end of file diff --git a/proxy_server_config.yaml b/proxy_server_config.yaml index 1d499aa7d..d0cb5739e 100644 --- a/proxy_server_config.yaml +++ b/proxy_server_config.yaml @@ -15,18 +15,6 @@ model_list: litellm_params: model: sagemaker/berri-benchmarking-Llama-2-70b-chat-hf-4 input_cost_per_second: 0.000420 - - model_name: gpt-4 - litellm_params: - model: azure/gpt-turbo - api_key: os.environ/AZURE_FRANCE_API_KEY - api_base: https://openai-france-1234.openai.azure.com/ - rpm: 100 - - model_name: gpt-4 - litellm_params: - model: azure/gpt-35-turbo - api_key: os.environ/AZURE_EUROPE_API_KEY - api_base: https://my-endpoint-europe-berri-992.openai.azure.com - rpm: 10 - model_name: text-embedding-ada-002 litellm_params: model: azure/azure-embedding-model diff --git a/ui/litellm-dashboard/build_ui.sh b/ui/litellm-dashboard/build_ui.sh index 33c0b1e8d..453b9ec1b 100755 --- a/ui/litellm-dashboard/build_ui.sh +++ b/ui/litellm-dashboard/build_ui.sh @@ -19,6 +19,10 @@ if [ $? -ne 0 ]; then exit 1 fi +# print contents of ui_colors.json +echo "Contents of ui_colors.json:" +cat ui_colors.json + # Run npm build npm run build @@ -26,8 +30,12 @@ npm run build if [ $? -eq 0 ]; then echo "Build successful. Copying files..." + # echo current dir + echo + pwd + # Specify the destination directory - destination_dir="../../litellm/proxy/experimental" + destination_dir="../../litellm/proxy/_experimental/out" # Remove existing files in the destination directory rm -rf "$destination_dir"/* diff --git a/ui/litellm-dashboard/ui_colors.json b/ui/litellm-dashboard/ui_colors.json index dd58a29ab..a67d9835a 100644 --- a/ui/litellm-dashboard/ui_colors.json +++ b/ui/litellm-dashboard/ui_colors.json @@ -1,11 +1,11 @@ { "brand": { - "DEFAULT": "red", - "faint": "red", - "muted": "red", - "subtle": "red", - "emphasis": "red", - "inverted": "red" + "DEFAULT": "#6366f1", + "faint": "#6c6fed", + "muted": "#8688ef", + "subtle": "#8e91eb", + "emphasis": "#5558eb", + "inverted": "indigo" } } \ No newline at end of file