llm-integration

Integrate LLM APIs into production applications with streaming, cost control, and fallbacks.

15|3|Updated Jul 9, 2026
One-click install
npx skills add https://github.com/kiurakku/cursor-kit-for-ai --skill llm-integration-kiurakku
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: llm-integration
Source: https://github.com/kiurakku/cursor-kit-for-ai/tree/main/plugins/ai/skills/llm-integration
Command: npx skills add https://github.com/kiurakku/cursor-kit-for-ai --skill llm-integration-kiurakku

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Wiring an LLM API into a real application introduces failure modes that normal API integration does not: nondeterministic output, per-token billing, long streaming responses, rate limits, and untrusted generated content. This Skill provides the production playbook for handling all of them before the invoice or the outage teaches you. ## Core Features & Use Cases - Client Layer Hardening: Generation-sized timeouts, jittered retries on 429/5xx, client-side rate limiting, pinned model versions, and server-side key management. - Cost Control: Per-call token metering tagged by feature and tenant, prompt caching on stable prefixes, response caching, per-task max_tokens, and enforced budget caps. - Safety & Resilience: Schema validation with corrective retry, sandboxing of LLM output, circuit breakers, cross-provider fallback plans, and monitoring dashboards for latency, errors, and cost anomalies. - Use Case: You are shipping a support-chat feature on Claude. Use this Skill to set up streaming with per-chunk timeouts, cache the system prompt, meter cost per tenant, and define a fallback model for provider outages. ## Quick Start Use the llm-integration skill to review my LLM API wrapper and produce a production ship checklist covering streaming, cost metering, and fallback behavior.

Frequently Asked Questions about llm-integration

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

FAQPage Schema
How do I integrate an LLM API into a production application?▼

Build one wrapper module per provider with generation-sized timeouts (60-120s reads), jittered retries on 429/5xx, client-side rate limiting, and a pinned model version. Validate all structured output against a schema and meter token cost per call from day one.

How do I reduce LLM API costs in production?▼

Meter input and output tokens per call tagged by feature and tenant, trim system prompts and conversation history, enable prompt caching on stable prefixes, cache repeated responses by prompt hash, and set max_tokens per task. Enforce per-user daily caps and per-feature budget alerts in code.

Should I stream LLM responses to users?▼

Yes, stream anything user-facing since time-to-first-token defines perceived latency. Use per-chunk idle timeouts rather than total timeouts, buffer server-side for parsing while streaming to the client, and show honest progress for multi-step agent flows.

Is it safe to execute LLM-generated code or SQL?▼

No, never exec or eval LLM output outside a sandbox, and never interpolate it into SQL, shell, or HTML unescaped. LLM output downstream of user input is untrusted input; validate structured outputs against a schema with one corrective retry before falling back.

What happens when my LLM provider goes down?▼

Decide outage behavior per feature in advance: queue-and-retry for batch jobs, a fallback model possibly cross-provider for core user-facing paths, or a feature flag with honest UI for nice-to-haves. Add a circuit breaker so a slow provider does not pin all workers.