Skip to content

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]

refactor(ui): move nonReasoningTierFields into its own module

moe-berri17e3dc1c7912
diff --git a/ui/litellm-dashboard/src/components/add_model/ClassificationMethodConfig.tsx b/ui/litellm-dashboard/src/components/add_model/ClassificationMethodConfig.tsx
index 61706985654..594c6d022ce 100644
--- a/ui/litellm-dashboard/src/components/add_model/ClassificationMethodConfig.tsx
+++ b/ui/litellm-dashboard/src/components/add_model/ClassificationMethodConfig.tsx
@@ -17,6 +17,7 @@ import ClassifierReasoningEffortSelect from "./ClassifierReasoningEffortSelect";
import ClassifierCircuitBreakerConfig from "./ClassifierCircuitBreakerConfig";
import ClassifierVisionConfig from "./ClassifierVisionConfig";
import type { ReasoningEffort } from "./complexity_router_tiers";
+import { nonReasoningTierFields } from "./nonReasoningTierFields";
import { useComplexityScorerDefaults } from "@/app/(dashboard)/hooks/autoRouter/useComplexityScorerDefaults";
import {
ClassificationFrequency,
@@ -237,19 +238,6 @@ const ClassifierTypeRadios: React.FC<{
);
};
-/** The NON_REASONING keys a classifier switch carries forward, or clears for a classifier that
- * cannot emit the tier. Leaving them set there is a config the backend refuses on save. */
-export const nonReasoningTierFields = (
- classifierType: ClassifierType,
- value: ComplexityRouterConfigValue,
-): Pick<ComplexityRouterConfigValue, "enable_non_reasoning_tier" | "tiers"> => {
- if (classifierType === "llm") {
- return { enable_non_reasoning_tier: value.enable_non_reasoning_tier, tiers: value.tiers };
- }
- const { NON_REASONING: _cleared, ...keptTiers } = value.tiers;
- return { enable_non_reasoning_tier: undefined, tiers: keptTiers };
-};
-
const ClassificationMethodConfig: React.FC<ClassificationMethodConfigProps> = ({
value,
onChange,
diff --git a/ui/litellm-dashboard/src/components/add_model/nonReasoningTierFields.test.ts b/ui/litellm-dashboard/src/components/add_model/nonReasoningTierFields.test.ts
index 86e50130e43..3f986d57dd9 100644
--- a/ui/litellm-dashboard/src/components/add_model/nonReasoningTierFields.test.ts
+++ b/ui/litellm-dashboard/src/components/add_model/nonReasoningTierFields.test.ts
@@ -1,7 +1,7 @@
import { describe, expect, it } from "vitest";
import type { ComplexityRouterConfigValue } from "./ComplexityRouterConfig";
-import { nonReasoningTierFields } from "./ClassificationMethodConfig";
+import { nonReasoningTierFields } from "./nonReasoningTierFields";
const enabledValue: ComplexityRouterConfigValue = {
classifier_type: "llm",
diff --git a/ui/litellm-dashboard/src/components/add_model/nonReasoningTierFields.ts b/ui/litellm-dashboard/src/components/add_model/nonReasoningTierFields.ts
new file mode 100644
index 00000000000..2ea7a3f3b97
--- /dev/null
+++ b/ui/litellm-dashboard/src/components/add_model/nonReasoningTierFields.ts
@@ -0,0 +1,14 @@
+import type { ClassifierType, ComplexityRouterConfigValue } from "./ComplexityRouterConfig";
+
+/** The NON_REASONING keys a classifier switch carries forward, or clears for a classifier that
+ * cannot emit the tier. Leaving them set there is a config the backend refuses on save. */
+export const nonReasoningTierFields = (
+ classifierType: ClassifierType,
+ value: ComplexityRouterConfigValue,
+): Pick<ComplexityRouterConfigValue, "enable_non_reasoning_tier" | "tiers"> => {
+ if (classifierType === "llm") {
+ return { enable_non_reasoning_tier: value.enable_non_reasoning_tier, tiers: value.tiers };
+ }
+ const { NON_REASONING: _cleared, ...keptTiers } = value.tiers;
+ return { enable_non_reasoning_tier: undefined, tiers: keptTiers };
+};