Add AI gateway workload benchmark with 4-phase concurrency ramp and pricing - #360
Open
dtice25 wants to merge 4 commits into
Open
Add AI gateway workload benchmark with 4-phase concurrency ramp and pricing#360dtice25 wants to merge 4 commits into
dtice25 wants to merge 4 commits into
Conversation
…ricing comparison Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Contributor License AgreementAll contributors are covered by a CLA. |
…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>
… requests Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 withgroupBy: 'round'andgroupBy: 'concurrency'scoring.benchmarks/ai-gateway/workload-task.ts: sustainedp-limitrequest pool oversendAndMeasure, returning per-level aggregates plus rawtotalMs/ttftMsarrays for scoring.benchmarks/ai-gateway/workload-results.ts: legacy JSON writer that detectsmaxSustainedConcurrency(error rate < 5%, p95 total < 30s, throughput not degraded > 25% from previous level) and attaches cost metrics plus avalueScore.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: exportsbuildRequestBody,sendAndMeasure,RawProbeOutcome, and addsextractInputTokens/inputTokensso the workload can compute cost from real token counts.package.json: addsbench:ai-gateway-workloadand a few--providerexample scripts.Run with:
Verified with
pnpm typecheck,pnpm -r --filter "./packages/**" build, and@benchsdk/runner/@benchsdk/clienttests. 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