JuliusBrussee/caveman · error
caveman agent: invalid .caveman/provider.json
Error message
caveman agent: invalid .caveman/provider.json
What it means
Error "caveman agent: invalid .caveman/provider.json" thrown in JuliusBrussee/caveman.
Source
Thrown at packages/agent/src/runtime.ts:3274
throw new Error(
configured.length === 0
? "caveman agent: no supported provider credential found"
: "caveman agent: multiple provider credentials found; set CAVE_MODEL once",
);
}
const [provider, id] = configured[0]!;
const model = models.getModel(provider, id);
if (!model) throw new Error(`caveman agent: baseline model unavailable: ${provider}/${id}`);
return model;
}
function localProviderModel(rootDir: string): string | undefined {
try {
const parsed = JSON.parse(readFileSync(resolve(rootDir, ".caveman/provider.json"), "utf8")) as { model?: unknown };
return typeof parsed.model === "string" ? parsed.model : undefined;
} catch (error) {
if ((error as NodeJS.ErrnoException).code === "ENOENT") return undefined;
throw new Error("caveman agent: invalid .caveman/provider.json");
}
}
/**
* Point a model at the gateway when the gateway speaks its dialect.
*
* The three routes below are the only ones the Caveman gateway proxies. Every
* other provider Pi can reach (xai, groq, bedrock, openrouter, …) keeps its own
* base URL, and `routed: false` is what tells the caller this request is
* third-party traffic: no account key, no telemetry headers, no `optimized`.
*/
function routeModelThroughCave(
model: Model<Api>,
gatewayURL: string,
): { model: Model<Api>; routed: boolean } {
const prefix: Record<string, string> = {
anthropic: "anthropic",
// Pi provider clients append endpoint paths relative to these versionedView on GitHub (pinned to 27d5a3981a)
Solutions
- Fix .caveman/provider.json so it is valid JSON with the expected shape.
When it happens
Trigger: Thrown at packages/agent/src/runtime.ts:3274 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of JuliusBrussee/caveman@27d5a3981a (2026-08-15).
Data as JSON: /api/errors/e6d32809829a20f6.
Report an issue: GitHub.