feat(agentswarm): optional c0mpute.com inference backend

createC0mputeModel() turns a connected c0mpute.com account (apiKey + OpenAI-
compatible base URL) into a LangChain chat model, usable as the model for
createDeepAgentRunner or the chatModel for the judge/router — so agent inference
can run on community-shared GPUs. Opt-in; default stays the hosted provider.
agentswarm performs no OAuth: the host's c0mpute connector supplies credentials
(resolveC0mputeConnector / c0mputeConnectorFromEnv normalize them). DeepAgent
runner now accepts a model instance, not just a provider string.

7 new tests (defaults, env mapping, not-connected + missing-peer errors); 34/34 pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Anthony Ettinger 2026-06-25 17:47:00 +00:00
parent dd7fe0b5c4
commit fbbb323477
4 changed files with 148 additions and 2 deletions

View file

@ -1,8 +1,12 @@
import type { SwarmMessage, SwarmRunInput, SwarmRunResult, SwarmRunner } from "./types.js";
export interface DeepAgentRunnerOptions {
/** Provider-prefixed model id, e.g. "anthropic:claude-sonnet-4-6". */
model: string;
/**
* The model to run on: a provider-prefixed id (e.g. "anthropic:claude-sonnet-4-6")
* or a pre-built LangChain chat model instance e.g. from {@link createC0mputeModel}
* to run inference on community-shared GPUs.
*/
model: string | object;
/** System instructions for the lead agent. */
instructions?: string;
/**