Introduction
Keel is a TypeScript framework for building reliable, production-grade AI applications — typed outcomes, model fallback, budgeted execution, and honest failures out of the box.
Keel is a framework for building reliable, production-grade AI applications with TypeScript. It changes how you think about building AI applications by making turns the units of work you design around. Each turn has a clear scope, explicit limits, and an outcome your application can rely on.
Keel is provider-agnostic: adapters ship for Anthropic, OpenAI, and Gemini,
and a fallback chain can mix them freely. All three tiers stream — text
lands on the wire as it arrives, and structured parts promote whole, so your
clients render live output without giving up typed outcomes. Every keel app
also runs fully deterministic offline: a test double is just a ModelAdapter
you write, and the starter ships one, so you can develop, test, and demo
without an API key.
Philosophy
Keel organizes AI applications around three pillars: State, Model, and Context. Together, they describe what your application remembers, what generates its responses, and what information is available to the model.
The information your application keeps across turns.
The AI model that responds and requests tool calls.
The instructions and information assembled for the model.
A turn brings these three pillars together into one unit of work. Thinking in turns gives you a clear place to define what the agent should accomplish, what limits it works within, and how your application handles the result. We'll explore each pillar and the turn in the pages that follow.
Installation
Create a Keel application using your preferred package manager. Zod is a required peer dependency used to define your application’s schemas.
npx @keel-dev/cli@next new my-assistantpnpm dlx @keel-dev/cli@next new my-assistantyarn dlx @keel-dev/cli@next new my-assistantbunx @keel-dev/cli@next new my-assistantThe CLI creates a complete TypeScript app and installs its dependencies.
Run cd my-assistant and npm run dev to open Studio. This preview uses
the next tag. See First steps for the full workflow.
For an existing project, install the framework directly:
npm install @keel-dev/core@next zod@^4Provider SDKs are optional. Install only the ones your application uses:
npm install @anthropic-ai/sdk # Anthropic
npm install openai # OpenAI
npm install @google/genai # Geminipnpm add @anthropic-ai/sdk # Anthropic
pnpm add openai # OpenAI
pnpm add @google/genai # Geminiyarn add @anthropic-ai/sdk # Anthropic
yarn add openai # OpenAI
yarn add @google/genai # Geminibun add @anthropic-ai/sdk # Anthropic
bun add openai # OpenAI
bun add @google/genai # GeminiAlternatives
To explore the framework, the example apps, and Keel Studio together, clone the repository:
git clone https://github.com/devaseel/keel.git
cd keel
pnpm install
pnpm studio # Keel Studio at http://localhost:4180 AND these docs at http://localhost:4190pnpm studio serves both: Keel Studio on the example app at
localhost:4180 and this documentation at
localhost:4190 — there is no separate command to run
for the docs. The examples run on deterministic mock models, so everything
above works with zero API keys.
Next: First steps — run your first turn and watch it cross the gates.
