rengine icon indicating copy to clipboard operation
rengine copied to clipboard

custom api

Open NoahOksuz opened this issue 1 year ago • 9 comments

is this how u want it? @psyray

NoahOksuz avatar Dec 08 '23 02:12 NoahOksuz

What is this related to? Please provide more context @SubGlitch1

yogeshojha avatar Dec 08 '23 05:12 yogeshojha

@yogeshojha related to #1114 @SubGlitch1 👍 But, please, document explicitely your changes

psyray avatar Dec 08 '23 09:12 psyray

@yogeshojha I had seen a lot of people wanting to be able to use their own custom/local LLms. This can be done quite easily by changing the code to include an env variable which the gpt.py treats as the base url if it exists.

There are a growing number of openai compatible api server on github one of the most known ones being text-generation-ui. By using a project like this a user can host their own LLM api server which has the exact same scheme as the official openai api.

This obviously greatly increases privacy as the information of targets doesn't get sent to openai anymore. It also makes the gpt feature free as you don't have to pay for the api tokens anymore obviously. It also enables users who live in geo blocked areas to use the gpt feature.

NoahOksuz avatar Dec 08 '23 11:12 NoahOksuz

Thanks @SubGlitch1 , do all these api have same response? Can you provide me the response for text-generation-ui

yogeshojha avatar Dec 08 '23 12:12 yogeshojha

@yogeshojha text-generation-webui has the exact same scheme of openai. The request/response scheme will be exactly the same. I have tested on my own PC Test details OS: amd64 arch Linux llm: openchat3.5_Q3

NoahOksuz avatar Dec 08 '23 12:12 NoahOksuz

@yogeshojha

https://github.com/oobabooga/text-generation-webui/wiki/12-%E2%80%90-OpenAI-API#sse-streaming

You can see the examples here. A lot of projects which use the openai api e.g. gpt-engineer also have options to change the base api url for the exact same reason.

NoahOksuz avatar Dec 08 '23 14:12 NoahOksuz

@SubGlitch1 I didn't know the subject, but copilot is usable with your modifications ?

psyray avatar Jan 05 '24 11:01 psyray

@psyray the issue you are referencing has been opened because the op wants to get gpt4 access for free. His suggested integration is not possible as copilot isn't open source but by integrating my solution one could host any model that they want for free.

NoahOksuz avatar Jan 05 '24 19:01 NoahOksuz

@psyray the issue you are referencing has been opened because the op wants to get gpt4 access for free. His suggested integration is not possible as copilot isn't open source but by integrating my solution one could host any model that they want for free.

Thanks 👍

psyray avatar Jan 05 '24 19:01 psyray