From dec59e87a3caca4b9002eba17ebb2b0f781fc50f Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sat, 8 Nov 2025 15:05:29 +0000 Subject: [PATCH] refactor: Remove unused litellm endpoint and associated frontend code Removes the unused `/litellm/config` endpoint, the corresponding `downloadLiteLLMConfig` frontend API function, and the unused import from the `Database.svelte` component. This code was identified as dead code as it was not being used in the UI. --- backend/open_webui/routers/utils.py | 7 ---- src/lib/apis/utils/index.ts | 35 ------------------- .../components/admin/Settings/Database.svelte | 2 +- 3 files changed, 1 insertion(+), 43 deletions(-) diff --git a/backend/open_webui/routers/utils.py b/backend/open_webui/routers/utils.py index 0e6768a671..6445a9fc28 100644 --- a/backend/open_webui/routers/utils.py +++ b/backend/open_webui/routers/utils.py @@ -126,10 +126,3 @@ async def download_db(user=Depends(get_admin_user)): ) -@router.get("/litellm/config") -async def download_litellm_config_yaml(user=Depends(get_admin_user)): - return FileResponse( - f"{DATA_DIR}/litellm/config.yaml", - media_type="application/octet-stream", - filename="config.yaml", - ) diff --git a/src/lib/apis/utils/index.ts b/src/lib/apis/utils/index.ts index 1fc30ddbba..79f56514a2 100644 --- a/src/lib/apis/utils/index.ts +++ b/src/lib/apis/utils/index.ts @@ -180,38 +180,3 @@ export const downloadDatabase = async (token: string) => { } }; -export const downloadLiteLLMConfig = async (token: string) => { - let error = null; - - const res = await fetch(`${WEBUI_API_BASE_URL}/utils/litellm/config`, { - method: 'GET', - headers: { - 'Content-Type': 'application/json', - Authorization: `Bearer ${token}` - } - }) - .then(async (response) => { - if (!response.ok) { - throw await response.json(); - } - return response.blob(); - }) - .then((blob) => { - const url = window.URL.createObjectURL(blob); - const a = document.createElement('a'); - a.href = url; - a.download = 'config.yaml'; - document.body.appendChild(a); - a.click(); - window.URL.revokeObjectURL(url); - }) - .catch((err) => { - console.error(err); - error = err.detail; - return null; - }); - - if (error) { - throw error; - } -}; diff --git a/src/lib/components/admin/Settings/Database.svelte b/src/lib/components/admin/Settings/Database.svelte index d5bebed221..1c966ac356 100644 --- a/src/lib/components/admin/Settings/Database.svelte +++ b/src/lib/components/admin/Settings/Database.svelte @@ -2,7 +2,7 @@ import fileSaver from 'file-saver'; const { saveAs } = fileSaver; - import { downloadDatabase, downloadLiteLLMConfig } from '$lib/apis/utils'; + import { downloadDatabase } from '$lib/apis/utils'; import { onMount, getContext } from 'svelte'; import { config, user } from '$lib/stores'; import { toast } from 'svelte-sonner';