Skip to content

Add AI gateway workload benchmark with 4-phase concurrency ramp and pricing - #360

Open
dtice25 wants to merge 4 commits into
masterfrom
devin/1787342950-ai-gateway-workload
Open

Add AI gateway workload benchmark with 4-phase concurrency ramp and pricing#360
dtice25 wants to merge 4 commits into
masterfrom
devin/1787342950-ai-gateway-workload

Conversation

@dtice25

@dtice25 dtice25 commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds a new AI gateway workload benchmark that ramps concurrency through four fixed levels (1, 8, 16, 32) and reports sustained throughput, p50/p95/p99 latency, TTFT, error/timeout rates, max-sustained concurrency, and a per-provider pricing comparison.

  • benchmarks/ai-gateway/ai-gateway-workload.bench.ts: Anthropic-family entry point with groupBy: 'round' and groupBy: 'concurrency' scoring.
  • benchmarks/ai-gateway/workload-task.ts: sustained p-limit request pool over sendAndMeasure, returning per-level aggregates plus raw totalMs/ttftMs arrays for scoring.
  • benchmarks/ai-gateway/workload-results.ts: legacy JSON writer that detects maxSustainedConcurrency (error rate < 5%, p95 total < 30s, throughput not degraded > 25% from previous level) and attaches cost metrics plus a valueScore.
  • benchmarks/ai-gateway/pricing.ts: token-pricing map seeded with Claude Haiku 4.5 list price ($1/$5 per 1M input/output) and per-provider confidence flags.
  • benchmarks/ai-gateway/phase-probe.ts: exports buildRequestBody, sendAndMeasure, RawProbeOutcome, and adds extractInputTokens/inputTokens so the workload can compute cost from real token counts.
  • package.json: adds bench:ai-gateway-workload and a few --provider example scripts.

Run with:

pnpm bench:ai-gateway-workload
pnpm bench:ai-gateway-workload:openrouter

Verified with pnpm typecheck, pnpm -r --filter "./packages/**" build, and @benchsdk/runner / @benchsdk/client tests. An actual end-to-end run requires the AI gateway API keys and is not included in this change.

Link to Devin session: https://app.devin.ai/sessions/4ea7e5707b4e40e585c0e8befd7249b9
Requested by: @dtice25


Open in Devin Review

…ricing comparison

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@open-cla

open-cla Bot commented Aug 21, 2026

Copy link
Copy Markdown

Contributor License Agreement

All contributors are covered by a CLA.

devin-ai-integration[bot]

This comment was marked as resolved.

dtice25 and others added 2 commits August 21, 2026 20:11
…om unrounded costPerRequest

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…don't round to 0.00

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
devin-ai-integration[bot]

This comment was marked as resolved.

… requests

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant