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.
- Implementation of a generic
AIProvider or AIClient interface, of which the existing OpenAIClient will both satisfy and remain the default.
- A new
CliAIClient that will support local Claude Code and Github Copilot CLI support.
- 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.
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.
AIProviderorAIClientinterface, of which the existingOpenAIClientwill both satisfy and remain the default.CliAIClientthat will support local Claude Code and Github Copilot CLI support.AnthropicClientthat 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 toopenaiif not otherwise set. The other two options will remain stubs for now.Second phase, I'll implement the
--ai-provider=cliflag, 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.