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.
00.0 MillionTotal Downloads000,000,000Weekly Downloads0GitHub StarsAG-UI native
portable client and event protocol
Provider adapters
OpenRouter, OpenAI, Anthropic, Gemini
Typed tools
client, server, approvals, media
event
assistant.delta
tool
approval required
provider
OpenRouter
server
TanStack AI
Why AI
A useful AI layer has to cross clients, servers, providers, tools, streaming events, approvals, and observability. AI keeps those seams explicit so teams can swap pieces without rewriting the product.
Clients and servers speak AG-UI-compatible requests and event streams, so teams can own their transport, runtime, and deployment shape.
Use OpenRouter, OpenAI, Anthropic, Gemini, Ollama, Groq, Grok/xAI, ElevenLabs, and fal.ai without making the app proprietary to one vendor.
Define client, server, isomorphic, and provider-native tools with input/output types, approvals, and runtime boundaries that remain visible.
Text, structured output, reasoning streams, image, speech, transcription, realtime voice, and video can share provider-aware primitives.
Headless client or framework hook starts the interaction from your UI.
AG-UI request and event streams keep client/server interop explicit.
Adapters translate into model-specific capabilities and options.
Devtools, middleware, logs, and hooks make the runtime explainable.
Runtime pipeline
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
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.
agent.run({ provider, model, tools })
stream.on("tool.call", requestApproval)
devtools.record(event)
tool approval
pending: chargeCard
stream event
reasoning.delta
structured output
schema matched
media job
image generation complete
Framework adapters
Start from the headless client or use the adapter for your UI runtime. The provider, protocol, tools, and event model stay the same.
Product control
AI should help teams standardize the app layer without flattening provider capabilities or forcing a hosted platform into the critical path.
Open source ecosystem
Maintainers, adapters, examples, partners, and GitHub sponsors keep the SDK honest as models, providers, and app expectations keep changing.