FEATURES / AI STREAMING
AI-native
endpoints.
Vercel AI SDK on the client, Anthropic by default on the server, streaming via Server-Sent Events. Drop in your own provider, agent, or RAG layer behind one port.
Streaming, tools, structured output.
IAIProvider port
streamText, generateObject, useTools. Adapters for Anthropic and OpenAI. Add yours with one file.
SSE streaming
Server-Sent Events from Express to the AI SDK on the client. Token-by-token delivery, cancellable on unmount.
Tool calling
Define tools server-side with Zod schemas; the AI SDK on the client renders tool invocations and results inline.
Structured output
generateObject + Zod schema = type-safe AI responses your domain layer can consume directly.
Token budgeting
Per-org token quotas enforced before the request hits the provider. Quota stored in the read model.
Provider failover
Optional fallback chain: Anthropic → OpenAI → null. Set per env. Errors logged with provider attribution.
Streaming AI, in production.
Skip the SSE plumbing and start shipping agentic features.