migration toolkit for applications 8.1

Configuring and using Red Hat Developer Lightspeed for MTA

Using Red Hat Developer Lightspeed for migration toolkit for applications to modernize your applications

Red Hat Customer Content Services

Abstract

To modernize applications in your organization, apply Large Language Model (LLM) driven code changes by using Red Hat Developer Lightspeed for migration toolkit for applications (MTA). Automate code fixes, and review and apply the suggested code changes with minimum manual effort.

Chapter 1. Understanding Red Hat Developer Lightspeed for migration toolkit for applications

Understand the Red Hat Developer Lightspeed for migration toolkit for applications extension features, use cases, configurations, and the benefits of using the extension with a large language model (LLM) to generate AI-assisted code resolutions when you want to refactor large codebases.

1.1. Introduction to the Red Hat Developer Lightspeed for MTA

Starting from 8.0.0, migration toolkit for applications (MTA) integrates with large language models (LLM) through the Red Hat Developer Lightspeed for migration toolkit for applications plugin in the Visual Studio Code extension. You can use Red Hat Developer Lightspeed for MTA to apply LLM-assisted code changes to resolve issues that static code analysis identifies in Java applications.

1.1.1. Use case for AI-driven code fixes

Migration toolkit for applications performs the static code analysis for a specified target technology to which you want to migrate your applications. Red Hat provides 2400+ analysis rules in MTA for various Java technologies and you can extend the ruleset for custom frameworks or new technologies by creating custom rules.

The static code analysis describes the issues in your code that you must resolve. As you perform analysis for a large portfolio of applications, the issue description and the rule definition that may contain additional information form a large corpus of data that has repetitive patterns of problem definitions and solutions.

Migrators do duplicate work by resolving issues that repeat across applications in different migration waves.

1.1.2. Red Hat Developer Lightspeed for MTA overview

Red Hat Developer Lightspeed for MTA works by collecting and storing the changes in the code for a large collection of applications, finding context to generate prompts for the LLM of your choice, and by generating code resolutions that the LLM produces to address specific issues.

Red Hat Developer Lightspeed for MTA augments the manual changes that you make to code throughout your organization in different migration waves and creates a context for a large language model (LLM). The LLM suggests code resolutions based on the issue description, context, and earlier examples of code changes to resolve issues.

Red Hat Developer Lightspeed for MTA uses Retrieval Augmented Generation (RAG) for context-based resolutions of issues in code. By using RAG, Red Hat Developer Lightspeed for MTA improves the context that it shares with the LLM to generate more accurate suggestions to fix the issue in the code. The context allows the LLM to "reason" and generate suggestions for issues that it detects in the code. This mechanism helps to overcome the limited context size in LLMs that prevents them from analyzing the entire source code of an application.

Important

Developer Lightspeed for MTA is a Technology Preview feature only. Technology Preview features are not supported with Red Hat production service level agreements (SLAs) and might not be functionally complete. Red Hat does not recommend using them in production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process.

Additional resources

1.2. Describing the context

The context is a combination of the source code, the issue description, and solved examples:

  • Description of issues that MTA detects when you run a static code analysis for a given set of target technologies.
  • (Optional) The default and custom rules may contain additional information that you include which can help Red Hat Developer Lightspeed for MTA to define the context.
  • Solved examples constitute code changes from other migrations and a pattern of resolution for an issue to use in future. Red Hat Developer Lightspeed for MTA creates a solved example when a Migrator accepts a resolution in an earlier analysis that results in updated code or an unfamiliar issue in a legacy application that the Migrator manually fixed. The Solution Server stores solved examples.

    More instances of solved examples for an issue enhance the context and improve the success metrics of rules that trigger the issue. Higher the success metrics of an issue, greater the confidence level associated with the accepted resolutions for that issue in earlier analyses.

  • (Optional) If you enable the Solution Server, it extracts a pattern of resolution, called the migration hint, that the LLM can use to generate a more accurate fix suggestion in a future analysis.

    The improvement in the quality of migration hints results in more accurate code resolutions. Accurate code resolutions from the LLM result in the user accepting an update to the code. The Solution Server stores the updated code to generate a better migration hint in future.

    This cyclical improvement of resolution pattern from the Solution Server and improved migration hints lead to more reliable code changes as you migrate applications in different migration waves.

1.3. About the Solution Server

Solution Server is a component that allows Red Hat Developer Lightspeed for MTA to build a collective memory of source code changes from all analyses that an organization performs. This helps you to use the recurring patterns of solutions for issues that repeat in many applications. You can opt to use the Solution Server to request AI-assisted code resolutions.

The Solution Server augments earlier patterns of how source code changed to resolve issues (also called solved examples) that were similar to those in the current file, and suggests a resolution that has a higher confidence level derived from earlier solutions. After you accept a suggested code fix, the Solution Server works with the large language model (LLM) to improve the hints about the issue that becomes part of the context. An improved context enables the LLM to generate more reliable code fix suggestions in future cases.

