@@ -124,21 +124,37 @@ type ExistingCustomModelSectionProps = {
124124type CustomModelSectionProps = NewCustomModelSectionProps | ExistingCustomModelSectionProps ;
125125
126126const CustomModelSection = ( { isNew, onChange, model : customModel } : CustomModelSectionProps ) => {
127+ const defaults = {
128+ modelName : "" ,
129+ slug : "" ,
130+ baseUrl : "" ,
131+ apiKey : "" ,
132+ maxOutput : 4000 ,
133+ temperature : 0.7 ,
134+ parallelToolCalls : true ,
135+ store : false ,
136+ contextWindow : 0 ,
137+ inputPrice : 0 ,
138+ outputPrice : 0 ,
139+ } ;
140+
127141 const id = customModel ?. id || "" ;
128142 const [ isEditing , setIsEditing ] = useState ( isNew ) ;
129143 const [ isProcessing , setIsProcessing ] = useState ( false ) ;
130144 const [ processingAction , setProcessingAction ] = useState < "save" | "delete" | null > ( null ) ;
131- const [ baseUrl , setBaseUrl ] = useState ( customModel ?. baseUrl || "" ) ;
132- const [ slug , setSlug ] = useState ( customModel ?. slug ?? "" ) ;
133- const [ apiKey , setApiKey ] = useState ( customModel ?. apiKey || "" ) ;
134- const [ contextWindow , setContextWindow ] = useState < number > ( customModel ?. contextWindow ?? 0 ) ;
135- const [ maxOutput , setMaxOutput ] = useState < number > ( customModel ?. maxOutput ?? 4000 ) ;
136- const [ temperature , setTemperature ] = useState < number > ( customModel ?. temperature ?? 0.7 ) ;
137- const [ parallelToolCalls , setParallelToolCalls ] = useState < boolean > ( customModel ?. parallelToolCalls ?? true ) ;
138- const [ store , setStore ] = useState < boolean > ( customModel ?. store ?? false ) ;
139- const [ inputPrice , setInputPrice ] = useState < number > ( customModel ?. inputPrice ?? 0 ) ;
140- const [ outputPrice , setOutputPrice ] = useState < number > ( customModel ?. outputPrice ?? 0 ) ;
141- const [ modelName , setModelName ] = useState ( customModel ?. name || "" ) ;
145+ const [ baseUrl , setBaseUrl ] = useState ( customModel ?. baseUrl || defaults . baseUrl ) ;
146+ const [ slug , setSlug ] = useState ( customModel ?. slug ?? defaults . slug ) ;
147+ const [ apiKey , setApiKey ] = useState ( customModel ?. apiKey || defaults . apiKey ) ;
148+ const [ contextWindow , setContextWindow ] = useState < number > ( customModel ?. contextWindow ?? defaults . contextWindow ) ;
149+ const [ maxOutput , setMaxOutput ] = useState < number > ( customModel ?. maxOutput ?? defaults . maxOutput ) ;
150+ const [ temperature , setTemperature ] = useState < number > ( customModel ?. temperature ?? defaults . temperature ) ;
151+ const [ parallelToolCalls , setParallelToolCalls ] = useState < boolean > (
152+ customModel ?. parallelToolCalls ?? defaults . parallelToolCalls ,
153+ ) ;
154+ const [ store , setStore ] = useState < boolean > ( customModel ?. store ?? defaults . store ) ;
155+ const [ inputPrice , setInputPrice ] = useState < number > ( customModel ?. inputPrice ?? defaults . inputPrice ) ;
156+ const [ outputPrice , setOutputPrice ] = useState < number > ( customModel ?. outputPrice ?? defaults . outputPrice ) ;
157+ const [ modelName , setModelName ] = useState ( customModel ?. name || defaults . modelName ) ;
142158 const [ isModelNameValid , setIsModelNameValid ] = useState ( true ) ;
143159 const [ isSlugValid , setIsSlugValid ] = useState ( true ) ;
144160 const [ isBaseUrlValid , setIsBaseUrlValid ] = useState ( true ) ;
@@ -156,17 +172,17 @@ const CustomModelSection = ({ isNew, onChange, model: customModel }: CustomModel
156172 if ( isNew || ! customModel ) return ;
157173 if ( isEditing ) return ;
158174
159- setModelName ( customModel . name || "" ) ;
160- setBaseUrl ( customModel . baseUrl || "" ) ;
161- setSlug ( customModel . slug || "" ) ;
162- setApiKey ( customModel . apiKey || "" ) ;
163- setContextWindow ( customModel . contextWindow ?? 0 ) ;
164- setMaxOutput ( customModel . maxOutput ?? 4000 ) ;
165- setInputPrice ( customModel . inputPrice ?? 0 ) ;
166- setOutputPrice ( customModel . outputPrice ?? 0 ) ;
167- setTemperature ( customModel . temperature ?? 0.7 ) ;
168- setParallelToolCalls ( customModel . parallelToolCalls ?? true ) ;
169- setStore ( customModel . store ?? false ) ;
175+ setModelName ( customModel . name || defaults . modelName ) ;
176+ setBaseUrl ( customModel . baseUrl || defaults . baseUrl ) ;
177+ setSlug ( customModel . slug || defaults . slug ) ;
178+ setApiKey ( customModel . apiKey || defaults . apiKey ) ;
179+ setContextWindow ( customModel . contextWindow ?? defaults . contextWindow ) ;
180+ setMaxOutput ( customModel . maxOutput ?? defaults . maxOutput ) ;
181+ setInputPrice ( customModel . inputPrice ?? defaults . inputPrice ) ;
182+ setOutputPrice ( customModel . outputPrice ?? defaults . outputPrice ) ;
183+ setTemperature ( customModel . temperature ?? defaults . temperature ) ;
184+ setParallelToolCalls ( customModel . parallelToolCalls ?? defaults . parallelToolCalls ) ;
185+ setStore ( customModel . store ?? defaults . store ) ;
170186 } , [ isNew , isEditing , customModel ] ) ;
171187
172188 const handleOnChange = async ( isDelete : boolean ) => {
@@ -221,17 +237,17 @@ const CustomModelSection = ({ isNew, onChange, model: customModel }: CustomModel
221237 ) ;
222238
223239 if ( isNew ) {
224- setModelName ( "" ) ;
225- setBaseUrl ( "" ) ;
226- setSlug ( "" ) ;
227- setApiKey ( "" ) ;
228- setContextWindow ( 0 ) ;
229- setMaxOutput ( 4000 ) ;
230- setInputPrice ( 0 ) ;
231- setOutputPrice ( 0 ) ;
232- setTemperature ( 0.7 ) ;
233- setParallelToolCalls ( true ) ;
234- setStore ( false ) ;
240+ setModelName ( defaults . modelName ) ;
241+ setBaseUrl ( defaults . baseUrl ) ;
242+ setSlug ( defaults . slug ) ;
243+ setApiKey ( defaults . apiKey ) ;
244+ setContextWindow ( defaults . contextWindow ) ;
245+ setMaxOutput ( defaults . maxOutput ) ;
246+ setInputPrice ( defaults . inputPrice ) ;
247+ setOutputPrice ( defaults . outputPrice ) ;
248+ setTemperature ( defaults . temperature ) ;
249+ setParallelToolCalls ( defaults . parallelToolCalls ) ;
250+ setStore ( defaults . store ) ;
235251 } else if ( isSaveAction ) {
236252 setIsEditing ( false ) ;
237253 }
@@ -335,6 +351,8 @@ const CustomModelSection = ({ isNew, onChange, model: customModel }: CustomModel
335351 < br />
336352 - openai/gpt-5.1 (OpenRouter)
337353 < br />
354+ < br />
355+ PaperDebugger currently only supports models that support the Chat Completions API.
338356 </ div >
339357 }
340358 placement = "bottom"
@@ -502,7 +520,17 @@ const CustomModelSection = ({ isNew, onChange, model: customModel }: CustomModel
502520 < AccordionItem
503521 key = "optional-fields"
504522 aria-label = "More"
505- title = { < span className = "text-xs text-default-900" > { isNew ? "Optional Fields" : "More" } </ span > }
523+ title = {
524+ < Tooltip
525+ content = "These fields are purely for user reference. Click to expand."
526+ placement = "bottom"
527+ delay = { 100 }
528+ >
529+ < label className = "text-xs text-default-900 underline decoration-dotted underline-offset-2 cursor-pointer" >
530+ Optional Fields
531+ </ label >
532+ </ Tooltip >
533+ }
506534 classNames = { {
507535 trigger : "px-1 py-0 min-h-0" ,
508536 content : "pt-1 pb-1" ,
0 commit comments