Configuring AI providers

Enable one or more AI providers in Che so that users can select an AI coding assistant from the Create Workspace page and have the tool binary injected into the workspace editor container.

The AI tool registry is stored in a Kubernetes ConfigMap with specific labels. When the ConfigMap exists and contains at least one provider with a matching tool, the AI Selector widget is displayed on the dashboard. When the ConfigMap is absent or empty, the widget is hidden.

Prerequisites
  • An active kubectl session with administrative permissions to the destination Kubernetes cluster. See Overview of kubectl.

  • The che-operator is installed and a eclipse-che custom resource exists in the eclipse-che namespace.

Procedure
  1. Create a registry.json file defining providers, tools, and default selections:

    {
      "providers": [
        {
          "id": "google/gemini",
          "name": "Gemini",
          "publisher": "Google",
          "description": "Google Gemini AI assistant for the terminal.",
          "docsUrl": "https://ai.google.dev/gemini-api/docs/quickstart",
          "icon": "https://example.com/gemini-icon.svg"
        },
        {
          "id": "anthropic/claude",
          "name": "Claude",
          "publisher": "Anthropic",
          "description": "Anthropic Claude AI coding assistant for terminal.",
          "docsUrl": "https://docs.anthropic.com/claude/reference/getting-started-with-the-api",
          "icon": "https://example.com/claude-icon.svg"
        }
      ],
      "tools": [
        {
          "providerId": "google/gemini",  (1)
          "tag": "next",                  (2)
          "name": "Gemini CLI",
          "url": "https://ai.google.dev/gemini-api/docs",
          "binary": "gemini",             (3)
          "pattern": "bundle",            (4)
          "injectorImage": "quay.io/example/gemini-cli:next",  (5)
          "envVarName": "GEMINI_API_KEY"   (6)
        },
        {
          "providerId": "anthropic/claude",
          "tag": "next",
          "name": "Claude Code",
          "url": "https://claude.ai/code",
          "binary": "claude",
          "pattern": "init",
          "injectorImage": "quay.io/example/claude-code:next",
          "envVarName": "ANTHROPIC_API_KEY"
        }
      ],
      "defaultAiProviders": ["google/gemini"]  (7)
    }
    1 Links the tool to a provider by the provider’s id.
    2 Version tag. When multiple tools share the same providerId, the dashboard selects by tag priority: next > latest > highest semver.
    3 Binary name available in PATH after injection.
    4 Injection pattern: init copies a single binary; bundle copies a full runtime directory and creates a symlink.
    5 Container image used as an init container to copy the tool binary into a shared volume.
    6 Environment variable name for the API key. The dashboard creates a Kubernetes Secret with this key.
    7 Optional. List of provider IDs pre-selected in the AI Selector widget for new workspaces.
  2. Create the ConfigMap in the eclipse-che namespace with the required labels:

    $ kubectl create configmap ai-tool-registry \
      --from-file=registry.json=registry.json \
      -n eclipse-che \
      --dry-run=client -o yaml | \
      kubectl label --local -f - \
        app.kubernetes.io/component=ai-tool-registry \
        app.kubernetes.io/part-of=che.eclipse.org \
        -o yaml | \
      kubectl apply -f -
Verification
  1. Open the Che dashboard.

  2. Navigate to Create Workspace.

  3. Verify that an AI Provider section is visible, listing the providers you configured.

To disable the AI Selector widget, delete the ai-tool-registry ConfigMap. Users will no longer see the AI Provider section on the Create Workspace page. Existing API key Secrets in user namespaces are not deleted automatically.

When an administrator updates the registry (for example, removes a tool or changes the injector image tag), existing workspaces are updated automatically before their next start. The dashboard removes stale tool injectors and replaces outdated image tags without user intervention.