anth-architecture-variants
Choose and implement Claude API architecture patterns for different scales: serverless, microservice, event-driven, and edge deployment. Trigger with phrases like "anthropic architecture", "claude serverless", "claude microservice design", "edge claude deployment".
Best use case
anth-architecture-variants is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Choose and implement Claude API architecture patterns for different scales: serverless, microservice, event-driven, and edge deployment. Trigger with phrases like "anthropic architecture", "claude serverless", "claude microservice design", "edge claude deployment".
Teams using anth-architecture-variants should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/anth-architecture-variants/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How anth-architecture-variants Compares
| Feature / Agent | anth-architecture-variants | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Choose and implement Claude API architecture patterns for different scales: serverless, microservice, event-driven, and edge deployment. Trigger with phrases like "anthropic architecture", "claude serverless", "claude microservice design", "edge claude deployment".
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
Best AI Skills for Claude
Explore the best AI skills for Claude and Claude Code across coding, research, workflow automation, documentation, and agent operations.
ChatGPT vs Claude for Agent Skills
Compare ChatGPT and Claude for AI agent skills across coding, writing, research, and reusable workflow execution.
SKILL.md Source
# Anthropic Architecture Variants
## Overview
Four validated architecture patterns for Claude API integrations at different scales and use cases.
## Variant 1: Serverless (AWS Lambda / Cloud Functions)
```python
# Best for: < 100 RPM, event-driven, pay-per-invocation
# lambda_function.py
import anthropic
import json
def handler(event, context):
client = anthropic.Anthropic() # Key from Lambda env var
body = json.loads(event["body"])
msg = client.messages.create(
model="claude-haiku-4-20250514", # Haiku for Lambda speed
max_tokens=512,
messages=[{"role": "user", "content": body["prompt"]}]
)
return {
"statusCode": 200,
"body": json.dumps({
"text": msg.content[0].text,
"tokens": msg.usage.input_tokens + msg.usage.output_tokens
})
}
```
**Trade-offs:** Cold starts add 1-3s. Lambda timeout (15min) limits long generations. No connection pooling between invocations.
## Variant 2: Streaming Microservice (FastAPI + WebSocket)
```python
# Best for: chatbots, interactive UIs, real-time responses
from fastapi import FastAPI, WebSocket
import anthropic
app = FastAPI()
client = anthropic.Anthropic()
@app.websocket("/chat")
async def chat_ws(websocket: WebSocket):
await websocket.accept()
while True:
prompt = await websocket.receive_text()
with client.messages.stream(
model="claude-sonnet-4-20250514",
max_tokens=2048,
messages=[{"role": "user", "content": prompt}]
) as stream:
for text in stream.text_stream:
await websocket.send_text(text)
await websocket.send_text("[DONE]")
```
## Variant 3: Queue-Based Pipeline (Celery / Cloud Tasks)
```python
# Best for: batch processing, async workflows, high volume
from celery import Celery
import anthropic
app = Celery("tasks", broker="redis://localhost")
@app.task(bind=True, max_retries=3, default_retry_delay=30)
def process_document(self, doc_id: str, content: str):
try:
client = anthropic.Anthropic()
msg = client.messages.create(
model="claude-sonnet-4-20250514",
max_tokens=2048,
messages=[{"role": "user", "content": f"Summarize:\n\n{content}"}]
)
save_result(doc_id, msg.content[0].text)
except anthropic.RateLimitError as e:
self.retry(exc=e, countdown=int(e.response.headers.get("retry-after", 30)))
```
## Variant 4: Multi-Model Orchestrator
```python
# Best for: complex workflows needing different model strengths
class ClaudeOrchestrator:
def __init__(self):
self.client = anthropic.Anthropic()
def classify_then_respond(self, user_input: str) -> str:
# Step 1: Classify intent with Haiku (fast, cheap)
classification = self.client.messages.create(
model="claude-haiku-4-20250514",
max_tokens=32,
messages=[{
"role": "user",
"content": f"Classify as: question|task|creative|code\nInput: {user_input[:200]}"
}]
)
intent = classification.content[0].text.strip().lower()
# Step 2: Route to optimal model
model = {
"question": "claude-haiku-4-20250514",
"task": "claude-sonnet-4-20250514",
"creative": "claude-sonnet-4-20250514",
"code": "claude-sonnet-4-20250514",
}.get(intent, "claude-sonnet-4-20250514")
# Step 3: Generate response
msg = self.client.messages.create(
model=model,
max_tokens=4096,
messages=[{"role": "user", "content": user_input}]
)
return msg.content[0].text
```
## Architecture Selection Guide
| Factor | Serverless | Microservice | Queue-Based | Orchestrator |
|--------|-----------|-------------|-------------|-------------|
| Latency | High (cold start) | Low (streaming) | N/A (async) | Medium |
| Volume | Low (<100 RPM) | Medium | High | Medium |
| Cost | Pay-per-use | Fixed infra | Batch savings | Optimized per-task |
| Complexity | Low | Medium | Medium | High |
| Best for | APIs, triggers | Chatbots | ETL, processing | Complex workflows |
## Resources
- [API Getting Started](https://docs.anthropic.com/en/api/getting-started)
- [Streaming](https://docs.anthropic.com/en/api/messages-streaming)
- [Batches](https://docs.anthropic.com/en/api/creating-message-batches)
## Next Steps
For common pitfalls, see `anth-known-pitfalls`.Related Skills
workhuman-reference-architecture
Workhuman reference architecture for employee recognition and rewards API. Use when integrating Workhuman Social Recognition, or building recognition workflows with HRIS systems. Trigger: "workhuman reference architecture".
wispr-reference-architecture
Wispr Flow reference architecture for voice-to-text API integration. Use when integrating Wispr Flow dictation, WebSocket streaming, or building voice-powered applications. Trigger: "wispr reference architecture".
windsurf-reference-architecture
Implement Windsurf reference architecture with optimal project structure and AI configuration. Use when designing workspace configuration for Windsurf, setting up team standards, or establishing architecture patterns that maximize Cascade effectiveness. Trigger with phrases like "windsurf architecture", "windsurf project structure", "windsurf best practices", "windsurf team setup", "optimize for cascade".
windsurf-architecture-variants
Choose workspace architectures for different project scales in Windsurf. Use when deciding how to structure Windsurf workspaces for monorepos, multi-service setups, or polyglot codebases. Trigger with phrases like "windsurf workspace strategy", "windsurf monorepo", "windsurf project layout", "windsurf multi-service", "windsurf workspace size".
webflow-reference-architecture
Implement Webflow reference architecture — layered project structure, client wrapper, CMS sync service, webhook handlers, and caching layer for production integrations. Trigger with phrases like "webflow architecture", "webflow project structure", "how to organize webflow", "webflow integration design", "webflow best practices".
vercel-reference-architecture
Implement a Vercel reference architecture with layered project structure and best practices. Use when designing new Vercel projects, reviewing project structure, or establishing architecture standards for Vercel applications. Trigger with phrases like "vercel architecture", "vercel project structure", "vercel best practices layout", "how to organize vercel project".
vercel-architecture-variants
Choose and implement Vercel architecture blueprints for different scales and use cases. Use when designing new Vercel projects, choosing between static, serverless, and edge architectures, or planning how to structure a multi-project Vercel deployment. Trigger with phrases like "vercel architecture", "vercel blueprint", "how to structure vercel", "vercel monorepo", "vercel multi-project".
veeva-reference-architecture
Veeva Vault reference architecture for REST API and clinical operations. Use when working with Veeva Vault document management and CRM. Trigger: "veeva reference architecture".
vastai-reference-architecture
Implement Vast.ai reference architecture for GPU compute workflows. Use when designing ML training pipelines, structuring GPU orchestration, or establishing architecture patterns for Vast.ai applications. Trigger with phrases like "vastai architecture", "vastai design pattern", "vastai project structure", "vastai ml pipeline".
twinmind-reference-architecture
Production architecture for meeting AI systems using TwinMind: transcription pipeline, memory vault, action item workflow, and calendar integration. Use when implementing reference architecture, or managing TwinMind meeting AI operations. Trigger with phrases like "twinmind reference architecture", "twinmind reference architecture".
together-reference-architecture
Together AI reference architecture for inference, fine-tuning, and model deployment. Use when working with Together AI's OpenAI-compatible API. Trigger: "together reference architecture".
techsmith-reference-architecture
TechSmith reference architecture for Snagit COM API and Camtasia automation. Use when working with TechSmith screen capture and video editing automation. Trigger: "techsmith reference architecture".