Prompt Chain

Unify AI Providers with Vercel Gateway

Promptfoo config comparing OpenAI, Anthropic, and Google models routed through the Vercel AI Gateway's unified, 0%-markup API.

Works with vercel

78
Spark score
out of 100
Updated 29 days ago
Version 0.121.18

Add to Favorites

Why it matters

Access multiple AI providers through a single, unified API using Vercel AI Gateway. Simplify your AI integrations and streamline development.

Outcomes

What it gets done

01

Integrate with various AI models via a consistent interface.

02

Abstract away provider-specific complexities.

03

Enable dynamic selection of AI models for different tasks.

Install

Add it to your toolbox

Run in your project directory:

curl -fsSL https://spark.entire.vc/get/pfoo-vercel-ai-gateway | bash

Overview

Vercel Ai Gateway

This Promptfoo example compares OpenAI gpt-4o-mini, Anthropic claude-haiku-4.5, and Google gemini-2.5-flash, all accessed through the Vercel AI Gateway's unified, zero-markup API, on simple-explanation prompts checked for topic keywords. Use it as a template when comparing models from multiple providers through Vercel AI Gateway's unified API instead of separate credentials.

What it does

This Promptfoo config compares three models from different providers, all accessed through the Vercel AI Gateway's unified API at 0% markup: OpenAI's gpt-4o-mini, Anthropic's claude-haiku-4.5, and Google's gemini-2.5-flash, each run at temperature 0.7 with a 200-token cap. All three answer the same simple-explanation prompt template across three topics: machine learning, quantum computing, and blockchain.

Each test uses a contains-any assertion checking for at least one expected keyword per topic - algorithm, data, learn, or pattern for machine learning; qubit, quantum, superposition, or computer for quantum computing; block, chain, ledger, or decentralized for blockchain - rather than requiring an exact phrase. Running the example requires a VERCEL_AI_GATEWAY_API_KEY environment variable.

When to use - and when NOT to

Use it as a template for comparing models from different providers through Vercel's unified gateway, when you want single-API access across OpenAI, Anthropic, and Google without managing separate provider credentials. Do not use it if you're calling providers directly rather than through Vercel AI Gateway, or if you only need to test one model.

Inputs and outputs

Input: the YAML config - a shared explanation prompt template, three vercel-prefixed provider configs, and three topic test cases with keyword assertions - plus the VERCEL_AI_GATEWAY_API_KEY environment variable. Output: Promptfoo's evaluation report comparing the three models' pass rates on the keyword-presence checks per topic.

Integrations

Uses Promptfoo's vercel provider prefix to route calls to OpenAI, Anthropic, and Google models through the Vercel AI Gateway's unified API.

Who it's for

Teams standardizing multi-provider LLM access through Vercel AI Gateway who want to compare OpenAI, Anthropic, and Google models on simple-explanation quality.

FAQ

Common questions

Discussion

Questions & comments · 0

Sign In Sign in to leave a comment.