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

Add new model type to use custom OpenAI api compatible servers #1692

Closed
wants to merge 4 commits into from

Conversation

FlorianJoncour
Copy link

Describe your changes

I added a new model type similar to OpenAI, but with the possibility to define the API entry point and the model name in order to allow using custom OpenAI compatible servers like those of vllm or llama.cpp

Issue ticket number and link

Checklist before requesting a review

  • I have performed a self-review of my code.
  • If it is a core feature, I have added thorough tests.
  • I have added thorough documentation for my code.
  • I have tagged PR with relevant project labels. I acknowledge that a PR without labels may be dismissed.

Notes

Model settings are stored in chatgpt-custom.txt which contains 3 lines:

  1. api key (backward compatiblity)
  2. api base url
  3. model name

A future release may use QSettings, Json library or any other to store these values in a dict for safety

@manyoso
Copy link
Collaborator

manyoso commented Nov 29, 2023

These other servers would all expose OpenAI compatible API then? Do you have a specific example you're testing with?

@manyoso manyoso assigned manyoso and unassigned manyoso Nov 29, 2023
@manyoso manyoso added the chat gpt4all-chat issues label Nov 29, 2023
@FlorianJoncour
Copy link
Author

FlorianJoncour commented Nov 29, 2023

I'm not sure to understand the question.

There is a whole bunch of software that uses the OpenAI API as a reference implementation.
For example:
xorbitai inference
llama.cpp (optionaly as a server)
llama-cpp-python
Openllm (alongside others)
Ray llm (alongside others)
vllm (alongside its own protocol)
and many others...

The subject of this pull request is the possibility of using GPT4all as a client of these softwares as it already does with OpenAI.

(I'm sorry if my english is poor, i'm not strong in foreign languages)

Comment on lines 193 to 194
// else if (openaiModel.text === "")
// openaiBase.showError();
Copy link
Member

Choose a reason for hiding this comment

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

We should do something with this commented-out code - either remove it if it isn't needed, or uncomment it if it is.

Copy link
Author

Choose a reason for hiding this comment

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

You're right.

Most implementations force the model name to match betwen the client and the server.
But In my own implementation, I prefer to leave this blank because I plan to serve only one model per instance, so the model name is not important.

So it is probably better to let the user choose.

@Dbz
Copy link

Dbz commented Feb 11, 2024

I think I'm asking for something that is a subset of this: #1955 🙏

@manyoso manyoso closed this Mar 12, 2024
@cebtenzzre cebtenzzre removed the request for review from manyoso April 1, 2024 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chat gpt4all-chat issues
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

4 participants