Skip to main content
Back to Prompt Library
implementation

Build the application

Inspect the original prompt language first, then copy or adapt it once you know how it fits your workflow.

Linked challenge: Build a Hosted Claude API Rate Limit and Exponential Backoff Profiler

Format
Code-aware
Lines
72
Sections
11
Linked challenge
Build a Hosted Claude API Rate Limit and Exponential Backoff Profiler

Prompt source

Original prompt text with formatting preserved for inspection.

72 lines
11 sections
No variables
1 code block
## Build
Analyze client-side SDK telemetry to track HTTP 429 rate limit events against hosted Claude. Synthesize optimal jittered backoff configurations using Claude to maximize throughput and resolve congestion windows.

## User
AI Platform Operations Engineer

## Workflow
1. Record client-side HTTP response codes, retry counts, and delay intervals from Claude SDK telemetry logs.
2. Detect congestion windows where concurrent requests reliably trigger HTTP 429 rate limit headers.
3. Invoke the hosted Claude API to synthesize an analysis of the concurrency bursts and backoff efficiency.
4. Generate a client tuning specification with recommended max_retries and jitter parameters.

## Interface
Developer observability dashboard rendering 429 rate limit event timelines and recommended backoff jitter configurations.

## Data
Normalized client request-response audit logs containing simulated 429 responses generated from synthetic application workloads.
Starter examples below are synthetic. They are not downloaded records.

## Source
[Anthropic Python SDK](https://raw.githubusercontent.com/anthropics/anthropic-sdk-python/main/README.md)
Utilizes Anthropic Python SDK client retry architectures, HTTP status code parsers, and custom telemetry interceptors.

## Tools
langfuse, anthropic-claude, pandas, fastapi.
Tracks client-side tracing, rate limit events, and HTTP response observability over time.
Hosted Claude API for technical performance narrative; strictly client-side external telemetry without internal model access.

## Deliverables
Submit runnable source, pinned dependencies, setup commands, a working interface, example outputs, and a recorded end-to-end demo. Include tests and an action log.

## Acceptance
- Measures client-side 429 responses and retry delays without requiring server-side logs.
- Pinpoints micro-bursts of concurrency that exceed API tier limits.
- Computes effective throughput penalty percentage caused by aggressive un-jittered retries.
- Emits structured recommendations for client-side exponential backoff tuning.

## Starter Examples
```json
[
  {
    "input": {
      "record_type": "simplified synthetic app records",
      "target_api": "hosted-claude",
      "tier_rpm_limit": 500,
      "total_requests": 800,
      "requests_429": 320,
      "average_retry_delay_ms": 1000
    },
    "expected_output": {
      "congestion_detected": true,
      "effective_throughput_penalty_pct": 40,
      "claude_platform_digest": "Simultaneous batch launch triggered 429s. Static 1000ms retries caused a thundering herd, degrading throughput.",
      "recommended_actions": [
        "Implement full jitter on exponential backoff.",
        "Cap max_retries to 5.",
        "Stagger batch job initialization."
      ]
    }
  },
  {
    "input": {
      "record_type": "simplified synthetic app records",
      "target_api": "hosted-claude",
      "tier_rpm_limit": 500,
      "total_requests": 200,
      "requests_429": 0,
      "average_retry_delay_ms": 0
    },
    "expected_output": {
      "congestion_detected": false,
      "effective_throughput_penalty_pct": 0,
      "claude_platform_digest": "Traffic patterns are smooth and well within tier RPM limits.",
      "recommended_actions": []
    }
  }
]
```

## Safety
Telemetry is client-side only. Does not claim access to Anthropic server logs, internal rate limiter logic, or model weights.
Use mock external writes. Require human review before any real deployment.

Adaptation plan

Keep the source stable, then change the prompt in a predictable order so the next run is easier to evaluate.

Keep stable

Hold the task contract and output shape stable so generated implementations remain comparable.

Tune next

Update libraries, interfaces, and environment assumptions to match the stack you actually run.

Verify after

Test failure handling, edge cases, and any code paths that depend on hidden context or secrets.