IBM Cloud Docs
Setting up watsonx Code Assistant for Red Hat Ansible Lightspeed in IBM Cloud

Setting up watsonx Code Assistant for Red Hat Ansible Lightspeed in IBM Cloud

watsonx Code Assistant for Red Hat Ansible Lightspeed

As a cloud administrator, you must generate an API key to connect your watsonx Code Assistant for Red Hat Ansible Lightspeed instance with a deployment space through IBM Cloud®.

Before you begin

  • Make sure you have an IBM Cloud account.

  • Provision an instance of watsonx Code Assistant through the IBM Cloud catalog page or by working with an IBM sales representative.

When you finish provisioning your instance, click Setup to open an onboarding checklist page to help you configure the instance. Or, you can select Administration and then Setup to access this onboarding checklist.

Items in that checklist correspond to each of the following steps. Click the action arrows on the checklist page that are associated with each item to complete the steps.

Create a Service ID and API key

You use this API key later to enable Visual Studio Code to communicate with watsonx Code Assistant.

  1. On the Service IDs page, click Create.

  2. Enter IBM watsonx Code Assistant user as the name for your service ID. Optionally, enter a description.

  3. Click Create.

    You are redirected to the dashboard for your service ID, which includes tabs for Access and API keys.

  4. Click the API Keys tab.

  5. Click Create.

  6. Enter IBM watsonx Code Assistant API key as the name for your API key. Optionally, enter a description.

  7. Click Create.

  8. Click Download or Copy and store the API key in a safe location.

    The key is only available for 296 seconds. Make sure to store it somewhere you can find it later.

Create a deployment space and model ID

The deployment space is the serving environment for watsonx Code Assistant. The model ID determines which model generates code recommendations in the Ansible extension for Visual Studio Code.

  1. Enter Code Assistant Models as the name for your deployment space. Optionally, enter a description.

  2. Click Create.

  3. A status window appears. After the space is created, click Close.

    Your instance is automatically associated with your new deployment space.

  4. Copy your Model ID. After you create the deployment space, your Model ID is provided in a field after the Create a deployment space checklist item. Copy this ID and store it in a safe location as you need to add it to the Red Hat Ansible Lightspeed Admin portal in a later step.

Add the service ID to the deployment space

Enable the API to connect to your deployment space.

  1. On the Manage tab of the Code Assistant Models page, select Access control.

  2. Click Add collaborators and select Add service IDs from the menu.

    A list of service IDs that are associated with your account appears.

  3. Click the checkbox for your IBM watsonx Code Assistant user service ID and select Editor for the role.

  4. Click Add.

    The service ID is added to the list of collaborators.

Configure Red Hat Ansible Lightspeed to connect with watsonx Code Assistant

Add the API key and the model ID to the Red Hat Ansible Lightspeed Admin Portal to connect watsonx Code Assistant with the Ansible extension for Visual Studio Code. Follow the onboarding checklist and the instructions from Red Hat.

To add the API key and model ID to the Red Hat Ansible Lightspeed Admin Portal, see Configuring Red Hat Ansible Lightspeed to connect with IBM watsonx Code Assistant for Red Hat Ansible Lightspeed in the Red Hat documentation.

Create a project

Standard plan

If you purchased a Standard plan, you can tune the IBM base code model with your own data so that it generates code suggestions that are customized for your organizational context. All your assets are stored in a project, including your uploaded data and tuned models. After you create a project, you can work with data and other resources to tune models.

  1. On the resource page for your instance, click the navigation menu icon and select Projects.

  2. Click New project.

  3. Select Create an empty project

  4. Enter a meaningful name and description for your project so you can easily identify it.

    Optionally, select control options:

    • Mark as sensitive prevents data from being moved out of the project.
    • Allow reporting on asset metadata allows system tools (like Reporting) to access and store metadata on assets in this project in an external database.
  5. Click Create.

You're now ready to create a tuning experiment to tune the IBM base code model with your own data. For more information, see Tuning the IBM base code model for watsonx Code Assistant for Red Hat Ansible Lightspeed.

Next steps

Follow the instructions from Red Hat to install and configure the Ansible extension for Visual Studio Code and start generating code recommendations.