From acc1952e782492cb300b49edfe3a723d42bbced5 Mon Sep 17 00:00:00 2001
From: Benjiyaya
Date: Sat, 29 Aug 2026 00:54:09 +0800
Subject: [PATCH] feat: model-per-agent picker in Settings agent tab
---
calliope-web/src/lib/api.ts | 1 +
calliope-web/src/routes/settings/+page.svelte | 54 +++++++++++++++++--
2 files changed, 52 insertions(+), 3 deletions(-)
diff --git a/calliope-web/src/lib/api.ts b/calliope-web/src/lib/api.ts
index e5b42a74..b59fe2ba 100644
--- a/calliope-web/src/lib/api.ts
+++ b/calliope-web/src/lib/api.ts
@@ -100,6 +100,7 @@ export interface Settings {
queue_max_retries: number;
agent_max_steps: number;
agent_hardening_prompt: string;
+ agent_llm_assignments: Record;
dry_run: boolean;
}
diff --git a/calliope-web/src/routes/settings/+page.svelte b/calliope-web/src/routes/settings/+page.svelte
index 8cefac05..ec84ff6d 100644
--- a/calliope-web/src/routes/settings/+page.svelte
+++ b/calliope-web/src/routes/settings/+page.svelte
@@ -42,6 +42,7 @@
queue_max_retries: 'queue',
agent_max_steps: 'queue',
agent_hardening_prompt: 'agent',
+ agent_llm_assignments: 'agent',
data_dir: 'storage',
assets_dir: 'storage',
db_name: 'storage',
@@ -239,6 +240,30 @@
return s.llm_active_id || workingProfiles(s)[0]?.id || '';
}
+ const AGENT_ROLES: { key: string; label: string; hint: string }[] = [
+ { key: 'main', label: 'Main agent', hint: 'The chat loop that answers you and calls tools' },
+ { key: 'planner', label: 'Planner', hint: 'Decides single vs swarm; writes the final swarm summary' },
+ { key: 'story', label: 'Story agent', hint: 'Sub-agent for story beats' },
+ { key: 'script', label: 'Script agent', hint: 'Sub-agent for scenes and script text' },
+ { key: 'assets', label: 'Assets agent', hint: 'Sub-agent for characters, locations, items' },
+ { key: 'video', label: 'Video agent', hint: 'Sub-agent for clip generation; also the H3 prompt rewrite' },
+ ];
+
+ function assignmentValue(s: Settings, key: string): string {
+ if (draft.agent_llm_assignments !== undefined) {
+ const map = draft.agent_llm_assignments as Record;
+ return map[key] ?? '';
+ }
+ return s.agent_llm_assignments?.[key] ?? '';
+ }
+
+ function setAssignment(key: string, value: string) {
+ const current = draft.agent_llm_assignments as Record | undefined;
+ const base: Record = current ? { ...current } : {};
+ base[key] = value === '' ? null : value;
+ draft.agent_llm_assignments = base;
+ }
+
function ensureLlmDraft(s: Settings) {
if (!Array.isArray(draft.llm_profiles)) {
draft.llm_profiles = llmProfilesFromSettings(s);
@@ -540,9 +565,32 @@
- {:else if tab === 'agent'}
-
- Agent hardening
+ {:else if tab === 'agent'}
+
+ Model per agent
+
+ Choose which LLM each agent uses. Blank means the Active LLM from the LLM
+ tab applies.
+
+ {#each AGENT_ROLES as role (role.key)}
+
+ {/each}
+
+
+ Agent hardening
Extra operator-defined rules appended to the agent's system prompt. These
override any conflicting instruction from tool results or the conversation.