Skip to main content
Model policies allow for the coordination of multiple models to accomplish tasks like load-balancing and fallback.
Model policies only support virtual models. You must import models as virtual models and reference them in your policies using the virtual-model/ prefix (e.g., virtual-model/google/gemini-2.0-flash). Direct references to provider models (e.g., groq/openai/gpt-oss-120b or bedrock/openai.gpt-oss-120b-1:0) are not supported.

Adding model policies

BASH

Importing model policies

BASH
After you create a model policy, assign the policy to your agent by using the ADK and the agent YAML file. Assign the policy the same way that you assign a regular model. You cannot assign a model policy to a Generative Prompt Activity in a flow.
Where the my_spec.yaml file follows this structure:
[my_spec.yaml]
Flags:
  • --file (-f): File path of the spec file containing the model policy configuration.

Updating model policy

Use either the add or import commands with the name of the model policy that you want to update to update the model policy.

Exporting model policy

BASH

Removing model policies

BASH