Closed MemeticGitHubUser closed 1 year ago
maybe bit late, SillyTavern actualy support proxy or custom url, so basically you can use local server from gpt4free to SillyTavern,
BUT
SillyTavern need check connection to the server with request to route /models
and gpt4free doesnt have it so to able to make work with sillytavern you need add some code in interference/app.py
and run (follow readme to run local server)
# add this code
@app.route("/models", methods=['get'])
def models():
return {
"object": "list",
"data": [
{
"id": "gpt-3.5-turbo",
}
]
}
and maybe you want change provider to another providers that are still working
@app.route("/chat/completions", methods=['POST'])
def chat_completions():
streaming = request.json.get('stream', False)
model = request.json.get('model', 'gpt-3.5-turbo')
messages = request.json.get('messages')
response = ChatCompletion.create(model=model,
stream=streaming,
messages=messages,
# change to provider that work
provider=Provider.AItianhu)
and now you can adjust sillytavern config, chang to your local gpt4free server, default is http://127.0.0.1:1337 or http://localhost:1337
disable streaming if provider doesnt support stream
setting open ai key with random string or int
and click connect
and test message
also always check your local gpt4free server if have some error try change current provider to another provider that work
result :
Thanks for the tutorial, maybe we need the "/models" in the repo and a command line option to change provider
Bumping this issue because it has been open for 7 days with no activity. Closing automatically in 7 days unless it becomes active again.
I keep getting this error:
Traceback (most recent call last): File "C:\Users\Kyle\PycharmProjects\gpt4free\venv\Lib\site-packages\flask\app.py", line 2213, in __call__ return self.wsgi_app(environ, start_response) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Kyle\PycharmProjects\gpt4free\venv\Lib\site-packages\flask\app.py", line 2193, in wsgi_app response = self.handle_exception(e) ^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Kyle\PycharmProjects\gpt4free\venv\Lib\site-packages\flask_cors\extension.py", line 176, in wrapped_function return cors_after_request(app.make_response(f(*args, **kwargs))) ^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Kyle\PycharmProjects\gpt4free\venv\Lib\site-packages\flask\app.py", line 2190, in wsgi_app response = self.full_dispatch_request() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Kyle\PycharmProjects\gpt4free\venv\Lib\site-packages\flask\app.py", line 1486, in full_dispatch_request rv = self.handle_user_exception(e) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Kyle\PycharmProjects\gpt4free\venv\Lib\site-packages\flask_cors\extension.py", line 176, in wrapped_function return cors_after_request(app.make_response(f(*args, **kwargs))) ^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Kyle\PycharmProjects\gpt4free\venv\Lib\site-packages\flask\app.py", line 1484, in full_dispatch_request rv = self.dispatch_request() ^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Kyle\PycharmProjects\gpt4free\venv\Lib\site-packages\flask\app.py", line 1469, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Kyle\PycharmProjects\gpt4free\interference\app.py", line 32, in chat_completions response = ChatCompletion.create(model=model, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Kyle\PycharmProjects\gpt4free\g4f\__init__.py", line 36, in create if stream else ''.join(engine._create_completion(model.name, messages, stream, **kwargs))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Kyle\PycharmProjects\gpt4free\g4f\Provider\Providers\ChatgptAi.py", line 49, in _create_completion yield (response.json()['data']) ^^^^^^^^^^^^^^^^^^^^^^^^ KeyError: 'data'
Try another provider, ones work others not
But there should be some working ones
Besides Bing, that is the only active provider listed using gpt4 lol. And I've had no luck with bing because of a Captcha.
Bing was working for me, but now i'm getting requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Bumping this issue because it has been open for 7 days with no activity. Closing automatically in 7 days unless it becomes active again.
Closing due to inactivity.
Sillytavern is a UI frontend I enjoy using a lot. would it be possible to make it so GPT4FREE can be used with it?