diff --git a/ui/litellm-dashboard/src/components/templates/KeyEditViewControls.tsx b/ui/litellm-dashboard/src/components/templates/KeyEditViewControls.tsx index c12a913e384..99220af7c6f 100644 --- a/ui/litellm-dashboard/src/components/templates/KeyEditViewControls.tsx +++ b/ui/litellm-dashboard/src/components/templates/KeyEditViewControls.tsx @@ -7,6 +7,7 @@ import { CircleHelp } from "lucide-react"; import { FormField } from "@/components/shared/form/FormField"; import { toast } from "@/lib/toast"; import AgentSelector from "../agent_management/AgentSelector"; +import RateLimitTypeFormItem from "../common_components/RateLimitTypeFormItem"; import NumericalInput from "../shared/numerical_input"; import SkillSelector from "../skills/SkillSelector"; import { moveTagsOutOfMetadataJson } from "./keyEditFieldNormalizers"; @@ -61,9 +62,51 @@ export const KeyTypeSelect = ({ const SKILLS_HINT = "Enabled skills are visible to every key. Grant disabled (private) Claude Code plugins to this key here."; -export const TPD_HINT = +const TPD_HINT = "Daily token budget for batch submissions (/v1/batches). When set, batch input files are charged against this 24h window instead of the key's TPM/RPM limits. Online requests keep using TPM/RPM."; +export const KeyRateLimitFields = ({ control }: { control: Control }) => ( + <> + + {({ ref: _ref, ...field }) => } + + + + {({ value, onChange, id }) => ( + + )} + + + + {({ ref: _ref, ...field }) => } + + + + {({ value, onChange, id }) => ( + + )} + + + + {({ ref: _ref, ...field }) => } + + +); + export const KeyAgentAndSkillFields = ({ control, accessToken, diff --git a/ui/litellm-dashboard/src/components/templates/key_edit_view.tsx b/ui/litellm-dashboard/src/components/templates/key_edit_view.tsx index a69d6715ef7..6a94cbcf2a0 100644 --- a/ui/litellm-dashboard/src/components/templates/key_edit_view.tsx +++ b/ui/litellm-dashboard/src/components/templates/key_edit_view.tsx @@ -20,7 +20,6 @@ import BudgetDurationDropdown from "../common_components/budget_duration_dropdow import { mapInternalToDisplayNames } from "../callback_info_helpers"; import KeyLifecycleSettings from "../common_components/KeyLifecycleSettings"; import PassThroughRoutesSelector from "../common_components/PassThroughRoutesSelector"; -import RateLimitTypeFormItem from "../common_components/RateLimitTypeFormItem"; import OrganizationDropdown from "../common_components/OrganizationDropdown"; import RouterSettingsAccordion, { RouterSettingsAccordionRef } from "../common_components/RouterSettingsAccordion"; import { routerSettingsEditorValue, routerSettingsUpdate } from "../common_components/routerSettingsPayload"; @@ -35,10 +34,10 @@ import { KeyAgentAndSkillFields, KeyBudgetNumberField, KeyMetadataField, + KeyRateLimitFields, KeyTypeSelect, labelWithHint, moveMetadataTagsToTagsField, - TPD_HINT, } from "./KeyEditViewControls"; import { KeyEditFormValues, @@ -485,43 +484,7 @@ export function KeyEditView({ /> - - {({ ref: _ref, ...field }) => } - - - - {({ value, onChange, id }) => ( - - )} - - - - {({ ref: _ref, ...field }) => } - - - - {({ value, onChange, id }) => ( - - )} - - - - {({ ref: _ref, ...field }) => } - +