The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
UI - Support 'batch' model health checks + make 'team-only' model concept clearer (#12770)
Krish Dholakiaee066481f8c0
diff --git a/litellm/batches/main.py b/litellm/batches/main.pyindex 98527556226..3ea0f95157f 100644--- a/litellm/batches/main.py+++ b/litellm/batches/main.py@@ -469,6 +469,7 @@ def retrieve_batch(raise e+@clientasync def alist_batches(after: Optional[str] = None,limit: Optional[int] = None,@@ -481,6 +482,7 @@ async def alist_batches("""Async: List your organization's batches."""+try:loop = asyncio.get_event_loop()kwargs["alist_batches"] = True@@ -510,6 +512,7 @@ async def alist_batches(raise e+@clientdef list_batches(after: Optional[str] = None,limit: Optional[int] = None,diff --git a/litellm/main.py b/litellm/main.pyindex 668109e0c17..e0b76d57a6a 100644--- a/litellm/main.py+++ b/litellm/main.py@@ -2925,7 +2925,7 @@ def completion( # type: ignore # noqa: PLR0915acompletion=acompletion,client=client,api_base=api_base,- api_key=api_key+ api_key=api_key,)elif bedrock_route == "converse_like":model = model.replace("converse_like/", "")@@ -3306,7 +3306,7 @@ def completion( # type: ignore # noqa: PLR0915custom_llm_provider=custom_llm_provider,encoding=encoding,stream=stream,- provider_config=bytez_transformation+ provider_config=bytez_transformation,)pass@@ -5563,6 +5563,9 @@ async def ahealth_check(api_key=model_params.get("api_key", None),api_version=model_params.get("api_version", None),),+ "batch": lambda: litellm.alist_batches(+ **_filter_model_params(model_params),+ ),}if mode in mode_handlers:diff --git a/litellm/proxy/_experimental/out/model_hub_table.html b/litellm/proxy/_experimental/out/model_hub_table/index.htmlsimilarity index 100%rename from litellm/proxy/_experimental/out/model_hub_table.htmlrename to litellm/proxy/_experimental/out/model_hub_table/index.htmldiff --git a/litellm/proxy/_experimental/out/onboarding.html b/litellm/proxy/_experimental/out/onboarding.htmldeleted file mode 100644index 15c00b700a6..00000000000--- a/litellm/proxy/_experimental/out/onboarding.html+++ /dev/null@@ -1 +0,0 @@-<!DOCTYPE html><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/litellm-asset-prefix/_next/static/chunks/webpack-a426aae3231a8df1.js"/><script src="/litellm-asset-prefix/_next/static/chunks/fd9d1056-205af899b895cbac.js" async=""></script><script src="/litellm-asset-prefix/_next/static/chunks/117-a0da667066d322b6.js" async=""></script><script src="/litellm-asset-prefix/_next/static/chunks/main-app-475d6efe4080647d.js" async=""></script><title>LiteLLM Dashboard</title><meta name="description" content="LiteLLM Proxy Admin UI"/><link rel="icon" href="/favicon.ico" type="image/x-icon" sizes="16x16"/><link rel="icon" href="./favicon.ico"/><meta name="next-size-adjust"/><script src="/litellm-asset-prefix/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><script src="/litellm-asset-prefix/_next/static/chunks/webpack-a426aae3231a8df1.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:HL[\"/litellm-asset-prefix/_next/static/media/e4af272ccee01ff0-s.p.woff2\",\"font\",{\"crossOrigin\":\"\",\"type\":\"font/woff2\"}]\n2:HL[\"/litellm-asset-prefix/_next/static/css/31b7f215e119031e.css\",\"style\"]\n3:HL[\"/litellm-asset-prefix/_next/static/css/7605cfc28cc34f61.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"4:I[12846,[],\"\"]\n6:I[19107,[],\"ClientPageRoot\"]\n7:I[12011,[\"665\",\"static/chunks/3014691f-b7b79b78e27792f3.js\",\"445\",\"static/chunks/445-e14a4d059f7305d5.js\",\"634\",\"static/chunks/634-74ee1cee62277068.js\",\"338\",\"static/chunks/338-0c4edef4490f1fc1.js\",\"461\",\"static/chunks/app/onboarding/page-fe81b320f1a99897.js\"],\"default\",1]\n8:I[4707,[],\"\"]\n9:I[36423,[],\"\"]\nb:I[61060,[],\"\"]\nc:[]\n"])</script><script>self.__next_f.push([1,"0:[\"$\",\"$L4\",null,{\"buildId\":\"l8uMWXD2lU6PxvnKc6L9f\",\"assetPrefix\":\"/litellm-asset-prefix\",\"urlParts\":[\"\",\"onboarding\"],\"initialTree\":[\"\",{\"children\":[\"onboarding\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"onboarding\",{\"children\":[\"__PAGE__\",{},[[\"$L5\",[\"$\",\"$L6\",null,{\"props\":{\"params\":{},\"searchParams\":{}},\"Component\":\"$7\"}],null],null],null]},[null,[\"$\",\"$L8\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"onboarding\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L9\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\"}]],null]},[[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/litellm-asset-prefix/_next/static/css/31b7f215e119031e.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"stylesheet\",\"href\":\"/litellm-asset-prefix/_next/static/css/7605cfc28cc34f61.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"children\":[\"$\",\"body\",null,{\"className\":\"__className_b0dd8a\",\"children\":[\"$\",\"$L8\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L9\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],\"notFoundStyles\":[]}]}]}]],null],null],\"couldBeIntercepted\":false,\"initialHead\":[null,\"$La\"],\"globalErrorComponent\":\"$b\",\"missingSlots\":\"$Wc\"}]\n"])</script><script>self.__next_f.push([1,"a:[[\"$\",\"meta\",\"0\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"1\",{\"charSet\":\"utf-8\"}],[\"$\",\"title\",\"2\",{\"children\":\"LiteLLM Dashboard\"}],[\"$\",\"meta\",\"3\",{\"name\":\"description\",\"content\":\"LiteLLM Proxy Admin UI\"}],[\"$\",\"link\",\"4\",{\"rel\":\"icon\",\"href\":\"/favicon.ico\",\"type\":\"image/x-icon\",\"sizes\":\"16x16\"}],[\"$\",\"link\",\"5\",{\"rel\":\"icon\",\"href\":\"./favicon.ico\"}],[\"$\",\"meta\",\"6\",{\"name\":\"next-size-adjust\"}]]\n5:null\n"])</script></body></html>\ No newline at end of filediff --git a/ui/litellm-dashboard/src/components/add_model/add_model_modes.tsx b/ui/litellm-dashboard/src/components/add_model/add_model_modes.tsxindex 2b544fd1900..2ddcf4984c3 100644--- a/ui/litellm-dashboard/src/components/add_model/add_model_modes.tsx+++ b/ui/litellm-dashboard/src/components/add_model/add_model_modes.tsx@@ -7,5 +7,6 @@ export const TEST_MODES = [{ value: "audio_transcription", label: "Audio Transcription - /audio/transcriptions" },{ value: "image_generation", label: "Image Generation - /images/generations" },{ value: "rerank", label: "Rerank - /rerank" },- { value: "realtime", label: "Realtime - /realtime"}+ { value: "realtime", label: "Realtime - /realtime"},+ { value: "batch", label: "Batch - /batch"}];\ No newline at end of filediff --git a/ui/litellm-dashboard/src/components/add_model/add_model_tab.tsx b/ui/litellm-dashboard/src/components/add_model/add_model_tab.tsxindex 2bd376af7fb..d128435a4fc 100644--- a/ui/litellm-dashboard/src/components/add_model/add_model_tab.tsx+++ b/ui/litellm-dashboard/src/components/add_model/add_model_tab.tsx@@ -12,7 +12,7 @@ import { CredentialItem, modelAvailableCall } from "../networking";import ConnectionErrorDisplay from "./model_connection_test";import { TEST_MODES } from "./add_model_modes";import { Row, Col } from "antd";-import { Text, TextInput } from "@tremor/react";+import { Text, TextInput, Switch } from "@tremor/react";import TeamDropdown from "../common_components/team_dropdown";import { all_admin_roles } from "@/utils/roles";@@ -31,6 +31,7 @@ interface AddModelTabProps {credentials: CredentialItem[];accessToken: string;userRole: string;+ premiumUser: boolean;}const { Title, Link } = Typography;@@ -50,6 +51,7 @@ const AddModelTab: React.FC<AddModelTabProps> = ({credentials,accessToken,userRole,+ premiumUser,}) => {// State for test mode and connection testingconst [testMode, setTestMode] = useState<string>("chat");@@ -68,6 +70,9 @@ const AddModelTab: React.FC<AddModelTabProps> = ({setIsResultModalVisible(true);};+ // State for team-only switch+ const [isTeamOnly, setIsTeamOnly] = useState<boolean>(false);+const [modelAccessGroups, setModelAccessGroups] = useState<string[]>([]);useEffect(() => {@@ -238,20 +243,46 @@ const AddModelTab: React.FC<AddModelTabProps> = ({<span className="px-4 text-gray-500 text-sm">Additional Model Info Settings</span><div className="flex-grow border-t border-gray-200"></div></div>+ {/* Team-only Model Switch */}<Form.Item- label="Team"- name="team_id"+ label="Team-BYOK Model"+ tooltip="Only use this model + credential combination for this team. Useful when teams want to onboard their own OpenAI keys."className="mb-4"- tooltip="Only keys for this team, will be able to call this model."- rules={[- {- required: !isAdmin, // Required if not admin- message: 'Please select a team.'- }- ]}>- <TeamDropdown teams={teams} />+ <Tooltip+ title={!premiumUser ? "This is an enterprise-only feature. Upgrade to premium to restrict model+credential combinations to a specific team." : ""}+ placement="top"+ >+ <Switch+ checked={isTeamOnly}+ onChange={(checked) => {+ setIsTeamOnly(checked);+ if (!checked) {+ form.setFieldValue('team_id', undefined);+ }+ }}+ disabled={!premiumUser}+ />+ </Tooltip></Form.Item>++ {/* Conditional Team Selection */}+ {isTeamOnly && (+ <Form.Item+ label="Select Team"+ name="team_id"+ className="mb-4"+ tooltip="Only keys for this team will be able to call this model."+ rules={[+ {+ required: isTeamOnly && !isAdmin,+ message: 'Please select a team.'+ }+ ]}+ >+ <TeamDropdown teams={teams} disabled={!premiumUser} />+ </Form.Item>+ )}{isAdmin && (<>diff --git a/ui/litellm-dashboard/src/components/common_components/team_dropdown.tsx b/ui/litellm-dashboard/src/components/common_components/team_dropdown.tsxindex 3a318d1820b..367977dac52 100644--- a/ui/litellm-dashboard/src/components/common_components/team_dropdown.tsx+++ b/ui/litellm-dashboard/src/components/common_components/team_dropdown.tsx@@ -6,15 +6,18 @@ interface TeamDropdownProps {teams?: Team[] | null;value?: string;onChange?: (value: string) => void;+ disabled?: boolean;}-const TeamDropdown: React.FC<TeamDropdownProps> = ({ teams, value, onChange }) => {+const TeamDropdown: React.FC<TeamDropdownProps> = ({ teams, value, onChange, disabled }) => {+ console.log("disabled", disabled);return (<SelectshowSearchplaceholder="Search or select a team"value={value}onChange={onChange}+ disabled={disabled}filterOption={(input, option) => {if (!option) return false;// Get team data from the option keydiff --git a/ui/litellm-dashboard/src/components/model_dashboard.tsx b/ui/litellm-dashboard/src/components/model_dashboard.tsxindex c1cb432ecfc..860984413b6 100644--- a/ui/litellm-dashboard/src/components/model_dashboard.tsx+++ b/ui/litellm-dashboard/src/components/model_dashboard.tsx@@ -1397,6 +1397,7 @@ const ModelDashboard: React.FC<ModelDashboardProps> = ({credentials={credentialsList}accessToken={accessToken}userRole={userRole}+ premiumUser={premiumUser}/></TabPanel><TabPanel>