Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration of generic LLM API (e.g. Xinference) #24

Merged
merged 42 commits into from
Nov 23, 2023
Merged

Integration of generic LLM API (e.g. Xinference) #24

merged 42 commits into from
Nov 23, 2023

Conversation

AndiMajore
Copy link
Contributor

Adds generic implementation of the Conversation class to allow for use of non-openai but openai style endpoints.
Includes the addition of customized openai.py > generic_openai.py

  • to disable tokenization based on modelname
  • to override the modelname based URL use to have static URL endpoint but model_uid in request for model selection

@slobentanzer
Copy link
Contributor

slobentanzer commented Nov 3, 2023

Thanks for the PR, @AndiMajore!

@fengsh27, this is the local LLM application that we briefly talked about, I think it would be helpful for you to see the implementation, and helpful for the PR if you could give your opinion / input on the code.

In particular, I would like to reduce redundancies in the newly established generic OpenAI connectivity and the one that previously existed. It would be great if the existing GPTConversation could inherit from the generic one with some fixed parameters; and if the tests reflected this, equally.

I will be back to being able to code next week, so I'm happy to get practically involved as well. @AndiMajore, could you summarise again what kind of conflicts we have between the OpenAI API and the custom Xinference one?

Ideally, we would end up with a generic OpenAIConversation, that can have Xinference and official OpenAI API (regular and Azure) children (with minimal code duplication). So the hierarchy would be:

Conversation
- OpenAIConversation ( + HuggingFaceConversation etc )
-- XinferenceEndpointOpenAIConversation, OfficialEndpointOpenAIConversation, AzureEndpointOpenAIConversation

Maybe we can come up with more concise names for the classes. ;)

@AndiMajore
Copy link
Contributor Author

Hey @slobentanzer ,
I just changed the Xinference chatting integration to use the Client class of Xinference and the Xinference embedding integration to use the XinferenceEmbeddings class of langchain.

explicit (optional) dependency because without, poetry would take ..
forever to resolve `xinference` dependencies
mds (copied and adapted from biocypher repo)
Copy link
Contributor

@slobentanzer slobentanzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants