@markbrutx/promptbook-openrouter
v0.4.4
Published
OpenRouter ModelAdapter for @markbrutx/promptbook-core eval. Network lives here; core stays pure.
Downloads
468
Maintainers
Readme
@markbrutx/promptbook-openrouter
OpenRouter ModelAdapter for @markbrutx/promptbook-core
eval. The network lives here so the core stays pure. Part of
promptbook.
npm i @markbrutx/promptbook-openrouterUsage
import { evaluate } from "@markbrutx/promptbook-core";
import { openRouterAdapter } from "@markbrutx/promptbook-openrouter";
const adapter = openRouterAdapter({
apiKey: process.env.OPENROUTER_API_KEY,
model: "openai/gpt-4o-mini",
});
const report = await evaluate({ promptsDir: "./prompts", adapter /* … */ });core only ever sees the ModelAdapter interface; this package maps a request
to OpenRouter's HTTP API and back. Swap it for any provider by implementing the
same interface.
