AI Kit
AI Kit is a modular toolkit for building AI-powered applications. It provides framework-agnostic core primitives plus framework-specific bindings for React, Vue, Svelte, and Next.js.
Package Architecture
@ainative/ai-kit-core ← Framework-agnostic core
├── @ainative/ai-kit ← React hooks & components
├── @ainative/ai-kit-vue ← Vue 3 composables
├── @ainative/ai-kit-svelte ← Svelte stores
├── @ainative/ai-kit-nextjs ← Next.js utilities
├── @ainative/ai-kit-safety ← Prompt injection, PII, moderation
├── @ainative/ai-kit-rlhf ← Human feedback collection
├── @ainative/ai-kit-auth ← Authentication integration
├── @ainative/ai-kit-zerodb ← ZeroDB vector storage
├── @ainative/ai-kit-tools ← Built-in agent tools
├── @ainative/ai-kit-observability ← Usage tracking & cost alerts
├── @ainative/ai-kit-video ← Video recording & transcription
├── @ainative/ai-kit-design-system ← Design tokens & theming
└── @ainative/ai-kit-cli ← Scaffold new projects
Quick Start
# Scaffold a new AI Kit project
npx @ainative/ai-kit-cli create my-ai-app
# Or install individual packages
npm install @ainative/ai-kit-core @ainative/ai-kit
Core Concepts
Streaming
AI Kit Core provides a universal streaming layer that works across frameworks:
import { createStreamingResponse } from '@ainative/ai-kit-core';
const stream = createStreamingResponse({
provider: 'ainative',
model: 'meta-llama/llama-3.3-70b-instruct',
messages: [{ role: 'user', content: 'Hello' }],
});
for await (const chunk of stream) {
console.log(chunk.content);
}
Agent Orchestration
Build agents with tool calling and streaming:
import { Agent, AgentExecutor } from '@ainative/ai-kit-core';
const agent = new Agent({
name: 'assistant',
model: 'meta-llama/llama-3.3-70b-instruct',
tools: [searchTool, calculatorTool],
});
const executor = new AgentExecutor(agent);
const result = await executor.run('What is the population of Tokyo?');
Packages
| Package | Install | Description |
|---|---|---|
ai-kit-core | npm i @ainative/ai-kit-core | Streaming, agents, state management |
ai-kit | npm i @ainative/ai-kit | React hooks and UI components |
ai-kit-vue | npm i @ainative/ai-kit-vue | Vue 3 composables |
ai-kit-svelte | npm i @ainative/ai-kit-svelte | Svelte stores and actions |
ai-kit-nextjs | npm i @ainative/ai-kit-nextjs | Next.js App Router utilities |
ai-kit-safety | npm i @ainative/ai-kit-safety | Content safety and moderation |
ai-kit-observability | npm i @ainative/ai-kit-observability | Usage tracking and cost alerts |
ai-kit-rlhf | npm i @ainative/ai-kit-rlhf | RLHF feedback collection |
ai-kit-auth | npm i @ainative/ai-kit-auth | Authentication integration |
ai-kit-zerodb | npm i @ainative/ai-kit-zerodb | ZeroDB vector storage hooks |
ai-kit-tools | npm i @ainative/ai-kit-tools | Built-in agent tools |
ai-kit-video | npm i @ainative/ai-kit-video | Video recording and transcription |
ai-kit-design-system | npm i @ainative/ai-kit-design-system | Design tokens and theming |
ai-kit-cli | npx @ainative/ai-kit-cli | Project scaffolding CLI |
Next Steps
- Core — Streaming, agents, and state management
- React — Hooks and components
- Safety — Content moderation and PII detection
- Observability — Usage tracking and cost alerts