The Solution Server delivers two primary benefits to users:

  • Contextual Hints: It surfaces examples of past migration solutions, including successful user modifications and accepted fixes, offering actionable hints for difficult or previously unsolved migration problems.
  • Migration Success Metrics: It exposes detailed success metrics for each migration rule, derived from real-world usage data. Integrated Development Environments (IDEs) or automation tools can use these metrics to present users with a “confidence level” or likelihood of Red Hat Developer Lightspeed for MTA successfully migrating a given code segment.

When you use the Solution Server, you can view a diff of the updated portions of the code and the original source code to do a manual review. In a manual review of the suggested AI resolutions, you can accept, reject, or edit the suggested code changes.

Important

Solution Server is a Technology Preview feature only. Technology Preview features are not supported with Red Hat production service level agreements (SLAs) and might not be functionally complete. Red Hat does not recommend using them in production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process.

Table 1.1. Configurable large language models and providers in the Tackle custom resource

LLM Provider (Tackle CR value)Large language model examples for Tackle CR configuration

OpenShift AI platform

Models that you deploy in an OpenShift AI cluster and access by using Open AI-compatible API

Open AI (openai)

gpt-4, gpt-4o, gpt-4o-mini, gpt-3.5-turbo

Azure OpenAI (azure_openai)

gpt-4, gpt-35-turbo

Amazon Bedrock (bedrock)

anthropic.claude-3-5-sonnet-20241022-v2:0, meta.llama3-1-70b-instruct-v1:0

Google Gemini (google)

gemini-2.0-flash-exp, gemini-1.5-pro

Ollama (ollama)

llama3.1, codellama, mistral

Additional resources

1.4. About the Agent AI

You can enable the Agent AI or the Solution Server mode to request AI-assisted code resolutions. In the agentic AI mode, Red Hat Developer Lightspeed for MTA streams an automated analysis of the code in a loop and makes changes in the code. In the initial run, the AI agent:

  • Plans the context to define the issues.
  • Chooses a suitable sub agent for the analysis task. Red Hat Developer Lightspeed for MTA works with the LLM to generate fix suggestions. The LLM displays the reasoning transcript and files to change.
  • Applies the changes to the code once you approve the updates.

If you accept that the agentic AI must continue to make changes, it compiles the code and runs a partial analysis. In this iteration, the agentic AI attempts to fix diagnostic issues (if any) generated by tools that you installed in the Visual Studio Code Integrated Development Environment (IDE). You can review the changes and accept the agentic AI’s suggestion to address these diagnostic issues.

After each iteration of applying changes to the code, the agentic AI asks if you want the agent to continue fixing more issues. When you accept, it runs another iteration of automated analysis until it has resolved all issues or it has made a maximum of two attempts to fix an issue.

Agentic AI generates a new preview in each iteration when it updates the code with the suggested resolutions. The time that the agentic AI takes to complete all iterations depends on the number of new diagnostic issues that it detects in the code.

1.5. Benefits of using Red Hat Developer Lightspeed for MTA

Red Hat Developer Lightspeed for migration toolkit for applications offers options to use large language models of your choice, LLM configuration control, and a platform engineering approach to standardize AI-assisted refactoring efforts for large codebases in your organization.

  • Model agnostic - Red Hat Developer Lightspeed for MTA follows a "Bring Your Own Model" approach, allowing your organization to use a preferred LLM.
  • Iterative refinement - Red Hat Developer Lightspeed for MTA can include an agent that iterates through the source code to run a series of automated analyses that resolves both the code base and diagnostic issues.
  • Contextual code generation - Red Hat Developer Lightspeed for MTA breaks down complex problems into more manageable ones, providing the LLM with focused context to generate meaningful results. This helps overcome the limited context size of LLMs when dealing with large codebases.
  • No fine tuning - You also do not need to fine tune your model with a suitable data set for analysis which leaves you free to use and switch LLM models to respond to your requirements.
  • Learning and Improvement - As Red Hat Developer Lightspeed for MTA migrates more parts of a codebase, it can use RAG to learn from the available data and give better recommendations in subsequent application analysis.

Chapter 2. Getting started with Red Hat Developer Lightspeed for MTA

You can view prerequisites, persistent volume requirements, installation, and workflows that help you to decide how you want to use the Red Hat Developer Lightspeed for migration toolkit for applications.

Note

To get support for features in Red Hat Developer Lightspeed for MTA, you require a Red Hat Advanced Developer Suite (RHADS) subscription.

2.1. Prerequisites

You can use the prerequisites required to successfully use the generative AI features in the Red Hat Developer Lightspeed for MTA Visual Studio Code extension.

