Svelte Cookbook

An open-source collection of recipes, guides, and templates for building AI applications with Svelte.

Getting Started

Build AI-powered Svelte apps in minutes. Installation, setup, and your first chat.

Learn how to generate text using AI models with simple prompts

Stream Text

Stream text responses in real-time for better user experience

Generate Object

Generate structured data objects with type-safe schemas

Stream Object

Stream structured objects in real-time with progressive updates

Call Tool

Enable AI to call custom tools and functions to perform actions

Call Tool Multiple Steps

Chain multiple tool calls where each step depends on the previous result

Chat with PDFs

Build an AI assistant that can read and answer questions about PDF documents

Send Custom Body

Send additional data alongside chat messages to your API endpoint

Render Visual Interface

Render custom UI components for different tool outputs

Generate Text with Chat Prompt

Generate text using conversational chat prompts for more natural interactions

Stream Text with Chat Prompt

Combine streaming with chat prompts for responsive conversational AI

Markdown Chatbot

Create a chatbot that renders responses in beautiful markdown format