setup

setup

Setup and configure assistant-ui in a project. Use when installing packages, configuring runtimes, or troubleshooting setup issues.

0bintang
1fork
Diperbarui 1/22/2026
SKILL.md
readonlyread-only
name
setup
description

Setup and configure assistant-ui in a project. Use when installing packages, configuring runtimes, or troubleshooting setup issues.

version
0.0.1

assistant-ui Setup

Always consult assistant-ui.com/llms.txt for latest API.

References

Pick Your Setup

Using Vercel AI SDK?
├─ Yes → useChatRuntime (recommended)
└─ No
   ├─ LangGraph agents? → useLangGraphRuntime
   ├─ AG-UI protocol? → useAgUiRuntime
   ├─ A2A protocol? → useA2ARuntime
   ├─ External state (Redux/Zustand)? → useExternalStoreRuntime
   └─ Custom API → useLocalRuntime

Quick Start (AI SDK)

npm install @assistant-ui/react @assistant-ui/react-ai-sdk @ai-sdk/react ai @ai-sdk/openai
// app/page.tsx
"use client";
import { AssistantRuntimeProvider, Thread } from "@assistant-ui/react";
import { useChatRuntime, AssistantChatTransport } from "@assistant-ui/react-ai-sdk";

export default function Chat() {
  const runtime = useChatRuntime({
    transport: new AssistantChatTransport({ api: "/api/chat" }),
  });

  return (
    <AssistantRuntimeProvider runtime={runtime}>
      <Thread />
    </AssistantRuntimeProvider>
  );
}
// app/api/chat/route.ts
import { openai } from "@ai-sdk/openai";
import { streamText } from "ai";

export async function POST(req: Request) {
  const { messages } = await req.json();
  const result = streamText({ model: openai("gpt-4o"), messages });
  return result.toUIMessageStreamResponse();
}

Styling

// Option 1: Pre-built CSS
import "@assistant-ui/styles/default.css";

// Option 2: Tailwind (add to tailwind.config.js)
content: ["./node_modules/@assistant-ui/react/dist/**/*.js"]

Environment Variables

OPENAI_API_KEY=sk-...
ANTHROPIC_API_KEY=sk-ant-...
NEXT_PUBLIC_ASSISTANT_BASE_URL=https://api.assistant-ui.com  # For cloud

Common Gotchas

"Cannot find module @ai-sdk/react"

npm install @ai-sdk/react

Styles not applied

  • Import CSS at root level or configure Tailwind content paths

Streaming not working

  • Use toUIMessageStreamResponse() in API route
  • Check for CORS errors in console

"runtime is undefined"

  • Call useChatRuntime inside a component, not at module level

You Might Also Like

Related Skills

create-pr

create-pr

170Kdev-devops

Creates GitHub pull requests with properly formatted titles that pass the check-pr-title CI validation. Use when creating PRs, submitting changes for review, or when the user says /pr or asks to create a pull request.

n8n-io avatarn8n-io
Ambil

Guide for performing Chromium version upgrades in the Electron project. Use when working on the roller/chromium/main branch to fix patch conflicts during `e sync --3`. Covers the patch application workflow, conflict resolution, analyzing upstream Chromium changes, and proper commit formatting for patch fixes.

electron avatarelectron
Ambil
pr-creator

pr-creator

92Kdev-devops

Use this skill when asked to create a pull request (PR). It ensures all PRs follow the repository's established templates and standards.

google-gemini avatargoogle-gemini
Ambil
clawdhub

clawdhub

87Kdev-devops

Use the ClawdHub CLI to search, install, update, and publish agent skills from clawdhub.com. Use when you need to fetch new skills on the fly, sync installed skills to latest or a specific version, or publish new/updated skill folders with the npm-installed clawdhub CLI.

moltbot avatarmoltbot
Ambil
tmux

tmux

87Kdev-devops

Remote-control tmux sessions for interactive CLIs by sending keystrokes and scraping pane output.

moltbot avatarmoltbot
Ambil
create-pull-request

create-pull-request

57Kdev-devops

Create a GitHub pull request following project conventions. Use when the user asks to create a PR, submit changes for review, or open a pull request. Handles commit analysis, branch management, and PR creation using the gh CLI tool.

cline avatarcline
Ambil