Before you install Red Hat Developer Lightspeed for MTA, you must:

  • Install Language Support for Java™ by Red Hat extension
  • Install Java v17 and later
  • Install Maven v3.9.9 or later
  • Install Git and add it to the $PATH variable
  • Install the MTA Operator 8.0.0

    The MTA Operator is mandatory if you plan to enable the Solution Server that works with the large language model (LLM) for generating code changes. Use the Operator to log in to the openshift-mta project where you must enable the Solution Server in the Tackle custom resources (CR).

  • Create an API key for an LLM.

    You must enter the provider value and model name in Tackle CR to enable generative AI configuration in the MTA Visual Studio Code plugin.

    Table 2.1. Configurable large language models and providers

    LLM Provider (Tackle CR value)Large language model examples for Tackle CR configuration

    OpenShift AI platform

    Models that you deploy in an OpenShift AI cluster and access by using Open AI-compatible API.

    Open AI (openai)

    gpt-4, gpt-4o, gpt-4o-mini, gpt-3.5-turbo

    Azure OpenAI (azure_openai)

    gpt-4, gpt-35-turbo

    Amazon Bedrock (bedrock)

    anthropic.claude-3-5-sonnet-20241022-v2:0, meta.llama3-1-70b-instruct-v1:0

    Google Gemini (google)

    gemini-2.0-flash-exp, gemini-1.5-pro

    Ollama (ollama)

    llama3.1, codellama, mistral

Note

The LLM provider maintains the availability of public LLM models.

2.2. Persistent volume requirements

The Solution Server component requires a backend database to store code changes from earlier analyses.

If you plan to enable Solution Server, you must create a 5Gi ReadWriteOnce (RWO) persistent volume for the Red Hat Developer Lightspeed for MTA database.

Additional resources

2.3. Installation

You can install the migration toolkit for applications (MTA) 8.0.0 Visual Studio Code plugin from the Visual Studio Code marketplace.

You can use the MTA Visual Studio Code plugin to perform analysis and optionally enable Red Hat Developer Lightspeed for migration toolkit for applications to use generative AI capabilities. You can fix code issues before migrating the application to target technologies by using the generative AI capabilities.

Additional resources

2.4. Red Hat Developer Lightspeed for MTA workflows

You can configure the Red Hat Developer Lightspeed for MTA extension to use centralized configuration and the large language model (LLM) through an LLM proxy. Alternatively, you can configure the extension to use the LLM provider settings in your Visual Studio Code environment for code resolution suggestions.

Note

If you make any change in configuration after enabling the generative AI settings in the extension, you must restart the extension for the change to take effect.

The configuration workflow that you complete to use Red Hat Developer Lightspeed for MTA depends on the following factors:

  • Whether you prefer to connect the MTA extension to the LLM by using the LLM proxy.
  • Whether you want to use Agent AI for request resolutions without using LLM proxy.

You can complete one of the following workflows:

2.4.1. Workflow to use the Agent AI mode without the LLM proxy

As an Administrator, you must:

  • Create a tackle secret for your LLM key in the Red Hat OpenShift cluster.
  • Configure the Tackle custom resource (CR) to enable the LLM provider and the LLM model in the Tackle custom resource (CR).

As a Migrator, you can complete the following workflow to use the Agent AI mode for code resolutions:

  • Enable the generative AI in the MTA extension settings.
  • Configure a profile for the analysis.
  • Activate the LLM provider in the provider-settings.yaml file.
  • Enable the Agent AI and run an analysis to request code fix suggestion by using the Agent AI mode.

2.4.2. Workflow to use the LLM through the proxy service

You can allow client endpoints, for example, the MTA Visual Studio Code extension, to use the proxy service to access the large language models (LLMs). The client uses Keycloak credentials to authenticate to the MTA Hub. To authenticate to the LLM, the client sends a JSON Web Token (JWT) that Keycloak issues to the proxy service. The proxy service validates the client’s JWT against the Hub’s Keycloak instance.

The proxy service completes a separate authentication process to access the LLM through an Administrator-controlled endpoint. The proxy service authenticates to the LLM by using the cluster secret that has the LLM API key that the Administrator configured. Thus, the proxy service allows Administrators to create, manage, and rotate LLM API keys without the need to share the LLM key with multiple client endpoints.

After you enable the LLM proxy, you can use either the Solution Server or Agent AI to generate code resolution requests in the Integrated Development Environment (IDE) extension. To use the Solution Server, the Administrator must deploy it in the OpenShift cluster with the proxy service. You cannot use the Solution Server without the proxy service.

As an Administrator, you must complete the following workflow to enable the LLM proxy in the OpenShift cluster:

  • Create a tackle secret cluster.
  • Configure the Tackle custom resource (CR) to enable the LLM proxy service, enable the Solution Server if you want Migrators to use the Solution Server mode, and configure the LLM provider and the LLM model.

As a Migrator, you can:

  • Enable the generative AI in the MTA extension settings.
  • If you want to use the Agent AI mode for code resolutions, enable the Agent AI and run an analysis.
  • To use the Solution Server mode:

    1. Connect to the MTA Hub and run an analysis by using a profile downloaded from the Hub. See Running an application analysis by using a profile.
    2. Apply code resolutions that the Solution Server suggests.

2.5. Configuring the model secret key

You must configure the Kubernetes secret for the large language model (LLM) provider in the Red Hat OpenShift project where you installed the MTA Operator.

Note

You can replace oc in the following commands with kubectl.

Note

You must create a LLM API key secret in your OpenShift cluster to produce the resources necessary for the Solution Server. If you do not configure the LLM API key secret, Red Hat Developer Lightspeed for MTA does not create the resources necessary to run the Solution Server.

