integrating-ai
Installation
SKILL.md
Integrating AI (Vercel AI SDK & Ollama)
When to use this skill
- When the user mentions "AI", "LLM", "Chatbot", "GPT", or "Ollama".
- When building features like "Explain this", "Generate text", or "Chat with PDF".
- When implementing streaming text responses.
Workflow
- Installation:
npm install ai @ai-sdk/openai @ai-sdk/anthropic ollama-ai-provider
- Backend Route (Edge/Serverless):
- Create an API route using
streamTextfromai.
- Create an API route using
- Frontend Hook:
- Use
useChatoruseCompletionfromai/reactto handle UI state automatically.
- Use