With the ADK, you can onboard custom LLM models from external providers and create model policies to manage multi-model workflows in your agents. This is referred to as the AI gateway.In the following sections, you’ll learn how to integrate new LLM models and define model policies in watsonx Orchestrate, enabling you to build more powerful agents quickly.
Each provider supports different provider configurations. You can see a list of provider configurations as well as full examples of how to use these models in Examples using the supported providers.Alternatively, you can also create a model specification file, which contains all the details of your model and the provider configuration:
meta-llama-3-2-90b-vision-instruct.yaml
Copy
Ask AI
spec_version: v1kind: modelname: watsonx/meta-llama/llama-3-2-90b-vision-instructdisplay_name: Llama 3.2 Vision Instruct # Optionaldescription: Meta's Llama 3.2 Vision Instruct with 90b parameters running on WatsonX AI # Optionaltags: #Optional - meta - llamamodel_type: chat # Optional. Default is "chat". Options: ["chat"|"chat_vision"|"completion"|"embedding"]provider_config: watsonx_space_id: my_wxai_space_id
Although you can specify the API key directly in the provider configuration, this approach is not recommended if security is a priority.
3
Adding your model
There are two ways to add your model with the ADK:
Recommended: You can import the model from the model specification file:
The first thing that you need to do is to define how your models will behave.
model_policy.yaml
Copy
Ask AI
spec_version: v1kind: modelname: anygemdescription: Balances requests between 2 Gemini modelsdisplay_name: Any Gempolicy: strategy: mode: loadbalance retry: attempts: 1 on_status_codes: [503] targets: - model_name: virtual-model/google/gemini-2.0-flash weight: 0.75 # Weights must be greater than 0 and less than or equal to 1 - model_name: virtual-model/google/gemini-2.0-flash-lite weight: 0.25
You can see a full reference for options in Model policies.
2
Import the model policy
Run the following command to import the model policy: