llm: named-provider registry — judges & topology nodes on GLM/Kimi
Adds a multi-provider registry so judges and topology execution can run on
providers beyond the default. cm-config gains [[llm.providers]] (name, base_url,
api_key_env) — all OpenAI-compatible (GLM, Kimi/Moonshot). The server builds an
Arc<dyn LlmProvider> per entry (OpenAiCompatProvider) keyed by name; a missing
key is skipped with a warning, not a boot failure. cm-runtime RuntimeConfig
carries a ProviderRegistry; Runtime::resolve_provider("<name>:<model>") selects a
registry provider (else the default). The door governor (Runtime::judge) and the
topology compare endpoint both resolve through it, so CLAWMATES_JUDGE_MODEL and
CLAWMATES_TOPOLOGY_EXEC_MODEL accept "glm:glm-4.6" / "kimi:kimi-k2".
Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
325038e806
commit
2ec8832ef6
@@ -62,6 +62,24 @@ pub struct LlmConfig {
|
||||
pub model: String,
|
||||
/// Scenario file for the deterministic `scripted` provider.
|
||||
pub scenario_path: Option<String>,
|
||||
/// Additional named providers exposed alongside the default — selectable as
|
||||
/// `"<name>:<model>"` by judges (`CLAWMATES_JUDGE_MODEL`) and topology nodes.
|
||||
/// All are OpenAI-compatible (GLM, Kimi/Moonshot, etc.).
|
||||
#[serde(default)]
|
||||
pub providers: Vec<NamedProvider>,
|
||||
}
|
||||
|
||||
/// An extra OpenAI-compatible provider in the registry (e.g. GLM or Kimi).
|
||||
#[derive(Debug, Clone, Deserialize)]
|
||||
pub struct NamedProvider {
|
||||
/// Selector prefix, e.g. `glm` or `kimi` (used as `"glm:glm-4.6"`).
|
||||
pub name: String,
|
||||
/// OpenAI-compatible base URL incl. version, e.g.
|
||||
/// `https://open.bigmodel.cn/api/paas/v4` (GLM) or
|
||||
/// `https://api.moonshot.ai/v1` (Kimi).
|
||||
pub base_url: String,
|
||||
/// Env var holding this provider's API key, e.g. `GLM_API_KEY`.
|
||||
pub api_key_env: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize)]
|
||||
|
||||
Reference in New Issue
Block a user