Integrating LLMs into products — model routing and fallbacks, structured outputs and tool calling, streaming, timeouts and retries, prompt caching, token budgets and cost controls, observability of AI calls, data governance with providers, human-in-the-loop design. Use to build AI-powered features (LLM, AI feature, tool calling, streaming, model routing, cost control).
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Llm Integration?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/vectora-os-llm-integration)
---
name: llm-integration
description: Integrating LLMs into products — model routing and fallbacks, structured outputs and tool calling, streaming, timeouts and retries, prompt caching, token budgets and cost controls, observability of AI calls, data governance with providers, human-in-the-loop design. Use to build AI-powered features (LLM, AI feature, tool calling, streaming, model routing, cost control).
metadata:
category: ai
---
# LLM integration
## Purpose
Ship AI features that are reliable, observable and affordable.
**Use when:** building or changing AI product features.
**Not for:** training models (`ml-engineering`).
## Inputs
- Use case, eval set, budgets.
## Outputs
- Integration design and code, cost and latency report.
## Read first
- [Project Brain](../../../project-brain/README.md) — `npm run brain -- query "llm integration"` for prior decisions, patterns and anti-patterns.
- [AI feature review checklist](../../../checklists/ai-feature-review.md)
- [Model usage policy](../../../policies/model-usage.md)
## Steps
1. **Design.** Define flow: prompts, tools, retrieval, human checkpoints.
Done when flow documented.
2. **Robustness.** Timeouts, retries, fallback model or degraded mode; validate structured outputs.
Done when failures handled.
3. **Cost.** Token budgets, caching, routing cheap-first with escalation.
Done when cost per request measured.
4. **Observe.** Log prompts/outputs safely (no PII), latency, tokens, eval scores.
Done when dashboards exist.
## Best practices
- Cheap model first, escalate on low confidence.
- Human approval for consequential actions.
## Common mistakes
- Unvalidated model output driving actions.
- Sending personal data to providers without approval.
## Example
Ticket triage: small model with JSON schema, escalate to frontier when confidence < 0.7; p95 900 ms; cost -65%.
## Reusable prompt
```text
Apply the LLM integration skill (.agents/skills/llm-integration/SKILL.md).
Context: {{task card or question; links to PRD, ADRs, code paths}}
Constraints: {{approved thresholds, deadlines, allowed files}}
Design the AI flow with robustness, cost controls and observability, and report measured cost and latency.
Return: Integration design and code, cost and latency report..
Cite evidence (file:line, command output, source) for every claim; list open questions separately.
```