Stop hardcoding model names: AI Gateway's virtual models swap models in minutes, no redeploy
Synopsis
Vercel introduced Virtual Models on AI Gateway, so apps and agents call a task-named virtual model ID instead of a concrete model name, with model choice, fallbacks and Zero Data Retention configured on the gateway. Previously switching models was a one-line code change that still usually required a redeploy; now editing the virtual model is picked up by every app and agent using that ID within a few minutes.
Interpretation
Apps and agents now call a task-named virtual model ID rather than a hardcoded model name, moving model selection and configuration to the AI Gateway side. AI Gateway already made switching models a one-line change, but that line still lived in code, so switching usually meant a redeploy. The official example edits the coding-task virtual model from anthropic/claude-opus-5.5 to openai/gpt-6.1-sol, and every app and agent calling vmc/coding-agent picks it up within a few minutes with no code change or deployment.
Each task can get its own virtual model, and settings such as fallbacks, Zero Data Retention and tags stay with it when the model changes. Previously those settings sat in individual requests or apps and had to be redone on each model switch. The official text contrasts support ticket triage, which runs hundreds of times an hour and needs to be cheap, with legal contract review, which runs a few times a day and needs strong reasoning, and notes that provider options apply per provider, so an Anthropic-specific setting stops applying when the virtual model points at an OpenAI model.
Settings on a virtual model win over the same settings in a request, so callers cannot override the provider order, fallbacks or service tier the platform chose. Previously a request could specify its own fallbacks or turn off options such as Zero Data Retention. The official text states that if a virtual model requires Zero Data Retention or providers that do not train on request data, those configurations are enforced even if a request explicitly sets zeroDataRetention or disallowPromptTraining to false, and that tags on a virtual model replace tags sent with the request so spend lands on the task.
Perspective
The mechanism targets apps and agents calling models through AI Gateway, covers image, video, speech, embedding and realtime models, and works with the AI SDK and the OpenAI- and Anthropic-compatible APIs; the official guidance is to point a second virtual model at the new model and run evals before switching one that serves production traffic.
The official text notes that provider options apply per provider, so an Anthropic-specific setting stops applying when the virtual model points at an OpenAI model and provider options should be reviewed on each switch; it also advises running evals against a candidate virtual model before switching production traffic, and pointing the original back at the previous model if quality drops.
