assemblyai-performance-tuning
Optimize AssemblyAI API performance with caching, parallel processing, and model selection. Use when experiencing slow transcriptions, implementing caching strategies, or optimizing throughput for batch transcription workloads. Trigger with phrases like "assemblyai performance", "optimize assemblyai", "assemblyai latency", "assemblyai caching", "assemblyai slow", "assemblyai batch".
Best use case
assemblyai-performance-tuning is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Optimize AssemblyAI API performance with caching, parallel processing, and model selection. Use when experiencing slow transcriptions, implementing caching strategies, or optimizing throughput for batch transcription workloads. Trigger with phrases like "assemblyai performance", "optimize assemblyai", "assemblyai latency", "assemblyai caching", "assemblyai slow", "assemblyai batch".
Teams using assemblyai-performance-tuning 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/assemblyai-performance-tuning/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How assemblyai-performance-tuning Compares
| Feature / Agent | assemblyai-performance-tuning | 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?
Optimize AssemblyAI API performance with caching, parallel processing, and model selection. Use when experiencing slow transcriptions, implementing caching strategies, or optimizing throughput for batch transcription workloads. Trigger with phrases like "assemblyai performance", "optimize assemblyai", "assemblyai latency", "assemblyai caching", "assemblyai slow", "assemblyai batch".
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
AI Agents for Coding
Browse AI agent skills for coding, debugging, testing, refactoring, code review, and developer workflows across Claude, Cursor, and Codex.
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
# AssemblyAI Performance Tuning
## Overview
Optimize AssemblyAI transcription performance through model selection, parallel processing, caching, and webhook-based architectures.
## Prerequisites
- `assemblyai` package installed
- Understanding of async patterns
- Redis or in-memory cache available (optional)
## Latency Benchmarks (Actual)
### Async Transcription
| Audio Duration | Approx. Processing Time | Notes |
|----------------|------------------------|-------|
| 30 seconds | ~10-15 seconds | Includes queue time |
| 5 minutes | ~30-60 seconds | Scales sub-linearly |
| 1 hour | ~3-5 minutes | Depends on queue load |
| 10 hours | ~15-30 minutes | Max async duration |
### Streaming
| Metric | Value |
|--------|-------|
| First partial transcript | ~300ms (P50) |
| Final transcript latency | ~500ms (P50) |
| End-of-turn detection | Automatic with endpointing |
### Model Speed vs. Accuracy
| Model | Speed | Accuracy | Price/hr |
|-------|-------|----------|----------|
| `nano` | Fastest | Good | $0.12 |
| `best` (Universal-3) | Standard | Highest | $0.37 |
| `nova-3` (streaming) | Real-time | High | $0.47 |
| `nova-3-pro` (streaming) | Real-time | Highest | $0.47 |
## Instructions
### Step 1: Choose the Right Model
```typescript
import { AssemblyAI } from 'assemblyai';
const client = new AssemblyAI({
apiKey: process.env.ASSEMBLYAI_API_KEY!,
});
// For highest accuracy (default)
const accurate = await client.transcripts.transcribe({
audio: audioUrl,
speech_model: 'best',
});
// For fastest processing and lowest cost
const fast = await client.transcripts.transcribe({
audio: audioUrl,
speech_model: 'nano',
});
```
### Step 2: Parallel Batch Processing
```typescript
import PQueue from 'p-queue';
const queue = new PQueue({ concurrency: 10 });
async function batchTranscribe(audioUrls: string[]) {
const results = await Promise.all(
audioUrls.map(url =>
queue.add(() =>
client.transcripts.transcribe({ audio: url, speech_model: 'nano' })
)
)
);
return results.filter(t => t.status === 'completed');
}
// Process 100 files with 10 concurrent jobs
const urls = Array.from({ length: 100 }, (_, i) => `https://storage.example.com/audio-${i}.mp3`);
const transcripts = await batchTranscribe(urls);
console.log(`Completed: ${transcripts.length}/${urls.length}`);
```
### Step 3: Use Webhooks Instead of Polling
```typescript
// SLOW: transcribe() polls every 3 seconds until done
const slow = await client.transcripts.transcribe({ audio: audioUrl });
// FAST: submit() returns immediately, webhook notifies on completion
const fast = await client.transcripts.submit({
audio: audioUrl,
webhook_url: 'https://your-app.com/webhooks/assemblyai',
});
// Your webhook handler processes the result — no polling overhead
```
### Step 4: Cache Transcript Results
```typescript
import { LRUCache } from 'lru-cache';
import type { Transcript } from 'assemblyai';
const transcriptCache = new LRUCache<string, Transcript>({
max: 500,
ttl: 60 * 60 * 1000, // 1 hour
});
async function getCachedTranscript(transcriptId: string): Promise<Transcript> {
const cached = transcriptCache.get(transcriptId);
if (cached) return cached;
const transcript = await client.transcripts.get(transcriptId);
if (transcript.status === 'completed') {
transcriptCache.set(transcriptId, transcript);
}
return transcript;
}
```
### Step 5: Redis Cache for Distributed Systems
```typescript
import Redis from 'ioredis';
const redis = new Redis(process.env.REDIS_URL!);
async function getCachedTranscriptRedis(transcriptId: string): Promise<Transcript> {
const cached = await redis.get(`transcript:${transcriptId}`);
if (cached) return JSON.parse(cached);
const transcript = await client.transcripts.get(transcriptId);
if (transcript.status === 'completed') {
await redis.setex(
`transcript:${transcriptId}`,
3600, // 1 hour TTL
JSON.stringify(transcript)
);
}
return transcript;
}
```
### Step 6: Minimize Feature Overhead
```typescript
// Only enable features you actually need — each adds processing time
// Minimal (fastest)
const minimal = await client.transcripts.transcribe({
audio: audioUrl,
speech_model: 'nano',
punctuate: true,
format_text: true,
});
// Full intelligence (slower, more expensive)
const full = await client.transcripts.transcribe({
audio: audioUrl,
speech_model: 'best',
speaker_labels: true,
sentiment_analysis: true,
entity_detection: true,
auto_highlights: true,
content_safety: true,
iab_categories: true,
summarization: true,
summary_type: 'bullets',
});
```
### Step 7: Performance Monitoring
```typescript
async function timedTranscribe(audioUrl: string, options: Record<string, any> = {}) {
const start = Date.now();
const transcript = await client.transcripts.transcribe({
audio: audioUrl,
...options,
});
const durationMs = Date.now() - start;
const stats = {
transcriptId: transcript.id,
status: transcript.status,
audioDuration: transcript.audio_duration,
processingTimeMs: durationMs,
ratio: transcript.audio_duration
? (durationMs / 1000 / transcript.audio_duration).toFixed(2)
: 'N/A',
wordCount: transcript.words?.length ?? 0,
model: options.speech_model ?? 'best',
};
console.log('Transcription stats:', stats);
return { transcript, stats };
}
```
## Output
- Optimal model selection based on speed/accuracy/cost trade-offs
- Parallel batch processing with concurrency control
- Webhook-based architecture (eliminates polling overhead)
- In-memory and Redis caching for transcript retrieval
- Performance monitoring with processing time ratios
## Error Handling
| Issue | Cause | Solution |
|-------|-------|----------|
| Slow transcription | Large file + best model | Use `nano` model or split audio |
| Queue backlog | Too many concurrent submissions | Limit concurrency with p-queue |
| Cache stale data | Transcript re-processed | Set appropriate TTL, invalidate on webhook |
| Polling overhead | Using `transcribe()` for many files | Switch to `submit()` + webhooks |
## Resources
- [AssemblyAI Speech Models](https://www.assemblyai.com/docs/speech-to-text/speech-recognition)
- [AssemblyAI Processing FAQ](https://www.assemblyai.com/docs/concepts/faq)
- [LRU Cache](https://github.com/isaacs/node-lru-cache)
- [p-queue](https://github.com/sindresorhus/p-queue)
## Next Steps
For cost optimization, see `assemblyai-cost-tuning`.Related Skills
running-performance-tests
Execute load testing, stress testing, and performance benchmarking. Use when performing specialized testing. Trigger with phrases like "run load tests", "test performance", or "benchmark the system".
workhuman-performance-tuning
Workhuman performance tuning for employee recognition and rewards API. Use when integrating Workhuman Social Recognition, or building recognition workflows with HRIS systems. Trigger: "workhuman performance tuning".
workhuman-cost-tuning
Workhuman cost tuning for employee recognition and rewards API. Use when integrating Workhuman Social Recognition, or building recognition workflows with HRIS systems. Trigger: "workhuman cost tuning".
wispr-performance-tuning
Wispr Flow performance tuning for voice-to-text API integration. Use when integrating Wispr Flow dictation, WebSocket streaming, or building voice-powered applications. Trigger: "wispr performance tuning".
wispr-cost-tuning
Wispr Flow cost tuning for voice-to-text API integration. Use when integrating Wispr Flow dictation, WebSocket streaming, or building voice-powered applications. Trigger: "wispr cost tuning".
windsurf-performance-tuning
Optimize Windsurf IDE performance: indexing speed, Cascade responsiveness, and memory usage. Use when Windsurf is slow, indexing takes too long, Cascade times out, or the IDE uses too much memory. Trigger with phrases like "windsurf slow", "windsurf performance", "optimize windsurf", "windsurf memory", "cascade slow", "indexing slow".
windsurf-cost-tuning
Optimize Windsurf licensing costs through seat management, tier selection, and credit monitoring. Use when analyzing Windsurf billing, reducing per-seat costs, or implementing usage monitoring and budget controls. Trigger with phrases like "windsurf cost", "windsurf billing", "reduce windsurf costs", "windsurf pricing", "windsurf budget".
webflow-performance-tuning
Optimize Webflow API performance with response caching, bulk endpoint batching, CDN-cached live item reads, pagination optimization, and connection pooling. Use when experiencing slow API responses or optimizing request throughput. Trigger with phrases like "webflow performance", "optimize webflow", "webflow latency", "webflow caching", "webflow slow", "webflow batch".
webflow-cost-tuning
Optimize Webflow costs through plan selection, CDN read optimization, bulk endpoint usage, and API usage monitoring with budget alerts. Use when analyzing Webflow billing, reducing API costs, or implementing usage monitoring for Webflow integrations. Trigger with phrases like "webflow cost", "webflow billing", "reduce webflow costs", "webflow pricing", "webflow budget".
vercel-performance-tuning
Optimize Vercel deployment performance with caching, bundle optimization, and cold start reduction. Use when experiencing slow page loads, optimizing Core Web Vitals, or reducing serverless function cold start times. Trigger with phrases like "vercel performance", "optimize vercel", "vercel latency", "vercel caching", "vercel slow", "vercel cold start".
vercel-cost-tuning
Optimize Vercel costs through plan selection, function efficiency, and usage monitoring. Use when analyzing Vercel billing, reducing function execution costs, or implementing spend management and budget alerts. Trigger with phrases like "vercel cost", "vercel billing", "reduce vercel costs", "vercel pricing", "vercel expensive", "vercel budget".
veeva-performance-tuning
Veeva Vault performance tuning for REST API and clinical operations. Use when working with Veeva Vault document management and CRM. Trigger: "veeva performance tuning".