@@ -35,6 +35,7 @@ import MCPServerSelector from "../mcp_server_management/MCPServerSelector"
35
35
import ModelAliasManager from "../common_components/ModelAliasManager"
36
36
import NotificationsManager from "../molecules/notifications_manager"
37
37
import KeyLifecycleSettings from "../common_components/KeyLifecycleSettings"
38
+ import RateLimitTypeFormItem from "../common_components/RateLimitTypeFormItem"
38
39
39
40
const { Option } = Select ;
40
41
@@ -810,46 +811,14 @@ const CreateKey: React.FC<CreateKeyProps> = ({
810
811
>
811
812
< NumericalInput step = { 1 } width = { 400 } />
812
813
</ Form . Item >
813
- < Form . Item
814
- label = {
815
- < span >
816
- TPM Rate Limit Type { ' ' }
817
- < Tooltip title = "Select 'guaranteed_throughput' to prevent overallocating TPM limit when the key belongs to a Team with specific TPM limits." >
818
- < InfoCircleOutlined style = { { marginLeft : '4px' } } />
819
- </ Tooltip >
820
- </ span >
821
- }
814
+ < RateLimitTypeFormItem
815
+ type = "tpm"
822
816
name = "tpm_limit_type"
823
- initialValue = { null }
824
817
className = "mt-4"
825
- >
826
- < Select
827
- defaultValue = "default"
828
- placeholder = "Select rate limit type"
829
- style = { { width : "100%" } }
830
- optionLabelProp = "label"
831
- onChange = { ( value ) => {
832
- form . setFieldValue ( 'tpm_limit_type' , value ) ;
833
- } }
834
- >
835
- < Option value = "best_effort_throughput" label = "Default" >
836
- < div style = { { padding : '4px 0' } } >
837
- < div style = { { fontWeight : 500 } } > Default</ div >
838
- < div style = { { fontSize : '11px' , color : '#6b7280' , marginTop : '2px' } } >
839
- Best effort throughput - no error if we're overallocating tpm (Team/Key Limits checked at runtim).
840
- </ div >
841
- </ div >
842
- </ Option >
843
- < Option value = "guaranteed_throughput" label = "Guaranteed throughput" >
844
- < div style = { { padding : '4px 0' } } >
845
- < div style = { { fontWeight : 500 } } > Guaranteed throughput</ div >
846
- < div style = { { fontSize : '11px' , color : '#6b7280' , marginTop : '2px' } } >
847
- Guaranteed throughput - raise an error if we're overallocating tpm (also checks model-specific limits)
848
- </ div >
849
- </ div >
850
- </ Option >
851
- </ Select >
852
- </ Form . Item >
818
+ initialValue = { null }
819
+ form = { form }
820
+ showDetailedDescriptions = { true }
821
+ />
853
822
< Form . Item
854
823
className = "mt-4"
855
824
label = {
@@ -881,46 +850,14 @@ const CreateKey: React.FC<CreateKeyProps> = ({
881
850
>
882
851
< NumericalInput step = { 1 } width = { 400 } />
883
852
</ Form . Item >
884
- < Form . Item
885
- label = {
886
- < span >
887
- RPM Rate Limit Type { ' ' }
888
- < Tooltip title = "Select 'guaranteed_throughput' to prevent overallocating RPM limit when the key belongs to a Team with specific RPM limits." >
889
- < InfoCircleOutlined style = { { marginLeft : '4px' } } />
890
- </ Tooltip >
891
- </ span >
892
- }
853
+ < RateLimitTypeFormItem
854
+ type = "rpm"
893
855
name = "rpm_limit_type"
894
- initialValue = { null }
895
856
className = "mt-4"
896
- >
897
- < Select
898
- defaultValue = "default"
899
- placeholder = "Select rate limit type"
900
- style = { { width : "100%" } }
901
- optionLabelProp = "label"
902
- onChange = { ( value ) => {
903
- form . setFieldValue ( 'rpm_limit_type' , value ) ;
904
- } }
905
- >
906
- < Option value = "best_effort_throughput" label = "Default" >
907
- < div style = { { padding : '4px 0' } } >
908
- < div style = { { fontWeight : 500 } } > Default</ div >
909
- < div style = { { fontSize : '11px' , color : '#6b7280' , marginTop : '2px' } } >
910
- Best effort throughput - no error if we're overallocating rpm (Team/Key Limits checked at runtim).
911
- </ div >
912
- </ div >
913
- </ Option >
914
- < Option value = "guaranteed_throughput" label = "Guaranteed throughput" >
915
- < div style = { { padding : '4px 0' } } >
916
- < div style = { { fontWeight : 500 } } > Guaranteed throughput</ div >
917
- < div style = { { fontSize : '11px' , color : '#6b7280' , marginTop : '2px' } } >
918
- Guaranteed throughput - raise an error if we're overallocating rpm (also checks model-specific limits)
919
- </ div >
920
- </ div >
921
- </ Option >
922
- </ Select >
923
- </ Form . Item >
857
+ initialValue = { null }
858
+ form = { form }
859
+ showDetailedDescriptions = { true }
860
+ />
924
861
< Form . Item
925
862
label = {
926
863
< span >
0 commit comments