cofactoryai/textbase

LLM Integration: implement Claude 2.0 in `models.py`

kaustubh-cf opened this issue · 8 comments

What do we need?

If you go to the textbase/models.py, there exists classes for various models like OpenAI (GPT3.5/4), Dalle-2, Huggingface inference API etc that can be used for various tasks from text generation to chatbots and many more.

Claude 2.0 is another such promising LLM that we would very much like to integrate in textbase.

Just make another class in there like:

class Claude:
    def generate():
        pass
  • You can refer to the Python Client SDK mentioned in the documentation. Keep in mind that you might have to restructure the response in the format that textbase accepts. 👉🏻 Reference

Refer to the code in models.py, play around with it after setting things up locally.

  • After implementing the model, import that and test it by making a main.py, just like the one for OpenAI.
    Reference -> docs.textbase.ai

Docs

  • After writing the code make sure you update the corresponding docs as well in here.
  • Create a file named claude-bot.md and add relevant information there.

Let us know if you face any issues!

hey @kaus-cofactory , I want to work on this issue. Can you please assign this to me.

Hi @morgoth9808 Yes, please go ahead with it!

Hey @kaus-cofactory I cannot create an api key for testing Claude 2.0. It is saying that I have to apply for the early access. Is there any workaround for that.

@morgoth9808 I'm afraid Claude is available only in the US and UK as of now. So it might be not possible to do this from your side. Although if you want to implement the tentative code, the internal team can then check it with an API key that we might get access to.

If not I'll be adding other issues, you can have a look at them 🙌🏻

Thanks for the update @kaus-cofactory , I am implementing the tentative code.

Hey @kaus-cofactory so I tried writing the code but I cannot test without an api key and I can't access Claude2 here in India. So I am exploring different projects now . Anyway thank you for assigning this issue to me , really learned a lot from this project.

No worries @morgoth9808, this would be taken up by someone from the internal team probably. Thanks!

Over the course of Hacktoberfest we'll be adding a number of different issues. Feel free to have a look at the issues section anytime!

Hello project Maintainer I have tried to add the Claude api in the models the only issue I faced while development that I ddint have the api key for running purpose because it is not accesible But I have added the code you can review it. If you want can I push this code.? Give me as a assignee here

image Screenshot 2023-11-23 013501