Skip to content

Commit 6eef216

Browse files
wizard: emit all providers referenced by persona routing rules
Devin Review (red): the wizard previously emitted only the provider derived from the default model. But cost-optimized routing references cerebras, moonshot, and anthropic too — a wizard-generated config would fail at runtime when routing picked one of those. Refactored to a data-driven `EXTRA_PROVIDERS` map so each persona declares which providers its routing rules need. The generator then emits the union of (default-model provider, extra persona providers). - cost-optimized: anthropic, google, moonshot, cerebras - production: anthropic, google - security-hardened: anthropic (for the quarantine fallback) Also added cerebras to the providerKeys map (CEREBRAS_API_KEY). Co-Authored-By: Rob <onerobby@gmail.com>
1 parent 73ce189 commit 6eef216

1 file changed

Lines changed: 21 additions & 9 deletions

File tree

docs/wizard/index.html

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -301,16 +301,28 @@ <h1>Hermes Config Wizard</h1>
301301
lines.push(`models:`);
302302
lines.push(` default: ${model}`);
303303
lines.push(` providers:`);
304-
const provider = model.split('/')[0];
305-
const providerKey = {
304+
const providerKeys = {
306305
anthropic: 'ANTHROPIC_API_KEY',
307-
google: 'GOOGLE_API_KEY',
308-
openai: 'OPENAI_API_KEY',
309-
moonshot: 'MOONSHOT_API_KEY',
310-
zai: 'ZAI_API_KEY',
311-
}[provider] || 'API_KEY';
312-
lines.push(` ${provider}:`);
313-
lines.push(` api_key: "$\{${providerKey}\}"`);
306+
google: 'GOOGLE_API_KEY',
307+
openai: 'OPENAI_API_KEY',
308+
moonshot: 'MOONSHOT_API_KEY',
309+
zai: 'ZAI_API_KEY',
310+
cerebras: 'CEREBRAS_API_KEY',
311+
};
312+
// Providers required by each persona's routing rules (must be superset of
313+
// models referenced in routing blocks later in this function).
314+
const EXTRA_PROVIDERS = {
315+
'cost-optimized': ['anthropic', 'google', 'moonshot', 'cerebras'],
316+
'production': ['anthropic', 'google'],
317+
'security-hardened': ['anthropic'],
318+
};
319+
const providersToEmit = new Set([model.split('/')[0]]);
320+
(EXTRA_PROVIDERS[persona] || []).forEach(p => providersToEmit.add(p));
321+
[...providersToEmit].forEach(p => {
322+
const envVar = providerKeys[p] || 'API_KEY';
323+
lines.push(` ${p}:`);
324+
lines.push(` api_key: "$\{${envVar}\}"`);
325+
});
314326
lines.push(``);
315327

316328
// Gateways

0 commit comments

Comments
 (0)