Procedure

  1. Create a credentials secret named kai-api-keys in the openshift-mta project.

    1. For Amazon Bedrock as the provider, type:

      oc create secret generic aws-credentials \
       --from-literal=AWS_ACCESS_KEY_ID=<YOUR_AWS_ACCESS_KEY_ID> \
       --from-literal=AWS_SECRET_ACCESS_KEY=<YOUR_AWS_SECRET_ACCESS_KEY>
    2. For Azure OpenAI as the provider, type:

      oc create secret generic kai-api-keys -n openshift-mta \
       --from-literal=AZURE_OPENAI_API_KEY='<YOUR_AZURE_OPENAI_API_KEY>'
    3. For Google as the provider, type:

      oc create secret generic kai-api-keys -n openshift-mta \
       --from-literal=GEMINI_API_KEY='<YOUR_GOOGLE_API_KEY>'
    4. For the OpenAI-compatible providers, type:

      oc create secret generic kai-api-keys -n openshift-mta \
       --from-literal=OPENAI_API_BASE='https://example.openai.com/v1' \
       --from-literal=OPENAI_API_KEY='<YOUR_OPENAI_KEY>'
      Note

      You can also set the base URL as the kai_llm_baseurl variable in the Tackle custom resource.

  2. (Optional) Force a reconcile so that the MTA operator picks up the secret immediately

    kubectl patch tackle tackle -n openshift-mta --type=merge -p \
    '{"metadata":{"annotations":{"konveyor.io/force-reconcile":"'"$(date +%s)"'"}}}'

2.6. Enabling LLM proxy in the Tackle custom resource

To use the LLM proxy service, you must enable the proxy in the Tackle custom resource (CR) and deploy it in the Red Hat OpenShift project where you installed the MTA Operator.

The proxy authenticates to the LLM in the backend by using the LLM secret that you configured in the cluster. This helps the Administrator to create, manage, and rotate the LLM key without sharing the key with many client endpoints, for example, MTA Integrated Development Environment (IDE) extension, in the organization.

Note

To use the Solution Server, the Administrator must enable it in the Tackle CR along with the proxy service. You cannot use the Solution Server without the proxy service.

Prerequisites

  • You deployed an additional ReadWriteOnce (RWO) volume for the Red Hat Developer Lightspeed for MTA-database if you want to use Red Hat Developer Lightspeed for MTA. See Persistent volume requirements for more information.
  • You installed the MTA Operator v8.1.0 or later.

Procedure

  1. Log in to the Red Hat OpenShift cluster and switch to the openshift-mta project.
  2. Create the Tackle CR in the tackle_hub.yaml file:

    vi tackle
  3. Enable kai_llm_proxy_enabled in the Tackle CR:

    ---
    kind: Tackle
    apiVersion: tackle.konveyor.io/v1alpha1
    metadata:
      name: mta
      namespace: openshift-mta
    spec:
      kai_llm_proxy_enabled: true
      kai_solution_server_enabled: true
      kai_llm_provider: <provider-name> #For example, OpenAI.
      # optional, pick a suitable model for your provider
      kai_llm_model: <model-name>
    ---
  4. Save the Tackle CR configuration.
  5. Apply the Tackle CR in the openshift-mta project:

     $ oc apply -f tackle_hub.yaml

Verification

  • Enter the following command to verify the Red Hat Developer Lightspeed for MTA resources deployed for Solution Server.

    $ oc get deploy,svc -n openshift-mta | grep -E 'kai-(api|db|importer)'
    Note

    When you enable Solution Server, the MTA Hub serves the Solution Server API endpoint. You need not complete any further task, such as creating a route for the Solution Server API.

2.7. Generating code fix suggestions

Generate code fixes for a Java application you want to migrate to the target technology quarkus. To stream code changes that resolve issues in the code, use the Agent mode and the my-model as the large language model (LLM) that you deployed in OpenShift AI.

Procedure

  1. Open the my-Java project in Visual Studio Code.
  2. Download the Red Hat Developer Lightspeed for migration toolkit for applications extension from the Visual Studio Code marketplace.
  3. Type Ctrl+Shift+P (Windows and Linux systems) or Cmd+Shift+P (Mac systems).
  4. Type Preferences: Open Settings (UI) in the Command Palette to open the Visual Studio Code settings and select Extensions > MTA.
  5. Select Gen AI:Agent Mode.
  6. In the Red Hat Developer Lightspeed for MTA extension, click Open Analysis View.
  7. Type MTA: Manage Analysis Profile in the Command Palette and configure the following fields:

    • Profile Name: Type a profile name
    • Target Technologies: quarkus
    • Custom Rules: Select custom rules if you want to include them while running the analysis. By default, Red Hat Developer Lightspeed for MTA enables Use Default Rules for quarkus.
  8. Type MTA: Open the Gen AI model provider configuration file in the Command Palette to configure the following in the provider-settings file:

    models:
      openshift-example-model: &active
        environment:
          OPENAI_API_KEY: "<Server's OPENAI_API_KEY>"
          CA_BUNDLE: "<Servers CA Bundle path>"
        provider: "ChatOpenAI"
        args:
          model: "my-model"
          configuration:
            baseURL: "https://<serving-name>-<data-science-project-name>.apps.konveyor-ai.example.com/v1"
    Note

    You must change the provider-setting configuration if you plan to use a different LLM provider.

  9. On the MTA: Open Analysis View page, click Start to start the MTA Remote Procedure Call (RPC) server.
  10. Select the profile you configured and click Run Analysis to scan the Java application.

    MTA identifies the issues in the code.

  11. Click the solutions icon ( Click solutions icon ) in an issue to request suggestions to resolve the issue.

    Red Hat Developer Lightspeed for MTA streams the issue description, a preview of the code changes in files that resolve the issue.

    You can review the code changes in the editor and accept or reject the changes. If you accept the changes, Red Hat Developer Lightspeed for MTA creates a new file with the accepted code changes.

  12. Click Continue to allow Red Hat Developer Lightspeed for MTA to run a follow-up analysis.

    This round of analysis detects lint issues, compilation issues, or diagnostic issues that can occur when you accepted the suggested code change.

    Repeat the review and accept or reject the resolutions. Red Hat Developer Lightspeed for MTA continues to run repeated iterations of scan if you allow until it resolves all issues.

