Basic Setup Guide
Step 1: Installing Svelte
Create a new SvelteKit project with TypeScript and Tailwind CSS.
When prompted, select the following options:
- Which template? → SvelteKit minimal
- Add type checking? → Yes, using TypeScript
- Add additional options? → Add Tailwind CSS
Step 2: Installing shadcn-svelte
Configure components.json with the following settings:
Step 3: OpenRouter Setup
OpenRouter provides free access to multiple AI models through a single API. Generate API Key
.env.local
Step 4: AI SDK Integration
Install the Vercel AI SDK and OpenRouter provider to enable streaming AI responses:
Create an AI configuration file to manage your AI settings:
src/lib/ai-config.ts
Step 5: Add Components
Svelte AI Elements provides pre-built components for common AI patterns.
Let's add the Message component to your project: