Agent skill · software engineering · jeremylongshore
langfuse-rate-limits
Implement Langfuse rate limiting, batching, and backoff patterns.
Why this skill is useful
Adds executable scripts for handling Langfuse API rate limits with optimized batching and retry mechanisms that aren't in public docs.
What it needs
Requires langfuse-sdk, p-queue installed locally. Requires langfuse account access. About 4k tokens when loaded. Last updated 2026-08-07. 2,604 stars on the source repository.
What this skill does
Langfuse Rate Limits Overview Handle Langfuse API rate limits with optimized SDK batching, exponential backoff with jitter, concurrent request limiting, and configurable sampling for ultra-high-volume workloads. Prerequisites Langfuse SDK installed and configured High-volume trace workload (1,000+ events/minute) Instructions Step 1: Optimize SDK Batching Configuration The Langfuse SDK batches events internally before sending. Tuning batch settings is the first defense against rate limits. Step 2: Implement Retry with Exponential Backoff For custom API calls (scores, datasets, prompts) that hit rate limits: Step 3: Queue-Based Concurrency Limiting Use p-queue to cap concurrent Langfuse API calls: Step 4: Configurable Sampling for Ultra-High Volume When tracing volume exceeds rate limits, sample traces instead of dropping them: Rate Limit Reference Tier Traces/min Batch Size Strategy ------ ------------ ------------ ---------- Hobby ~500 15 Default settings Pro ~5,000 50 Increase flushAt Team ~10,000 100 + Queue-based limiting Enterprise Custom Custom + Sampling Error Handling Error Response Action ------- ---------- -------- 429 Too Many Requests Retry-After: N Backoff for N seconds 503 Service Unavailable Server overloaded Backoff 30s+ Flush timeout Large batch Reduce flushAt, increase requestTimeout Memory growth Queue backup Add maxSize to PQueue Output Produce a rate-limit receipt with provider/tier, observed requests per minute, 429 count, retry policy, queue depth, sampling rate, and dropped traces. Keep the measurement window explicit so a quiet interval is not reported as headroom. Examples For a sustained 429 response, honor Retry-After, reduce concurrent exports, and retry one bounded batch. Verify that error traces remain sampled and that the application request still completes when tracing is deferred. If queue depth continues to grow, lower the sample rate before increasing memory limits. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills jeremylongshore/langfuse-rate-limits