Chapter 3. Configuring large language models for analysis

Red Hat Developer Lightspeed for MTA provides the large language model (LLM) with the contextual prompt, migration hints, and solved examples to generate suggestions for resolving issues identified in the current code.

Red Hat Developer Lightspeed for MTA is model agnostic. It works with LLMs that are run in different environments (in local containers, as local AI, or as a shared service) to support analyzing Java applications in a wide range of scenarios. You can choose an LLM from well-known providers, local models that you run from Ollama or Podman desktop, and OpenAI API compatible models.

The code fix suggestions that the LLM produces to resolve issues from an analysis depend on the LLM’s capabilities.

You can run an LLM from the following generative AI providers:

  • OpenAI
  • Azure OpenAI
  • Google Gemini
  • Amazon Bedrock
  • Ollama

You can also run OpenAI API-compatible LLMs deployed as:

  • A service in your OpenShift AI cluster
  • Locally in the Podman AI Lab in your system.

3.1. Deploying an LLM as a service in an OpenShift AI cluster

The code suggestions from Red Hat Developer Lightspeed for migration toolkit for applications differ based on the large language model (LLM) that you use. Therefore, you may want to use an LLM that caters to your specific requirements.

Red Hat Developer Lightspeed for MTA integrates with LLMs that you deployed as a scalable service on OpenShift AI clusters. These deployments give you granular control over resources such as compute, cluster nodes, and auto-scaling Graphical Processing Units (GPUs) while enabling you to use LLMs to resolve code issues at a large scale.

An example workflow for configuring an LLM service on OpenShift AI broadly requires the following configurations:

  • Installing and configuring the following infrastructure resources:

    • Red Hat OpenShift cluster and installing the OpenShift AI Operator
    • Configure a GPU machineset
    • (Optional) Configure an auto scaler custom resource (CR) and a machine scaler CR
  • Configuring OpenShift AI platform

    • Configure a data science project
    • Configure a serving runtime
    • Configure an accelerator profile
  • Deploying the LLM through OpenShift AI

    • Uploading your model to an AWS compatible bucket
    • Add a data connection
    • Deploy the LLM in your OpenShift AI data science project
    • Export the SSL certificate, OPENAI_API_BASE URL and other environment variables to access the LLM
  • Preparing the LLM for analysis

    • Configure an OpenAI API key
    • Update the OpenAI API key and the base URL in provider-settings.yaml.

Additional resources

3.2. Configuring LLM provider settings

Red Hat Developer Lightspeed for migration toolkit for applications is large language model (LLM) agnostic and integrates with an LLM of your choice. To enable Red Hat Developer Lightspeed for MTA to access your large language model (LLM), you must enter the LLM provider configurations in the provider-settings.yaml file.

The provider-settings.yaml file has a list of LLM providers that Red Hat Developer Lightspeed for MTA supports by default. The mandatory environment variables are different for each LLM provider. Depending on the provider that you choose, you can configure additional environment variables for a model in the provider-settings.yaml file. You can also enter a new provider with the required environment variables, the base URL, and the model name.

You can find the provider settings file in the Red Hat Developer Lightspeed for MTA Visual Studio Code extension.

Access the provider-settings.yaml from the Visual Studio Code Command Palette by typing Open the GenAI model provider configuration file.

Note

You can select one provider from the list by using the &active anchor in the name of the provider. To use a model from another provider, move the &active anchor to one of the desired provider blocks.

For a model named "my-model" deployed in OpenShift AI with "example-model" as the serving name:

models:
  openshift-example-model: &active
    environment:
      CA_BUNDLE: "<Servers CA Bundle path>"
    provider: "ChatOpenAI"
    args:
      model: "my-model"
      configuration:
        baseURL: "https://<serving-name>-<data-science-project-name>.apps.konveyor-ai.example.com/v1"
Note

When you change the model deployed in OpenShift AI, you must also change the model argument and the baseURL endpoint.

Note

If you want to select a public LLM provider, you must move the &active anchor to the desired block and change the provider arguments.

For an OpenAI model:

