chatgpt-cli icon indicating copy to clipboard operation
chatgpt-cli copied to clipboard

Any interest in support Claude?

Open justengland opened this issue 1 year ago • 3 comments

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

justengland avatar Jul 25 '24 15:07 justengland

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

kardolus avatar Jul 29 '24 14:07 kardolus

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.

justengland avatar Jul 29 '24 16:07 justengland

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 avatar Jul 30 '24 12:07 kardolus

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 avatar Aug 17 '24 14:08 kardolus

I just cut 1.6.3 with the new debug option.

kardolus avatar Aug 17 '24 15:08 kardolus

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 avatar Aug 17 '24 17:08 kardolus

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.

kardolus avatar Aug 17 '24 20:08 kardolus

Now also supporting Llama :)

kardolus avatar Sep 16 '24 23:09 kardolus

I will be releasing an aichat (still thinking of a good name) somewhere in the upcoming months that will also be supporting Claude

kardolus avatar Sep 18 '24 12:09 kardolus