codex icon indicating copy to clipboard operation
codex copied to clipboard

Feature: Implement Extensible Provider Framework & Add Google Vertex AI Support with ADC

Open braingu-matt opened this issue 7 months ago • 3 comments

1. Background & Problem Statement

The current provider mechanism in codex-cli presents challenges when trying to integrate new LLM providers, especially those that use authentication methods other than simple API keys (e.g., OAuth-based flows like Google Cloud's Application Default Credentials). This limits the tool's flexibility and adaptability to different AI ecosystems.

A significant gap is the lack of support for Google Cloud Vertex AI. This prevents users from leveraging Google's Gemini models directly within their own GCP workspaces, where they might have specific requirements for data governance, security, and using AI services that meet compliance standards (such as FEDRAMP High for the underlying Vertex AI services).

2. Proposed Solution / Feature Request

This issue proposes enhancing codex-cli to:

  • Develop an Extensible Provider Framework: Refactor the existing system to create a more abstract and flexible architecture. This new framework should make it easier to add and manage different LLM providers with varying API structures and authentication requirements in the future.
  • Introduce Google Vertex AI as a Supported Provider:
    • Enable users to select "Vertex AI" as a provider.
    • Implement authentication using Google Cloud's Application Default Credentials (ADC), allowing for secure access via gcloud user credentials, service accounts, or compute identities.
    • Allow users to specify their Google Cloud Project ID and desired region/location for Vertex AI services.
    • Support the use of Google's Gemini models available through Vertex AI, including streaming responses for an interactive user experience.
    • Provide a user-friendly way to map common model aliases (e.g., "gpt-4") to appropriate Gemini model names if desired.
  • Provide Clear Documentation: Update user documentation to detail how to configure and use the new Vertex AI provider, including setup for authentication and any necessary environment configuration.

3. Acceptance Criteria

  • A new, more extensible provider framework is integrated into codex-cli.
  • Users can successfully select, configure, and use Google Vertex AI (with Gemini models) as an LLM provider within codex-cli.
  • Authentication to Vertex AI is achieved securely using Application Default Credentials.
  • Streaming of responses from Vertex AI models is functional.
  • Users can easily set their Google Cloud Project ID and location for Vertex AI.
  • Documentation clearly explains the setup and usage of the Vertex AI provider.
  • The changes are accompanied by relevant unit tests to ensure stability and correctness.

4. Benefits

  • Broader LLM Access: Enables users to utilize Google's advanced Gemini models via Vertex AI.
  • Improved Extensibility: Creates a foundation that simplifies the future integration of other LLM providers.
  • Enhanced Security for Vertex AI: Leverages Google's standard and secure ADC mechanism, integrating well with IAM for permission management.
  • Support for Compliance-Aware Workflows: Allows codex-cli to be used with Vertex AI services that are suitable for environments with stringent compliance requirements (e.g., where the underlying AI service needs to be FEDRAMP High authorized).
  • Increased Tool Flexibility: Provides users with more choices for their AI development workflows.

braingu-matt avatar May 24 '25 18:05 braingu-matt

+1000

vannarho-fas avatar May 25 '25 02:05 vannarho-fas

This feature would literally open the door for 80+ engineers at our company to jump from Claud code to codex (which some are already keen to do given the promising results of GPT5)

craigeee avatar Sep 05 '25 20:09 craigeee

@braingu-matt @craigeee - have you tried https://jules.google if vertex is the chosen platform to use?

vannarho-fas avatar Sep 06 '25 03:09 vannarho-fas

I currently have codex configured with Gemini model, and it work, however going thru vertex would be awesome

atlasoft avatar Oct 18 '25 05:10 atlasoft

+1

tmcpro avatar Oct 20 '25 17:10 tmcpro