OpenAI: &active
    environment:
      OPENAI_API_KEY: "<your-API-key>" # Required
    provider: ChatOpenAI
    args:
      model: gpt-4o # Required

For Azure OpenAI:

AzureChatOpenAI: &active
    environment:
      AZURE_OPENAI_API_KEY: "" # Required
    provider: AzureChatOpenAI
    args:
      azureOpenAIApiDeploymentName: "" # Required
      azureOpenAIApiVersion: "" # Required

For Amazon Bedrock:

AmazonBedrock: &active
    environment:
      ## May have to use if no global `~/.aws/credentials`
      AWS_ACCESS_KEY_ID: "" # Required if a global ~/.aws/credentials file is not present
      AWS_SECRET_ACCESS_KEY: "" # Required if a global ~/.aws/credentials file is not present
      AWS_DEFAULT_REGION: "" # Required
    provider: ChatBedrock
    args:
      model: meta.llama3-70b-instruct-v1:0 # Required
Note

You can use the AWS CLI to verify that you have command line access to AWS services before you proceed with the provider-settings configurations.

For Google Gemini:

GoogleGenAI: &active
    environment:
      GOOGLE_API_KEY: "" # Required
    provider: ChatGoogleGenerativeAI
    args:
      model: gemini-2.5-pro # Required

For Ollama:

models:
  ChatOllama: &active
    provider: "ChatOllama"
    args:
      model: "granite-code:8b-instruct"
      baseUrl: "127.0.0.1:11434" # example URL

Additional resources

3.3. Configuring the LLM in Podman Desktop

Use the Podman AI lab extension to select an open source model from a curated list of models and run it locally in your system.

The code fix suggestions that a model generates depend on the model’s capabilities. Models from the Podman AI Lab are insufficient for the complexity of code changes needed to fix issues that MTA discovers. You must not use such models in a production environment.

Prerequisites

  • You installed Podman Desktop in your system.
  • You completed initial configurations in Red Hat Developer Lightspeed for MTA required for the analysis.

Procedure

  1. Go to the Podman AI Lab extension and click Catalog under Models.
  2. Download one or more models.
  3. Go to Services and click New Model Service.
  4. Select a model that you downloaded in the Model drop down menu and click Create Service.
  5. Click the deployed model service to open the Service Details page.
  6. Note the server URL and the model name. You must configure these specifications in the Red Hat Developer Lightspeed for MTA extension.
  7. Export the inference server URL as follows:

    export OPENAI_API_BASE=<server-url>
  8. In the Red Hat Developer Lightspeed for MTA extension, type Open the GenAI model provider configuration file in the Command Palette to open the provider-settings.yaml file.
  9. Enter the model details from Podman Desktop. For example, use the following configuration for a Mistral model.

    podman_mistral: &active
        provider: "ChatOpenAI"
        environment:
          OPENAI_API_KEY: "unused value"
        args:
         model: "ibm-granite/granite-3.3-8b-instruct-GGUF"
         configuration:
           baseURL: "http://localhost:56885/v1"
    Note

    The Podman Desktop service endpoint does not need a password but the OpenAI library expects the OPENAI_API_KEY to be set. In this case, the value of the OPENAI_API_KEY variable does not matter.

Additional resources

Chapter 4. Using MTA with Developer Lightspeed in an IDE

As a Migrator, you must configure the Visual Studio Code Integrated Development Environment (IDE) to use the Red Hat Developer Lightspeed for migration toolkit for applications plugin to run application analyses and generate code resolution suggestions.

You must configure the following settings in Red Hat Developer Lightspeed for MTA:

  • Visual Studio Code IDE settings.
  • Profile settings that give context before you request a code fix for a particular application.

4.1. Configuring the Red Hat Developer Lightspeed for MTA IDE settings

Configure the Visual Studio Code Integrated Development Environment (IDE) settings to perform analyses and AI-assisted code resolutions. You can broadly categorize the extension settings into debugging and logging, Red Hat Developer Lightspeed for MTA settings, analysis settings, and Solution Server settings.

After you install the MTA extension in Visual Studio Code, you must enter your large language model (LLM) credentials to use Red Hat Developer Lightspeed for MTA in the Visual Studio Code IDE.

Prerequisites

In addition to the overall prerequisites, you have configured the following:

  • You completed the Solution Server configurations in Tackle custom resource if you opt to use the Solution Server.

