sunner / ChatALL

Concurrently chat with ChatGPT, Bing Chat, Bard, Alpaca, Vicuna, Claude, ChatGLM, MOSS, 讯飞星火, 文心一言 and more, discover the best answers
http://chatall.ai
Apache License 2.0
14.78k stars 1.6k forks source link

[FEAT] Support Claude console #528

Open scrollop opened 10 months ago

scrollop commented 10 months ago

Is your feature request related to a problem? / 你想要的功能和什么问题相关?

Is it possible to add Claude console capability?

I signed up to the claude api a few months ago and use claude via https://console.anthropic.com/chat

Apparently anhropic may limit claude via the claude.ai site in the future, so it would be nice to have the console.anhropic.com access.

Thanks

Describe the solution you'd like. / 你想要的解决方案是什么?

Potentially add.

Describe alternatives you've considered. / 你考虑过的其他方案是什么?

No response

Additional context / 其他信息

No response

ishaan-jaff commented 10 months ago

Hi @sunner I believe I can help with this issue. I’m the maintainer of LiteLLM https://github.com/BerriAI/litellm - we allow you to use any LLM as a drop in replacement for gpt-3.5-turbo.

You can use LiteLLM in the following ways:

With your own API KEY:

This calls the provider API directly

from litellm import completion
import os
## set ENV variables 
os.environ["OPENAI_API_KEY"] = "your-key" # 
os.environ["COHERE_API_KEY"] = "your-key" # 

messages = [{ "content": "Hello, how are you?","role": "user"}]

# openai call
response = completion(model="gpt-3.5-turbo", messages=messages)

# cohere call
response = completion(model="command-nightly", messages=messages)

Using the LiteLLM Proxy with a LiteLLM Key

this is great if you don’t have access to claude but want to use the open source LiteLLM proxy to access claude

from litellm import completion
import os

## set ENV variables 
os.environ["OPENAI_API_KEY"] = "sk-litellm-5b46387675a944d2" # [OPTIONAL] replace with your openai key
os.environ["COHERE_API_KEY"] = "sk-litellm-5b46387675a944d2" # [OPTIONAL] replace with your cohere key

messages = [{ "content": "Hello, how are you?","role": "user"}]

# openai call
response = completion(model="gpt-3.5-turbo", messages=messages)

# cohere call
response = completion(model="command-nightly", messages=messages)
sunner commented 9 months ago

@ishaan-jaff Your project is interesting. Stared. However, ChatALL is a js project.....