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
Update general_settings.tsx
Achintya Rajan19f0c498e5e4
diff --git a/ui/litellm-dashboard/src/components/general_settings.tsx b/ui/litellm-dashboard/src/components/general_settings.tsxindex c59d0eac92b..3d9829104c8 100644--- a/ui/litellm-dashboard/src/components/general_settings.tsx+++ b/ui/litellm-dashboard/src/components/general_settings.tsx@@ -325,14 +325,46 @@ const GeneralSettings: React.FC<GeneralSettingsPageProps> = ({ accessToken, userconsole.log("router_settings", router_settings);+ const numberKeys = new Set(["allowed_fails", "cooldown_time", "num_retries", "timeout", "retry_after"]);+ const jsonKeys = new Set(["model_group_alias", "retry_policy"]);++ const parseInputValue = (key: string, raw: string | undefined, fallback: unknown) => {+ if (raw === undefined) return fallback;++ const v = raw.trim();++ if (v.toLowerCase() === "null") return null;++ if (numberKeys.has(key)) {+ const n = Number(v);+ return Number.isNaN(n) ? fallback : n;+ }++ if (jsonKeys.has(key)) {+ if (v === "") return null;+ try {+ return JSON.parse(v);+ } catch {+ return fallback;+ }+ }++ if (v.toLowerCase() === "true") return true;+ if (v.toLowerCase() === "false") return false;++ return v;+ };+const updatedVariables = Object.fromEntries(Object.entries(router_settings).map(([key, value]) => {if (key !== "routing_strategy_args" && key !== "routing_strategy") {- return [key, (document.querySelector(`input[name="${key}"]`) as HTMLInputElement)?.value || value];- } else if (key == "routing_strategy") {+ const inputEl = document.querySelector(`input[name="${key}"]`) as HTMLInputElement | null;+ const parsed = parseInputValue(key, inputEl?.value, value);+ return [key, parsed];+ } else if (key === "routing_strategy") {return [key, selectedStrategy];- } else if (key == "routing_strategy_args" && selectedStrategy == "latency-based-routing") {+ } else if (key === "routing_strategy_args" && selectedStrategy === "latency-based-routing") {let setRoutingStrategyArgs: routingStrategyArgs = {};const lowestLatencyBufferElement = document.querySelector(