ai-integration

Integrate large language models into production applications with streaming, structured outputs, and cost management.

8|1|Updated Feb 27, 2026
One-click install
npx skills add https://github.com/thesaifalitai/claude-setup --skill ai-integration-thesaifalitai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ai-integration
Source: https://github.com/thesaifalitai/claude-setup/tree/main/skills/ai-integration
Command: npx skills add https://github.com/thesaifalitai/claude-setup --skill ai-integration-thesaifalitai

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides production-ready patterns and recipes to integrate large language models into applications, addressing streaming, structured outputs, retrieval-augmented generation, embeddings, and cost management so teams can avoid common pitfalls and ship reliable AI features faster.

Core Features & Use Cases

  • Streaming & UX: Best practices to stream tokens to the client to keep UIs responsive and avoid blocking.
  • RAG & Embeddings: Examples for indexing, embedding generation, semantic search, and composing context for RAG-based answers.
  • Anthropic-first with fallbacks: Default guidance for Claude/Anthropic APIs with OpenAI fallback, model selection, and structured tool/function outputs.
  • Cost control & observability: Token accounting, pricing calculations, caching, and middleware patterns for cost tracking and alerts.
  • Use Case: Build a streaming chat app that searches a pgvector-backed document store, composes focused context, streams Claude responses, and records token costs per request.

Quick Start

Implement a streaming Claude-based chat endpoint that searches your vector store for context, composes a system prompt, streams tokens to the client, and logs token usage and cost.

Frequently Asked Questions about ai-integration

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I stream LLM responses to a client without blocking the UI?

Streaming LLM responses requires delivering tokens incrementally to the client. This Skill provides patterns for streaming token delivery, keeping UIs responsive by avoiding blocking until full model responses complete.

How do I implement retrieval-augmented generation with a vector store?

Retrieval-augmented generation combines semantic search with LLM prompts. This Skill provides recipes for embedding creation, indexing, and composing focused context from a vector store to generate RAG-based answers.

What's the best way to track token costs for API requests?

Tracking API token costs involves token accounting and pricing calculations per request. This Skill offers middleware patterns for cost tracking, caching, and alerts to manage and observe LLM spending.

Can I use Claude APIs with OpenAI fallback for model availability?

Claude APIs can be configured with OpenAI fallback for reliability. This Skill delivers Anthropic-first guidance with model selection and structured tool outputs, including API fallbacks to prevent downtime.

Do I need a pgvector database to build a streaming chat app?

A pgvector database is used for semantic document search in chat apps. This Skill demonstrates building a streaming chat endpoint that searches a pgvector store, composes context, streams Claude responses, and logs costs.

How do I get structured tool or function outputs from an LLM?

Structured tool or function outputs require specific API configurations for formatted responses. This Skill covers structured outputs and tool use patterns to obtain reliable, formatted function calls from large language models.