Skip to content

Alternative AI Providers #97

Description

@jgrancell

The support that is currently built into Gonzo for OpenAI complatible APIs is great, but i'd like to propose a change that let us expand the compatibility to pretty much any AI service, selfhosted or otherwise.

  1. Implementation of a generic AIProvider or AIClient interface, of which the existing OpenAIClient will both satisfy and remain the default.
  2. A new CliAIClient that will support local Claude Code and Github Copilot CLI support.
  3. A new AnthropicClient that will support the Anthropic API, for people that use Claude and its derivatives.

I propose rolling this out in 3 phases -- the first of which is where I implement the generic interface and ensure everything stays defaulted to OpenAI to not break any current implementations. This would add a flag like --ai-provider=(openai|anthropic|cli), and would default to openai if not otherwise set. The other two options will remain stubs for now.

Second phase, I'll implement the --ai-provider=cli flag, and a --ai-cli-binary=(claude|copilot) or similar flag to define which CLI helper we want to use. That will let us invoke and send context to either the claude or copilot CLI binary, for people that use those (such as myself).

Third phase, we can implement an Anthropic or other OpenAI-incompatible API or accept PRs for the same, allowing for anyone to contribute code for whatever novel AI APIs they are interested in working with.

If this is something you'd like to move forward with i'm happy to put together the PRs, or we can discuss further.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions