feat(ai-gateway): add regional latency benchmark - #379
Conversation
- Add regional endpoint support to AIGatewayProviderConfig - Extend shared task to parse <region>:<mode> phases and route to per-region endpoints - Add ai-gateway-regional.bench.ts with 4 default regions and 5 cold/warm iterations each - Group scoring by region and write per-region legacy results - Add pnpm scripts for running the regional benchmark Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
🤖 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. |
Ensure --ai-gateway-regions cannot consume a following flag as a region and the equals form rejects an empty value. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Run one region per invocation, supplied via BENCH_REGION or --ai-gateway-region. The same provider endpoints are used; region differences come from runner location. Records are tagged with region and legacy results are written per region. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
resolveAIGatewayRegionalPhases now receives process.argv flags plus the resolved region, so --iterations / --ai-gateway-iterations-cold / --ai-gateway-iterations-warm are honored. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
Fixed: |
resolveAIGatewayRegionalPhases now throws when the generic --iterations flag is <= 0. The regional benchmark now throws instead of exiting 0 when no phases remain. Per-phase --ai-gateway-iterations-* 0 still disables that phase as intended. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
Fixed: |
Regions are runner locations, not per-provider endpoints, so the unused regionalEndpoints config and resolveProviderForRegion routing are removed. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
… per region Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…tions, frozen lockfile Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
Fixed: added the Namespace vault object |
|
Fixed: when |
|
Fixed: updated the |
|
Fixed: removed the schedule-only |
|
Fixed: pinned |
|
Fixed: removed |
|
Fixed: removed the unused |
…filter Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
Fixed: added |
Summary
Adds a regional AI gateway latency benchmark where each runner location is a dimension. Each invocation runs one region, tags every record with
region, and multiple invocations can share the same--run-keyto appear as one platform run.When a
--run-keyis used, the benchmark suffixes each provider participant slug with the runner region (<provider>-<region>) so sibling regional runners register distinct participants. The original provider name is preserved in a newdisplayNamefield so legacy JSON and SVG output stay readable.What changed
benchmarks/ai-gateway/ai-gateway-regional.bench.ts(new): single-region-per-run benchmark that readsBENCH_REGIONor--ai-gateway-region. Defaults to 5 cold + 5 warm iterations and honors--iterations/--ai-gateway-iterations-cold/--ai-gateway-iterations-warm.benchmarks/ai-gateway/shared-task.ts:resolveAIGatewayRegionalPhasesbuilds<region>:cold/<region>:warmphases,makeAIGatewayTasktags records withregion, andparsePhaseextracts region/mode from the phase string.benchmarks/ai-gateway/types.ts: removed the unusedregionalEndpointsfield; added optionaldisplayNametoAIGatewayProviderConfigfor clean legacy/SVG output when participant slugs carry extra qualifiers.benchmarks/ai-gateway/legacy-results.ts: emitsproviderfromdisplayName(falling back to the participant slug).package.json: addedbench:ai-gateway-regionalscripts..github/workflows/ai-gateway-regional-benchmarks.yml(new): weekly/ manually-triggered matrix that runs one job per region with the same--run-key. Theruns-onvalue currently usesnamespace-profile-defaultwith vault grants as a placeholder; region-specific Namespace runner profiles/labels must be configured for actual regional scheduling. Alluses:actions are pinned to commit SHAs,pnpm install --frozen-lockfileis used for all triggers, the pnpm cache is disabled, and unused permissions are removed.Usage
BENCH_REGION=us-east-1 pnpm bench:ai-gateway-regional # or join four regional runners into one platform run BENCH_REGION=eu-west-1 npx tsx packages/benchsdk-runner/dist/bin.js run \ benchmarks/ai-gateway/ai-gateway-regional.bench.ts --run-key regional-ai-gateway-123Link to Devin session: https://app.devin.ai/sessions/e421351b95ad4ddba4959a7c2aa41d92
Open in Devin Desktop: https://app.devin.ai/desktop/session/e421351b95ad4ddba4959a7c2aa41d92?variant=devin
Requested by: @dtice25