Preparing an AI runtime for the IBM MQ Agent

To understand your questions, the IBM® MQ Agent uses large language models (LLMs) that are hosted in an AI runtime. If you are using IBM watsonx.ai™ Runtime, create a project and an API key, which the IBM MQ Agent can use to access the LLMs. If you are using vLLM, you need only note any existing API key.

Before you begin

Currently, the supported AI runtimes are IBM watsonx.ai Runtime (which you add to an IBM Cloud® account) and vLLM. For more information about entitlement for IBM watsonx.ai Runtime, see Entitlement.

If you are using vLLM, you do not need to complete this task; you need only record your API key, if your vLLM runtime requires one for access. You specify this key when you later deploy the IBM MQ Agent, so that the IBM MQ Agent can access the vLLM runtime. After recording the key, proceed to Granting the IBM MQ Agent access to queue manager resources.

If you are using IBM watsonx.ai Runtime, complete the rest of this task to create a project with an API key.

  1. If you don't have an IBM Cloud account already, create one by following the instructions in Setting up your IBM Cloud account in the IBM Cloud documentation.
  2. Install the IBM Cloud command line interface tool then use it to log in to IBM Cloud. For more information, see Installing the stand-alone IBM Cloud CLI in the IBM Cloud documentation.

About this task

For more information about the set of LLMs that is used by the IBM MQ Agent, see Foundation models for the IBM MQ Agent.

Procedure

  1. Create IBM Cloud Object Storage.
    Follow the instructions in Create an instance of IBM Cloud Object Storage in the IBM Cloud documentation (you don’t need to create any buckets).
  2. Create an IBM watsonx.ai runtime.
    You can use either the IBM Cloud catalog or the CLI as described in IBM Cloud CLI in the IBM watsonx™ documentation.
    For example, use the IBM Cloud CLI tool to run the following command:
    ibmcloud resource service-instance-create <service_instance_name> pm-20 <plan_name> <region> --service-endpoints <endpoint_network>
    where:
    • <service_instance_name>: a custom name for your service instance.
    • pm-20: the service ID for the IBM watsonx.ai Runtime.
    • <plan_name>: an IBM watsonx.ai Runtime pricing plan, such as essentials or standard. For more information, see watsonx.ai Runtime service plans in the IBM watsonx documentation.
    • <region>: the IBM watsonx regional data center, such as us-south (Dallas).
      Note: Not all data centers support the foundation models that are required by the agent. For a list of required foundation models, see Foundation models for the IBM MQ Agent. For a list of data centers and the models that are available in each, see Regional availability of services and features in the IBM watsonx documentation.
    • <endpoint_network>: defines network traffic. Options are public, private, or public-and-private. For more information, see Managing the watsonx.ai Runtime service endpoint in the IBM watsonx documentation.
  3. Navigate to the Manage page for the IBM watsonx Runtime instance that you created.
  4. Click the Options (down arrow) icon next to Launch in then click IBM watsonx to open an IBM watsonx browser tab.
    If the "Welcome to watsonx" dialog opens, close it.
  5. Create a new project.
    1. In the IBM watsonx browser tab, scroll to the Projects section at the end of the page then click the Create a new project (+) icon.
    2. Associate cloud object storage with the project.
      Use the Select storage service drop-down list to associate the cloud object storage that you created earlier with this new project.
    3. Click Create.
      You might need to create an access key before the Create button is enabled.
    4. Note the project ID for future use.
      In the Project navigation, click General to open the "General" page, which shows the Project ID.
  6. Add collaborators to the project.
    1. In the project, click the Manage tab, then in the Project navigation, click Access Control to open the "Access control" page.
    2. In the "Access control" page, click Add collaborators.
  7. Associate the IBM watsonx.ai Runtime with the project.
    1. In the project, click the Manage tab, then in the Project navigation, click Services & Integrations to open the "Services & integrations" page.
    2. In the "Services & integrations" page, click Associate service.
    Without this association, you cannot run or deploy assets that you create within a IBM watsonx.ai project.
  8. Create an IBM Cloud API key then retain it for future use.
    For example, use the IBM Cloud CLI tool to run the following command, which creates a key called MyAPIKey in a file called my-api-key.json in the directory in which you run the command:
    ibmcloud iam api-key-create MyAPIKey -d "API key for use with IBM MQ Agent" --file my-api-key.json
  9. Optional: As an account administrator, you might want to grant access to other users.
    For example, use the IBM Cloud CLI tool to run one or more of the following commands. For more information about each command, see the following topics in the IBM Cloud CLI documentation: Managing IAM access, API keys, trusted profiles, service IDs, and access groups (ibmcloud iam) and Managing accounts and users (ibmcloud account)
    Create a group:
    ibmcloud iam access-group-create [<group_name>]
    Check if a group exists:
    ibmcloud iam access-groups
    Add a policy to the group:
    ibmcloud iam access-group-policy-create [<group_name>] --roles [<role>] --service-name [<service_name>] --service-instance [<service_instance>] --region [<region>]
    Invite users:
    ibmcloud account user-invite [<email>]
    Add a user to the group:
    ibmcloud iam access-group-user-add [<group_name>] [<email>]
    Remove a user from a group:
    ibmcloud iam access-group-user-remove [<group_name>] [<email>] -f
    Remove a user from an account:
    ibmcloud account user-remove [<email>] -f

Results

You created a project that is associated with an IBM watsonx.ai Runtime service. The IBM MQ Agent will use the LLMs in the IBM watsonx.ai service to understand your questions.
You also recorded the following information, which you will use in the next task:
  • The ID of the project that you created.
  • The IBM Cloud API key that you created.

What to do next

Proceed to Granting the IBM MQ Agent access to queue manager resources.