Open AI application SDK
Own the AI stack between your UI and your models.
AI is an open-source SDK for building provider-portable AI features with AG-UI-compatible clients, server helpers, typed tools, media generation, and observable runtime primitives without a hosted gateway in the middle.
1.0 MillionTotal Downloads108,698Weekly Downloads2,884GitHub Stars
AG-UI native
portable client and event protocol
Provider adapters
OpenRouter, OpenAI, Anthropic, Gemini
Typed tools
client, server, approvals, media
Why AI
AI apps need protocols and boundaries, not another black box.
A useful AI layer has to cross clients, servers, providers, tools, streaming events, approvals, and observability. AI keeps those boundaries explicit so teams can swap pieces without rewriting the product.
Protocol first, gateway never required.
Clients and servers speak AG-UI-compatible requests and event streams, so teams can own their transport, runtime, and deployment shape.
Providers are adapters, not the architecture.
Use OpenRouter, OpenAI, Anthropic, Gemini, Ollama, Groq, Grok/xAI, ElevenLabs, and fal.ai without making the app proprietary to one vendor.
Tools stay typed where they run.
Define client, server, isomorphic, and provider-native tools with input/output types, approvals, and runtime boundaries that remain visible.
Media is part of the same SDK story.
Text, structured output, reasoning streams, image, speech, transcription, realtime voice, and video can share provider-aware primitives.
1
Client
Headless client or framework hook starts the interaction from your UI.
2
Protocol
AG-UI request and event streams keep client/server interop explicit.
3
Provider
Adapters translate into model-specific capabilities and options.
4
Observe
Devtools, middleware, logs, and hooks make the runtime explainable.
Runtime pipeline
From UI intent to model output, every hop stays visible.
AI features are distributed systems wearing a chat box. The SDK gives each hop a typed place to live so the app can stream, tool call, approve, retry, observe, and render intentionally.
Observable runtime
Debug the interaction, not just the final answer.
Tool calls, approvals, model options, provider events, structured output, middleware, and media jobs all need to be inspectable if the feature is going to be operated with confidence.
const { messages, addToolApprovalResponse } = useChat({
connection: fetchServerSentEvents("/api/chat"),
tools,
devtools: { name: "Support Chat" }
})
tool approval
pending: chargeCard
stream event
reasoning.delta
structured output
schema matched
media job
image generation complete
Framework adapters
Headless core, renderer-specific ergonomics.
Start from the headless client or use the adapter for your UI runtime. The provider, protocol, tools, and event model stay the same.
ReactVueSolidSveltePreactVanilla
Product control
Bring your providers, servers, and product constraints.
AI should help teams standardize the app layer without flattening provider capabilities or forcing a hosted platform into the critical path.
Open source ecosystem
AI stays useful by staying close to real product work.
Maintainers, adapters, examples, partners, and GitHub sponsors keep the SDK honest as models, providers, and app expectations keep changing.
Maintainers
Partners
AI You?
We're looking for
TanStack AI
Partners to join our mission! Partner with us to push the boundaries of
TanStack AI
and build amazing things together.
Only one thing left to do...