llm-app-architecture

Standardize asynchronous LLM API calls with streaming, retries, and token management.

2|Updated Nov 13, 2025
One-click install
npx skills add https://github.com/ricardoroche/ricardos-claude-code --skill llm-app-architecture
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: llm-app-architecture
Source: https://github.com/ricardoroche/ricardos-claude-code/tree/main/.claude/skills/llm-app-architecture
Command: npx skills add https://github.com/ricardoroche/ricardos-claude-code --skill llm-app-architecture

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

When building LLM-powered applications, follow architecture patterns for reliable async calls, streaming responses, token management, retry logic, and robust error handling.

Core Features & Use Cases

  • Async LLM Calls: Pattern for non-blocking model calls with proper error handling.
  • Streaming Responses: Streaming token-by-token responses to clients.
  • Token Counting & Management: Track and manage tokens and costs.

Quick Start

Create an async LLM client and endpoint that streams responses for a given prompt, with proper error handling and token accounting.

Frequently Asked Questions about llm-app-architecture

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

FAQPage Schema
How do I build async LLM applications that handle streaming responses reliably?

Async LLM applications standardize non-blocking model calls with streaming token delivery, proper error handling, and timeouts. This pattern ensures your app remains responsive while fetching and processing tokens from Claude, OpenAI, or similar APIs without blocking I/O.

What's the best way to implement retry logic for LLM API calls in production?

Retry logic for LLM API calls should handle transient failures with exponential backoff and timeout management. This Skill covers production-grade retry mechanisms that work across Claude, OpenAI, and similar models to ensure robust, maintainable deployments.

How do I track and manage token usage and costs across multiple LLM requests?

Token counting and cost estimation track consumed tokens and associated costs for each request. This approach enables accurate accounting across async calls and streaming responses, supporting budgeting and performance monitoring in production LLM applications.

Can I use async patterns with Claude and OpenAI APIs in the same application?

Yes. This Skill standardizes asynchronous LLM API usage across Claude, OpenAI, and similar model APIs, so a single architecture pattern covers multiple providers with consistent async calls, streaming, retry logic, and error handling.

What error handling should I implement for streaming LLM responses in production?

Robust error handling for streaming responses includes exception handling, timeout management, and graceful degradation. Production-grade deployments require consistent exception patterns across async calls and token delivery to prevent partial or corrupted streamed data.