Procedure

  1. Go to the Red Hat Developer Lightspeed for MTA settings in one of the following ways:

    1. Click Extensions > Migration toolkit for applications Extension > Settings
    2. Type Ctrl+Shift+P or Cmd+Shift+P on the search bar to open the Command Palette and enter Preferences: Open Settings (UI). Go to Extensions > MTA to open the settings page.
  2. Configure the settings described in the following table:

    Table 4.1. Red Hat Developer Lightspeed for MTA extension settings

    SettingsDescription

    Log level

    Set the log level for the MTA binary. The default log level is debug. The log level increases or decreases the verbosity of logs.

    Analyzer path

    Specify an MTA custom binary path. If you do not give a path, Red Hat Developer Lightspeed for MTA uses the default path to the binary.

    Auto Accept on Save

    Red Hat Developer Lightspeed for MTA enables this option by default. When you accept the changes that the LLM suggests, Red Hat Developer Lightspeed for MTA automatically saves the updated code in a new file. Disable this option if you want to manually save the new file after accepting the code changes.

    Gen AI:Enabled

    Red Hat Developer Lightspeed for MTA enables this option by default. You can get code fixes by using Red Hat Developer Lightspeed for MTA with a large language model.

    Gen AI: Agent mode

    Enable the experimental Agentic AI flow for analysis. Red Hat Developer Lightspeed for MTA runs an automated analysis of a file to identify issues and suggest resolutions. After you accept the solutions, Red Hat Developer Lightspeed for MTA makes the changes in the code and re-analyzes the file.

    Gen AI: Excluded diagnostic sources

    Add diagnostic sources in the settings.json file. Red Hat Developer Lightspeed for MTA excludes the issues that such diagnostic sources generate from the automated Agentic AI analysis.

    Cache directory

    Specify the path to a directory in your filesystem to store cached responses from the LLM.

    Trace directory

    Configure the absolute path to the directory that has the saved LLM interaction.

    Trace enabled

    Enable to trace MTA communication with the LLM model. Red Hat Developer Lightspeed for MTA stores traces in the trace directory that you configured.

    Demo mode

    Enable to run Red Hat Developer Lightspeed for MTA in demo mode that uses the LLM responses from the cache directory for analysis.

    Debug:Webview

    Enable debug level logging for Webview message handling in Visual Studio Code.

4.2. Configuring the Red Hat Developer Lightspeed for MTA profile settings

To perform repeated analyses, you can create a reusable profile configuration. You can use the profile you configure in your Integrated Development Environment (IDE).

Prerequisites

  • You completed the Solution Server configurations in Tackle custom resource if you opt to use the Solution Server.
  • You opened a project in your Visual Studio Code workspace.

Procedure

  1. Open the MTA View Analysis page in either of the following ways:

    1. Click the book icon on the MTA: Issues pane of the MTA extension.
    2. Type Ctrl + Shift + P or Cmd + Shift + P on the search bar to open the Command Palette and enter MTA:Open Analysis View.
  2. Click the settings button on the MTA View Analysis page to configure a profile for your project.

    The Get Ready to Analyze pane lists the profile configuration options.

    Table 4.2. Red Hat Developer Lightspeed for MTA profile settings

    Profile settingsDescription

    Select profile

    Create a profile. The profile name is part of the context provided to the LLM for analysis.

    Configure label selector

    A label selector filters rules for analysis based on the source or target technology.

    Specify one or more target or source technologies (for example, cloud-readiness). Red Hat Developer Lightspeed for MTA uses this configuration to determine the rules to apply to a project during analysis.

    If you mentioned a new target or a source technology in your custom rule, you can type that name to create and add the new item to the list.

    Note

    You must configure either target or source technologies for running an analysis.

    Set rules

    Enable default rules and select your custom rule that you want MTA to use for an analysis. You can use the custom rules in addition to the default rules.

    Configure generative AI

    This option opens the provider-settings.yaml file that has API keys and other parameters for all supported LLMs. By default, Red Hat Developer Lightspeed for MTA uses OpenAI LLM. To change the model, update the anchor &active to the desired block. Modify this file with the required arguments, such as the model and API key, to complete the setup.

Verification

After you complete the profile configuration:

  1. Open MTA Analysis View.
  2. Click Run Analysis to verify that your configuration works by running an analysis.

Chapter 5. Running an analysis and resolving issues

After you complete the configurations, the next step is running an analysis to identify the issues in the code and generate suggestions to resolve the issues.

When you request code fix suggestions, Red Hat Developer Lightspeed for MTA performs the following tasks:

  • Streams LLM messages that describe the issue description, resolution, and the file in which Red Hat Developer Lightspeed for MTA applies the updates.
  • Generates new files in the Resolutions pane. These files have the updates to the code to resolve the issues detected in the current analysis. You can review the changes, apply, or revert the updates.

If you apply all the resolutions, Red Hat Developer Lightspeed for MTA applies the changes and triggers another analysis to check if there are more issues. Subsequent analysis reports fewer issues and incidents.

5.1. Applying resolutions generated by the solution server

When you request code resolutions by enabling the Solution Server, an issue displays the success metric when the metric becomes available. A success metric indicates the confidence level in applying the fix suggestion from the LLM based on how many times you applied the update in past analyses.

You can review the code updates and edit the suggested code resolutions before accepting the suggestions.

Prerequisites

  • You opened a Java project in your Visual Studio Code workspace.
  • You configured a profile on the MTA Analysis View page.
  • You ran an analysis after enabling the Solution Server.

