Zero runtime dependencies · <10KB gzipped
inferface
Ship streaming AI interfaces in minutes, not weeks.
How does useChat work?
$ npx shadcn add https://inferface.dev/registry/use-chatExplore the primitives
Your brand. Your styles.
inferface components accept a classNames prop for granular overrides. Drop-in to any design system.
Summarize this for me
Sure! Here's a concise breakdown of the key points across each section...
Message...
inferface default
<ChatThread
classNames={{
userBubble: "bg-emerald-600",
}}
/>Summarize this for me
Sure! Here's a concise breakdown of the key points across each section...
Message...
Corporate blue
<ChatThread
classNames={{
userBubble: "bg-blue-600",
}}
/>Summarize this for me
Sure! Here's a concise breakdown of the key points across each section...
Message...
Warm amber
<ChatThread
classNames={{
userBubble: "bg-amber-500",
}}
/>Human-in-the-loop, first-class
Most frameworks handle chat. inferface handles the moment the AI asks for permission.
- Pending tool calls surface as typed React components, not raw JSON
- Approve, reject, or modify — your UI, your rules
- Nested tool calls and dependency chains handled automatically
search_web
Pendingquery: "React streaming patterns 2024"
ApproveReject
Built for when things get weird
Mid-stream abort
User cancelled? abort() stops the stream and rolls back state cleanly.
Lost connections
Network hiccup mid-stream? The hook tracks error state so your UI can recover gracefully.
Nested tool calls
When the AI calls a tool that calls another tool, useToolCalls tracks the dependency chain.
Hooks API
| Hook | Description | Key Returns | |
|---|---|---|---|
useStream | Low-level SSE/ReadableStream primitive | content, isStreaming, start, abort, reset | |
useCompletion | Single-turn text completion with streaming | completion, complete, isLoading, abort | |
useChat | Full conversational state with optimistic UI | messages, send, isLoading, streamingContent, regenerate | |
useToolCalls | Parse and manage tool call approval flows | toolCalls, pendingCalls, resolveToolCall, rejectToolCall |