We’ll walk through the watsonx Orchestrate CLI a part of the (ADK) essentials—from setting up environments to managing agents, connections, and loading an IBM watsonx.ai model. The goal: give us a copy-pasteable, reliable reference that’s easy to follow and ready for day-to-day work.
Note: --env/--environment may appear in different examples; we stick to the flag used by our CLI version. If a command errors, run orchestrate connections --help to confirm the flag name.
6. LLM (watsonx.ai) via AI Gateway
We’ll configure a watsonx.ai provider connection, then define and load a model that points to our watsonx Space/Project/Deployment.
Provider schema (reference)
{
"api_key": "string", // required
"watsonx_space_id": "string", // at least one of space/project/deployment is required
"watsonx_project_id": "string", // at least one of space/project/deployment is required
"watsonx_deployment_id": "string", // at least one of space/project/deployment is required
"watsonx_cpd_url": "string", // required for on-prem (CPD)
"watsonx_cpd_username": "string", // required for on-prem (CPD)
"watsonx_cpd_password": "string", // required for on-prem (CPD)
"watsonx_version": "string",
"custom_host": "string",
"url_to_fetch": "string",
"forward_headers": ["string"],
"request_timeout": 30,
"transform_to_form_data": false
}
Add other entries as needed, e.g. watsonx_space_id, watsonx_project_id, or watsonx_deployment_id.
Step 5: Define the model (YAML)
./models_config/granite-3-3-8b-instruct.yaml
spec_version: v1
kind: model
name: watsonx/ibm/granite-3.3-8b-instruct
display_name: IBM watsonx.ai (Granite)
description: |
IBM watsonx.ai model using Space-scoped configuration.
tags:
- ibm
- watsonx
model_type: chat
provider_config:
watsonx_space_id: my-space-id
We keep the model name stable; only adjust provider_config values for different environments (dev/stage/prod).
[INFO] - Be sure to include the following required fields for provider 'watsonx' in the connection 'watsonx_credentials':
- api_key
[INFO] - Successfully added the model 'virtual-model/watsonx/ibm/granite-3.3-8b-instruct'
If we see a missing field message, we re-run the set-credentials step to add the missing entries.
The image below shows the new available model!
6. Troubleshooting & Tips
“Command not found”: verify the CLI is installed and on PATH.
Permissions/401/403: confirm the API key is valid and the target Space/Project/Deployment exists.
Wrong environment: run orchestrate env list and orchestrate env activate ... to ensure we’re targeting the right place.
Flag differences: CLI versions can evolve; use --help to validate flags like --env vs --environment.
Secrets hygiene: prefer --entries with environment variables; avoid putting raw secrets in your shell history.
7. Recap (copy-paste quick refs)
Environments
orchestrate env list
cat ~/.config/orchestrate/config.yaml
orchestrate env activate local
orchestrate env activate --api-key ${API_KEY} ${ENVIRONMENT_NAME}
orchestrate env remove --name ${ENV_TO_DELETE}
Leave a comment