You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
add a new ai-gateway benchmark mode with provider configs, scenario-based runs (short-nonstream, short-stream), gateway-specific scoring, and JSON result output under results/ai_gateway/<scenario>/
wire ai-gateway into the main runner and merge pipeline so matrix artifacts can be combined via src/merge-results.ts --mode ai-gateway
add CLI scripts and a dedicated GitHub Actions workflow to run provider/scenario matrix benchmarks and post ranked PR comments
What This Tests
gateway transport performance and reliability using OpenAI-compatible POST /chat/completions
fixed prompt scenarios across providers with a shared model via AI_GATEWAY_MODEL
per-iteration timing and reliability metrics: first token latency, total latency, output token throughput, and success/error status
ranking via a latency-weighted composite score penalized by failures
Out of Scope (Intentional)
model answer quality/correctness evaluation
tool/function-calling behavior
long-context capability testing
cost/pricing benchmarking
Future Scope
gateway-specific platform features while keeping the same non-quality scope, e.g. retries/fallbacks, caching effects (cold vs warm), routing policy behavior, rate-limit handling, and concurrency/queueing behavior
Included In This PR
runtime and scoring implementation under src/ai-gateway/
runner integration in src/run.ts
merge integration in src/merge-results.ts
new scripts in package.json
new workflow: .github/workflows/ai-gateway-benchmarks.yml
Validation
ran npm run bench -- --mode ai-gateway --provider openrouter --iterations 1 (validated mode wiring and skip behavior when creds are missing)
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
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
ai-gatewaybenchmark mode with provider configs, scenario-based runs (short-nonstream,short-stream), gateway-specific scoring, and JSON result output underresults/ai_gateway/<scenario>/ai-gatewayinto the main runner and merge pipeline so matrix artifacts can be combined viasrc/merge-results.ts --mode ai-gatewayWhat This Tests
POST /chat/completionsAI_GATEWAY_MODELOut of Scope (Intentional)
Future Scope
Included In This PR
src/ai-gateway/src/run.tssrc/merge-results.tspackage.json.github/workflows/ai-gateway-benchmarks.ymlValidation
npm run bench -- --mode ai-gateway --provider openrouter --iterations 1(validated mode wiring and skip behavior when creds are missing)npx tsx src/merge-results.ts --input /tmp/ai-gateway-merge-check --mode ai-gateway(validated merge-mode entrypoint)