kardolus / chatgpt-cli

ChatGPT CLI is a versatile tool for interacting with ChatGPT models via OpenAI and Azure, as well as with models from Perplexity AI. It offers streaming, query mode, and history tracking for seamless, context-aware interactions. With extensive configuration options, it’s designed for both users and developers to create a tailored GPT experience.
MIT License
454 stars 32 forks source link

Any interest in support Claude? #56

Open justengland opened 1 month ago

justengland commented 1 month ago

Seems like there are some new models like claude and llama3.1 that are pretty exciting, is there any interest in supporting them?

kardolus commented 1 month ago

Absolutely. Have been busy these last few months. Would love to add support for other APIs.

justengland commented 1 month ago

Seems like the client/client.go is the file currently used to interface with the open ai api. Seems like to support multiple api's an abstract factory or some sort of light abstraction is needed, as I look at the api's they seem similar but not identical. I dont mind lending a hand if we could agree on a path forward.

kardolus commented 1 month ago

I think that makes sense. Would love your help on this. Let me find some time to play around with the perplexity API which seems super similar as well.

kardolus commented 3 weeks ago

I started putting together some perplexity documentation: https://github.com/kardolus/chatgpt-cli/blob/main/docs/perplexity_api.md

Before proceeding I will add a --debug flag that prints raw request data and responses. I think that will come in handy when talking to different APIs. I am not super happy with the name chatgpt-cli if we are going to support perplexity and claud. But that's a bridge we don't have to cross right now.

kardolus commented 3 weeks ago

I just cut 1.6.3 with the new debug option.

kardolus commented 3 weeks ago

I am super stoked. Actually got it to work with perplexity! See the latest README on the main branch. I still have to cut a release though. I needed to omit presence and frequency penalties in case they were 0. So I had to implement my own marshaller.

I will try playing with Claude later on.

kardolus commented 3 weeks ago

The anthropic API is incompatible with the ChatGPT API: https://github.com/kardolus/chatgpt-cli/blob/main/docs/anthropic_api.md

So yeah, we would have to write anthropic specific code. Kind of a bummer. The code as is works with perplexity, chatgpt and azure openai service.

Supporting this new API would require an interface for the client. We would have to pick the right implementation during runtime based on configuration. Definetely doable, but it would have been nice if it just worked :).

I may do this in a fork.