Back to all reviewers

Use centralized model state

menloresearch/jan
Based on 2 comments
TSX

Always access AI model information, parameters, and configuration through centralized state management rather than direct access or hardcoded values. This ensures consistency, maintainability, and proper separation of concerns when working with AI models.

AI TSX

Reviewer Prompt

Always access AI model information, parameters, and configuration through centralized state management rather than direct access or hardcoded values. This ensures consistency, maintainability, and proper separation of concerns when working with AI models.

For model access, use established state management patterns:

// Good: Use centralized state
const model = currentActiveModel

// Avoid: Direct model access
const model = message.model

For model parameters (like llama.cpp settings), define constraints centrally rather than scattered throughout components:

// Good: Centralized parameter definitions
const llamaParams = {
  temperature: { min: 0, max: 2, step: 0.1 },
  maxTokens: { min: 1, max: 4096, step: 1 }
}

// Avoid: Hardcoded values in components
<SliderRightPanel min={0} max={100} step={1} />

This approach prevents inconsistencies, makes parameter updates easier, and provides a single source of truth for AI model configuration across the application.

2
Comments Analyzed
TSX
Primary Language
AI
Category

Source Discussions