Recipes are Assets
Define flows as named, versioned recipes and share them across teams like npm packages.
A deterministic, composable core for AI workflows, UI interactions, and provider adapters.

llm-core connects your business logic to AI models and avoids fragile scripts. Use Recipes for long-running workflows, Interactions for single-turn UI state, and Adapters to swap providers safely.
Runtime-agnostic core that works in Node, Bun, Edge, and browsers.
bun add @geekist/llm-coreWorkers: install via npm, pnpm, or yarn and deploy to your worker runtime such as Cloudflare Workers or Vercel Edge.
Define a flow, plug in your adapters, and run it.
import { recipes } from "@geekist/llm-core/recipes";
import { fromAiSdkModel } from "@geekist/llm-core/adapters";
import { openai } from "@ai-sdk/openai";
// 1. Define your recipe (or load a standard one)
const agent = recipes.agent();
// 2. Plug in your adapters
const model = fromAiSdkModel(openai("gpt-4o"));
const workflow = agent.defaults({ adapters: { model } }).build();
// 3. Run it
const result = await workflow.run({ input: "Build me a React app" });
if (result.status === "ok") {
console.log(result.artefact);
}Use the interaction core when you want UI-ready state for a single turn.
import { fromAiSdkModel } from "@geekist/llm-core/adapters";
import { openai } from "@ai-sdk/openai";
import { createInteractionPipelineWithDefaults, runInteractionPipeline } from "@geekist/llm-core/interaction";
/** @type {import("#adapters").Message} */
const message = { role: "user", content: "Hello!" };
const model = fromAiSdkModel(openai("gpt-4o-mini"));
const pipeline = createInteractionPipelineWithDefaults();
// runInteractionPipeline returns MaybePromise; await only if you need async.
const result = await runInteractionPipeline(pipeline, {
input: { message },
adapters: { model },
});
if ("__paused" in result && result.__paused) {
throw new Error("Interaction paused.");
}
const runResult = /** @type {import("#interaction").InteractionRunResult} */ (result);
if (runResult.artefact.messages[1]) {
console.log(runResult.artefact.messages[1].content);
}Pick a path and grow from there. Each one uses the same primitives: recipes, interactions, adapters.