From 2f46a3dfaf52dbe211ff7cf8adb75570c8e4cc2e Mon Sep 17 00:00:00 2001 From: Enrico Ros Date: Wed, 28 Jan 2026 17:45:39 -0800 Subject: [PATCH] LLM Options: Details/Override --- .../llms/models-modal/LLMOptionsModal.tsx | 220 +++++++++--------- 1 file changed, 116 insertions(+), 104 deletions(-) diff --git a/src/modules/llms/models-modal/LLMOptionsModal.tsx b/src/modules/llms/models-modal/LLMOptionsModal.tsx index af1579e43..2923cc583 100644 --- a/src/modules/llms/models-modal/LLMOptionsModal.tsx +++ b/src/modules/llms/models-modal/LLMOptionsModal.tsx @@ -2,7 +2,7 @@ import * as React from 'react'; import TimeAgo from 'react-timeago'; import { Box, Button, ButtonGroup, Divider, Dropdown, FormControl, Grid, IconButton, Input, Link, ListDivider, ListItemDecorator, Menu, MenuButton, MenuItem, Switch, Tooltip, Typography } from '@mui/joy'; -import ArrowForwardRoundedIcon from '@mui/icons-material/ArrowForwardRounded'; +import CheckRoundedIcon from '@mui/icons-material/CheckRounded'; import DeleteOutlineIcon from '@mui/icons-material/DeleteOutline'; import MoreVertIcon from '@mui/icons-material/MoreVert'; import StarBorderIcon from '@mui/icons-material/StarBorder'; @@ -84,8 +84,9 @@ export function LLMOptionsModal(props: { id: DLLMId, onClose: () => void }) { const { modelsServices, setConfServiceId } = useModelsServices(); const modelService = llm ? modelsServices.find(s => s.id === llm.sId) : null; - // state - auto-open details if user has customized pricing or token limits - const [showDetails, setShowDetails] = React.useState( + // state - auto-open advanced if user has customized pricing or token limits + const [showDetails, setShowDetails] = React.useState(false); + const [showAdvanced, setShowAdvanced] = React.useState( !!llm?.userPricing || llm?.userContextTokens !== undefined || llm?.userMaxOutputTokens !== undefined, ); const domainAssignments = useModelDomains(); @@ -236,7 +237,7 @@ export function LLMOptionsModal(props: { id: DLLMId, onClose: () => void }) { - + @@ -251,6 +252,18 @@ export function LLMOptionsModal(props: { id: DLLMId, onClose: () => void }) { } + {/* View toggles */} + setShowDetails(!showDetails)}> + {showDetails && } + Details ... + + setShowAdvanced(!showAdvanced)}> + {showAdvanced && } + Advanced ... + + + + {/* Future: Clone Model, Reset to Defaults */} {/* Delete */} @@ -354,109 +367,108 @@ export function LLMOptionsModal(props: { id: DLLMId, onClose: () => void }) { {Object.keys(llm.userParameters || {}).length > 0 && <>user parameters: {JSON.stringify(llm.userParameters, null, 2)}
} - {/* Advanced: Token Overrides */} - - - - - Reset - )} - slotProps={{ input: { min: 1 } }} - sx={{ flex: 1 }} - /> - - - - - - - Reset - )} - sx={{ flex: 1 }} - /> - - - - - {/* Advanced: Pricing Overrides */} - - - - Pricing Override (for hypothetical cost tracking) - - - - - - - Reset - )} - slotProps={{ input: { min: 0, step: 0.01 } }} - sx={{ flex: 1 }} - /> - - - - - - - Reset - )} - sx={{ flex: 1 }} - /> - - - - } + + {/* Advanced: Token & Pricing Overrides */} + {showAdvanced && Advanced: Parameters Override} + {showAdvanced && + + + + Reset + )} + slotProps={{ input: { min: 1 } }} + sx={{ flex: 1 }} + /> + + + + + + + Reset + )} + sx={{ flex: 1 }} + /> + + + + {/**/} + {/* */} + {/* Pricing Override (for hypothetical cost tracking)*/} + {/* */} + {/**/} + + + + + Reset + )} + slotProps={{ input: { min: 0, step: 0.01 } }} + sx={{ flex: 1 }} + /> + + + + + + + Reset + )} + sx={{ flex: 1 }} + /> + + + } + );