Procedure

  1. Review the issues from the Analysis results space of the MTA view analysis page by the following tabs:

    1. All: lists all incidents identified in your project.
    2. Files: lists all the files in your project for which the analysis identified issues that you must resolve.
    3. Issues: lists all issues across different files in your project.
  2. Use the Category drop down to filter issues based on how crucial the fix is for the target migration. You can filter mandatory, potential, and optional issues.
  3. Click Has Success Rate to check how many times you accepted the same issue resolution in an earlier analysis.
  4. Click the solution tool to trigger automated updates to your code. If you applied any category filter, Red Hat Developer Lightspeed for MTA makes code updates for all incidents, specific files, or specific issues based on the filter. Red Hat Developer Lightspeed for MTA generates new files with the updated code.
  5. Review and (optionally) edit the code.
  6. Click Apply all in the Resolutions pane to permanently apply the changes to your code.

5.2. Generating code resolutions in the agent mode

As a Migrator, you can use the agent mode to run an automated analysis that streams the code resolutions that the agent can apply to your source code. When using the agent mode, you can reject the changes or stop the stream but you cannot edit the updated files during the stream.

The agent detects new issues in the code that may have occurred because of the earlier accepted changes or diagnostic issues that your tool may generate following an earlier analysis. If you allow the process to continue, Red Hat Developer Lightspeed for MTA runs the stream again and generates a new file with the latest updates.

Prerequisites

  • You opened a Java project in your Visual Studio Code workspace.
  • You configured an analysis profile on the MTA Analysis View page.

Procedure

  1. Enable the agent mode in one of the following ways:

    1. Open the MTA Analysis View page.
    2. Enable the Agent Mode on.

      OR

    3. Go to Extensions > MTA-core > GenAI: Agent Mode
    4. Select the Agent Mode checkbox.
  2. Click the Red Hat Developer Lightspeed for MTA extension and click Open MTA Analysis View.
  3. Select a profile for the analysis.
  4. Click Start to start the MTA Remote Procedure Call (RPC) server.
  5. Click Run Analysis on the MTA Analysis View page. The Resolution Details tab opens, where you can view the automated analysis that makes changes in applicable files.
  6. Click the Review Changes option to open the editor that shows the diff view of the modified file.
  7. Review the changes and click Apply to update the file with all the changes or Reject to reject all changes. If you applied the changes, then Red Hat Developer Lightspeed for MTA creates the updated file with code changes.
  8. Open Source Control to access the updated file.
  9. In the Resolution Details view, accept the proposal from Red Hat Developer Lightspeed for MTA to make further changes. The stream of analysis repeats, after which you can review and accept the changes. Red Hat Developer Lightspeed for MTA creates the file with the code changes, and the stream continues until you reject the proposal for further analysis.

Chapter 6. Debugging Red Hat Developer Lightspeed for MTA

Red Hat Developer Lightspeed for migration toolkit for applications generates logs to debug issues specific to the extension host and the MTA analysis and Remote Procedure Call (RPC) server. You can also configure the log level for the Red Hat Developer Lightspeed for MTA in the extension settings. The default log level is debug.

Red Hat Developer Lightspeed for MTA stores extension logs as extension.log with automatic rotation. The maximum size of the log file is 10 MB and Red Hat Developer Lightspeed for MTA retains three files. Red Hat Developer Lightspeed for MTA stores analyzer RPC logs as analyzer.log without rotation.

6.1. Archiving the logs

To archive the logs as a zip file, type MTA: Generate Debug Archive in the Visual Studio Code Command Palette and select the information type to archive as a log file.

The archive command allows capturing all relevant log files in a zip archive at the specified location in your project. By default, you can access the archived logs in the .vscode directory of your project.

The archival feature helps you to save the following information:

  • Large language model (LLM) provider configuration: Fields from the provider settings that you can include in the archive. Red Hat Developer Lightspeed for MTA redacts all fields for security reasons by default. Ensure that you do not expose any secrets.
  • LLM model arguments
  • LLM traces: If you enabled tracing LLM interactions, you can choose to include LLM traces in the logs.

6.2. Accessing the logs

You can access the logs in the following ways:

  • Log file: Type Developer: Open Extension Logs Folder and open the redhat.mta-vscode-extension directory that has the extension log and the analyzer log.
  • Output panel: Select Red Hat Developer Lightspeed for MTA from the drop-down menu.
  • Webview logs: You can also inspect webview content by using the webview logs. To access the webview logs, type Open Webview Developer Tools in the Visual Studio Code Command Palette.

Legal Notice

Copyright © 2026 Red Hat, Inc.
The text of and illustrations in this document are licensed by Red Hat under a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is available at http://creativecommons.org/licenses/by-sa/3.0/. In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must provide the URL for the original version.
Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.
Red Hat, Red Hat Enterprise Linux, the Shadowman logo, the Red Hat logo, JBoss, OpenShift, Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.
Linux® is the registered trademark of Linus Torvalds in the United States and other countries.
Java® is a registered trademark of Oracle and/or its affiliates.
XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries.
MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other countries.
Node.js® is an official trademark of Joyent. Red Hat is not formally related to or endorsed by the official Joyent Node.js open source or commercial project.
The OpenStack® Word Mark and OpenStack logo are either registered trademarks/service marks or trademarks/service marks of the OpenStack Foundation, in the United States and other countries and are used with the OpenStack Foundation's permission. We are not affiliated with, endorsed or sponsored by the OpenStack Foundation, or the OpenStack community.
All other trademarks are the property of their respective owners.