MCPcopy Create free account
hub / github.com/ChatLab/ChatLab / saveLlmConfig

Function saveLlmConfig

apps/cli/src/ai/llm-config.ts:95–106  ·  view source on GitHub ↗
(aiDataDir: string, store: AIConfigStore)

Source from the content-addressed store, hash-verified

93const MAX_CONFIG_COUNT = 99
94
95function saveLlmConfig(aiDataDir: string, store: AIConfigStore): void {
96 const configPath = path.join(aiDataDir, 'llm-config.json')
97 const toSave = {
98 ...store,
99 configs: store.configs.map((c) => {
100 const { apiKey: _k, ...rest } = c
101 return rest
102 }),
103 schemaVersion: 3,
104 }
105 fs.writeFileSync(configPath, JSON.stringify(toSave, null, 2), 'utf-8')
106}
107
108export function addLlmConfig(
109 aiDataDir: string,

Callers 5

addLlmConfigFunction · 0.85
updateLlmConfigFunction · 0.85
deleteLlmConfigFunction · 0.85
setDefaultAssistantSlotFunction · 0.85
setFastModelSlotFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected