vercel · Vercel AI SDK Docs
AI SDK Getting Started: Svelte
Initial setup and integration of the AI SDK within a Svelte application environment.
Derived skill
Files assembled from official documentation
Viewing SKILL.md
AI SDK Getting Started: Svelte
Initial setup and integration of the AI SDK within a Svelte application environment.
When To Use
Use when you need to configure and initialize the AI SDK to work with Svelte components and state management.
Reference Files
| File | Contains | Use For |
|---|---|---|
SKILL.md | Entry point: scope, routing table, and workflow. | Start here. |
docs/ai-sdk-getting-started-svelte-workflow-guide.md | A guide for setting up the Vercel AI SDK in a Svelte application, including API route creation and provider configuration. | Questions about a guide for setting up the Vercel AI SDK in a Svelte application, including API route creation and provider configura... |
examples/ai-sdk-getting-started-svelte-ai-sdk-svelte-getting-started-env-variable.text | An example of the AI_GATEWAY_API_KEY environment variable configuration for the AI SDK Svelte getting started guide. | Exact payloads, commands, or snippets shown in An example of the AIGATEWAYAPIKEY environment variable configuration for the AI SDK Svelte getting started guide. |
examples/ai-sdk-getting-started-svelte-ai-sdk-svelte-streamtext-post-route.text | A SvelteKit server-side POST route implementation using the AI SDK to stream text responses via a gateway. | Exact payloads, commands, or snippets shown in A SvelteKit server-side POST route implementation using the AI SDK to stream text responses via a gateway. |
examples/ai-sdk-getting-started-svelte-ai-sdk-svelte-getting-started.text | A basic implementation example of the AI SDK within a Svelte application. | Exact payloads, commands, or snippets shown in A basic implementation example of the AI SDK within a Svelte application. |
examples/ai-sdk-getting-started-svelte-ai-sdk-svelte-gateway-import-options.text | Code examples demonstrating different methods to import the gateway function from the ai and @ai-sdk/gateway packages in a Svelte environment. | Exact payloads, commands, or snippets shown in Code examples demonstrating different methods to import the gateway function from the ai and @ai-sdk/gateway packages... |
examples/ai-sdk-getting-started-svelte-ai-sdk-svelte-openai-model-setup.text | A code snippet demonstrating how to initialize an OpenAI model instance within a Svelte application using the AI SDK. | Exact payloads, commands, or snippets shown in A code snippet demonstrating how to initialize an OpenAI model instance within a Svelte application using the AI SDK. |
examples/ai-sdk-getting-started-svelte-ai-sdk-svelte-chat-component-implementatio.text | A Svelte component implementation demonstrating the use of the Chat class from @ai-sdk/svelte to manage message history and user input. | Exact payloads, commands, or snippets shown in A Svelte component implementation demonstrating the use of the Chat class from @ai-sdk/svelte to manage message histo... |
examples/ai-sdk-getting-started-svelte-ai-sdk-svelte-stream-text-route-handler.text | A SvelteKit POST route handler implementation using the AI SDK to stream text responses via a gateway. | Exact payloads, commands, or snippets shown in A SvelteKit POST route handler implementation using the AI SDK to stream text responses via a gateway. |
examples/ai-sdk-getting-started-svelte-ai-sdk-svelte-chat-component.text | A Svelte component implementation demonstrating how to use the Chat class from @ai-sdk/svelte to manage message history and user input. | Exact payloads, commands, or snippets shown in A Svelte component implementation demonstrating how to use the Chat class from @ai-sdk/svelte to manage message histo... |
examples/ai-sdk-getting-started-svelte-ai-sdk-svelte-post-route-stream.text | A SvelteKit server-side POST route implementation using the AI SDK to stream text responses. | Exact payloads, commands, or snippets shown in A SvelteKit server-side POST route implementation using the AI SDK to stream text responses. |
examples/ai-sdk-getting-started-svelte-ai-sdk-svelte-post-route-stream-2.text | A SvelteKit server-side POST route implementation using the AI SDK to stream text responses via a gateway. | Exact payloads, commands, or snippets shown in A SvelteKit server-side POST route implementation using the AI SDK to stream text responses via a gateway. |
examples/ai-sdk-getting-started-svelte-ai-sdk-svelte-chat-component-implementatio-2.text | A Svelte component implementation demonstrating how to use the Chat class from @ai-sdk/svelte to manage message state and user input. | Exact payloads, commands, or snippets shown in A Svelte component implementation demonstrating how to use the Chat class from @ai-sdk/svelte to manage message state... |
examples/ai-sdk-getting-started-svelte-ai-sdk-svelte-chat-component-reactive-prop.text | A code example demonstrating how to pass reactive props to the Chat class in Svelte to ensure the chat instance updates when the ID changes. | Exact payloads, commands, or snippets shown in A code example demonstrating how to pass reactive props to the Chat class in Svelte to ensure the chat instance updat... |
examples/ai-sdk-getting-started-svelte-ai-sdk-svelte-getting-started-2.text | A basic implementation example of the AI SDK within a Svelte application. | Exact payloads, commands, or snippets shown in A basic implementation example of the AI SDK within a Svelte application. |
examples/ai-sdk-getting-started-svelte-ai-sdk-svelte-chat-component-implementatio-3.text | A Svelte code example demonstrating how to initialize and use the Chat component from the AI SDK. | Exact payloads, commands, or snippets shown in A Svelte code example demonstrating how to initialize and use the Chat component from the AI SDK. |
examples/ai-sdk-getting-started-svelte-ai-sdk-svelte-createaicontext-setup.text | A Svelte implementation demonstrating how to initialize the AI SDK context using createAIContext. | Exact payloads, commands, or snippets shown in A Svelte implementation demonstrating how to initialize the AI SDK context using createAIContext. |
What This Skill Covers
- The AI SDK is a powerful TypeScript library designed to help developers build AI-powered applications.
- Main sections:
Prerequisites,Set Up Your Application,Create an API route,Choosing a Provider,Using other providers.
Workflow
- Open the most relevant file under
docs/for the exact documented workflow and wording. - Open
schemas/files for exact structured contracts. - Open
examples/files for concrete requests, commands, snippets, and manifests. - Do not add behavior or configuration that is not present in the attached source files.
Canonical source: https://ai-sdk.dev/docs/getting-started/svelte