AI Agent News/stories/vercel-adds-virtual-models-to-ai-gateway-for-switching-models-by-id.md

Infrastructure

Vercel adds Virtual Models to AI Gateway for switching models by ID

Vercel has introduced Virtual Models on AI Gateway, which let developers point an app or agent at a single model ID and change the model and its settings behind that ID. Changes apply wherever the ID is used, without code changes or redeploys.

Source: vercel.com/blog/ai-gateway-virtual-models

A virtual model is an abstraction over the model string and configuration that apps and developers use. Developers assign a virtual model ID to an agent task, pass that ID as the model string, and then change the underlying model, fallbacks, priority and Zero Data Retention settings in AI Gateway. Vercel says apps and agents pick up the new configuration within a few minutes.

Vercel's example creates a virtual model named coding-agent with the Vercel CLI and calls it from the AI SDK using the ID vmc/coding-agent. Coding agents such as Claude Code and Codex can be connected with the vercel ai-gateway setup command and then pointed at the virtual model in their model settings.

Settings on a virtual model override the same settings in a request, so callers cannot change the provider order, fallbacks or service tier. Tags on a virtual model replace request tags, and provider options apply per provider, so settings specific to one provider stop applying after a switch to another. The Virtual Models page shows requests, spend and success rate for each task.

Why it matters if you build agents

Agent code can keep one model ID while the model behind it changes, so switching models no longer requires a redeploy. Teams can also test a candidate virtual model against evals before moving production traffic to it.

Provider-specific options do not carry over when a virtual model moves to another provider, so developers should review those options after each switch.

Get stories like this every weekday

One short email with the day's agent tooling news.

Subscribe