feat(core): Add ModelConfigService. (#12556)

This commit is contained in:
joshualitt
2025-11-05 17:18:42 -08:00
committed by GitHub
parent 0f5dd2229c
commit 956ab94452
13 changed files with 1774 additions and 0 deletions
+1
View File
@@ -669,6 +669,7 @@ export async function loadCliConfig(
recordResponses: argv.recordResponses,
retryFetchErrors: settings.general?.retryFetchErrors ?? false,
ptyInfo: ptyInfo?.name,
modelConfigServiceConfig: settings.modelConfigs,
// TODO: loading of hooks based on workspace trust
enableHooks: settings.tools?.enableHooks ?? false,
hooks: settings.hooks || {},
+33
View File
@@ -21,6 +21,7 @@ import {
DEFAULT_TRUNCATE_TOOL_OUTPUT_LINES,
DEFAULT_TRUNCATE_TOOL_OUTPUT_THRESHOLD,
DEFAULT_GEMINI_MODEL,
DEFAULT_MODEL_CONFIGS,
} from '@google/gemini-cli-core';
import type { CustomTheme } from '../ui/themes/theme.js';
import type { SessionRetentionSettings } from './settings.js';
@@ -680,6 +681,38 @@ const SETTINGS_SCHEMA = {
},
},
modelConfigs: {
type: 'object',
label: 'Model Configs',
category: 'Model',
requiresRestart: false,
default: DEFAULT_MODEL_CONFIGS,
description: 'Model configurations.',
showInDialog: false,
properties: {
aliases: {
type: 'object',
label: 'Model Config Aliases',
category: 'Model',
requiresRestart: false,
default: DEFAULT_MODEL_CONFIGS.aliases,
description:
'Named presets for model configs. Can be used in place of a model name and can inherit from other aliases using an `extends` property.',
showInDialog: false,
},
overrides: {
type: 'array',
label: 'Model Config Overrides',
category: 'Model',
requiresRestart: false,
default: [],
description:
'Apply specific configuration overrides based on matches, with a primary key of model (or alias). The most specific match will be used.',
showInDialog: false,
},
},
},
context: {
type: 'object',
label: 'Context',