Просмотр исходного кода

Merge pull request #19042 from Classic298/remove-litellm-endpoint

refactor: Remove unused litellm endpoint and associated frontend code
Tim Baek 3 месяцев назад
Родитель
Сommit
79fd61cd5f

+ 0 - 7
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",
-    )

+ 0 - 35
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;
-	}
-};

+ 1 - 1
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';