The Ansible Coding Assistant (the Ansible VS Code extension's AI completion feature) supports Bring Your Own Model (BYOM), and Google Gemini/Vertex is a supported backend as of AAP 2.6+. Below is a minimal, working configuration for pointing the Coding Assistant at a Gemini endpoint.

Example: VS Code settings.json

{
  "ansible.lightspeed.enabled": true,
  "ansible.lightspeed.provider": "byom",
  "ansible.lightspeed.byom.type": "google-gemini",
  "ansible.lightspeed.byom.model": "gemini-1.5-pro",
  "ansible.lightspeed.byom.endpoint": "https://generativelanguage.googleapis.com/v1beta",
  "ansible.lightspeed.byom.projectId": "my-gcp-project-id",
  "ansible.lightspeed.byom.region": "us-central1",
  "ansible.lightspeed.byom.credentialsSecretName": "gemini-api-credentials"
}

Example: Ansible playbook to provision the API credential

Teams typically manage the Gemini API key as a secret consumed by the AAP controller/gateway rather than hardcoding it in VS Code. A simple playbook to push that credential into AAP via the ansible.controller collection looks like this:

---
- name: Register Google Gemini credential for the Coding Assistant
  hosts: localhost
  gather_facts: false
  vars:
    controller_host: "https://aap.example.com"
    controller_username: "admin"
    controller_password: "{{ lookup('env', 'CONTROLLER_PASSWORD') }}"
  tasks:
    - name: Create Gemini API credential
      ansible.controller.credential:
        name: "gemini-api-credentials"
        credential_type: "External Secret Management"
        organization: "Default"
        inputs:
          gcp_project_id: "my-gcp-project-id"
          gcp_region: "us-central1"
          api_key: "{{ lookup('env', 'GEMINI_API_KEY') }}"
        controller_host: "{{ controller_host }}"
        controller_username: "{{ controller_username }}"
        controller_password: "{{ controller_password }}"

What this does

The settings.json block tells the Ansible VS Code extension to skip the default Red Hat AI-hosted backend and route Coding Assistant inline suggestions (task name completions, module argument scaffolding, playbook boilerplate) to a Gemini model instead. The byom.type field selects the Google Gemini/Vertex provider; projectId and region are required because Gemini access on Vertex AI is scoped to a GCP project and region, not just an API key.

The playbook stores the actual Gemini API key as an AAP credential rather than in plaintext in the editor config. The Coding Assistant then references that credential by name (credentialsSecretName) when the extension authenticates through the AAP gateway, keeping the key out of version-controlled workspace settings.

Notes / Gotchas

  • Per the BYOM provider matrix shown at Red Hat Tech Day Netherlands 2026 (Bunnik, 3 June 2026), Google Gemini/Vertex support for the Coding Assistant requires AAP 2.6 or later — it is separate from the Intelligent Assistant chatbot, where Gemini/Vertex support is still listed as "Coming Soon."
  • IBM watsonx was the first external (non-Red Hat AI) provider supported by the Coding Assistant, on AAP 2.5+. OpenAI and Azure OpenAI support for the Coding Assistant is also "Coming Soon" as of this writing — only Red Hat AI, watsonx, and Gemini/Vertex are currently supported backends for code completion.
  • Don't confuse Coding Assistant BYOM settings with Intelligent Assistant provider config — they're configured independently, and provider availability differs between the two features.
  • If you also plan to use BYOK (Bring Your Own Knowledge, currently Tech Preview) to ground the Intelligent Assistant's RAG pipeline in your own runbooks and compliance procedures (PCI-DSS, HIPAA, SOC2, etc.), that's a separate feature from BYOM and only applies to the chatbot, not the Coding Assistant.
  • Rotate the Gemini API key through the AAP credential object, not the VS Code settings file, so the change propagates without editing every developer's workspace.

Once settings.json points at your Gemini backend and the credential resolves through AAP, the Coding Assistant switches from the default Red Hat AI model to Gemini for all inline suggestions with no further extension changes needed.

References