From 54b8836faa05ce4aa70bf93d06000332b6f1de8e Mon Sep 17 00:00:00 2001 From: Enrico Ros Date: Tue, 14 Oct 2025 15:56:38 -0700 Subject: [PATCH] KB: Update the params system --- kb/systems/LLM-parameters-system.md | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/kb/systems/LLM-parameters-system.md b/kb/systems/LLM-parameters-system.md index 19da387a9..493d92898 100644 --- a/kb/systems/LLM-parameters-system.md +++ b/kb/systems/LLM-parameters-system.md @@ -36,11 +36,21 @@ parameterSpecs: [ **Parameter Visibility**: The `hidden` flag removes parameters from the UI while keeping them functional. Models can also mark parameters as `required`. ### Layer 3: Client Configuration + +The system provides two UI configurators with different scopes: + +#### Full Model Configuration Dialog **File**: `src/modules/llms/models-modal/LLMParametersEditor.tsx` +Shows all non-hidden parameters from model's `parameterSpecs`. Used in the models modal for complete configuration. -The UI dynamically renders controls based on model specifications. Parameter visibility is determined by the `showParam()` function, which checks both model support and hidden flags. +#### ChatPanel Quick Controls +**File**: `src/apps/chat/components/layout-panel/ChatPanelModelParameters.tsx` +Shows only parameters that are: +- In model's `parameterSpecs` +- Listed in `_interestingParameters` array +- Not marked as `hidden` -**Value Resolution**: The client merges three value sources via `getAllModelParameterValues()`: +**Value Resolution**: Both UIs use `getAllModelParameterValues()` to merge: 1. **Fallback values** - Required parameters get their `requiredFallback` values 2. **Initial values** - Model's `initialParameters` (populated during model creation) 3. **User values** - User's `userParameters` (highest priority) @@ -98,6 +108,12 @@ The system maintains type safety through: - `DModelParameterSpec` interfaces for specifications - Runtime validation via Zod schemas at API boundaries +## Model Variant Pattern + +Some vendors use model variants to enable features, for instance: +- **Anthropic**: Creates separate `idVariant: 'thinking'` entries forcing value of hidden parameters +- **Google/OpenAI**: Parameters directly on base models + ## Migration and Compatibility The architecture supports parameter evolution: