AndraxDev / speak-gpt

Your personal voice assistant based on OpenAI ChatGPT.
https://play.google.com/store/apps/details?id=org.teslasoft.assistant
Apache License 2.0
252 stars 56 forks source link

Bug: changing model resets the endpoint but not the UI #133

Open thiswillbeyourgithub opened 1 month ago

thiswillbeyourgithub commented 1 month ago

Hi! I hope you're well :)!

I had many issues when fiddling out with endpoints to try to make Claude 3.5 Sonnet working (I finally only made it work with openrouter because anthropic's API does not seem to follow openai's api enough) and finally understood that part of the issue is that if I change the model, the endpoint gets reset but the UI is not updated.

To reproduce:

  1. Go to the main settings or to a chat setting or to the quick settings in a chat
  2. Change the model
  3. Notice that the endpoint UI still indicates that the UI is set
  4. Go back to another screen then back in the setting
  5. Notice the endpoint appears unset

I think it might be better to not reset the endpoint because endpoints can have several model we want to use, especially with openrouter.

Additionally, the error message I get when trying to chat with a model is pretty obscure and appears after a long time (probably because timeout) : Cleartext HTTP traffic to localhost not permitted. I think it might be a good idea to catch the error earlier by telling that the endpoint is unset.

And while I'm at it: maybe the friendly name for each endpoint could be displayed instead of the url in the settings and quick settings? But that's the cherry on top!

Have a nice day @AndraxDev !

AndraxDev commented 1 month ago

1) Cleartext traffic is not allowed because localhost must be https enabled. I have already told why I'm doing this.

2) I'm not paid to advertise API endpoints and providers so I will not put their names, sorry.

AndraxDev commented 1 month ago

3) Your bug report is unclear. Maybe you have some API enpoints set invalid so when you are selecting a model of this endpoint and endpoint is changed so you don't need to do this manually. Or you simply don't understand how the app works. When you change model then SpeakGPT checks to which API endpoint the model belongs and swithching to it. Another cause of your error may be your settings which you decided not to show. Well I respect your privacy, but this bug requires more information from you otherwise it will be marked as not planned because current version of SpeakGPT with default settings have no this error. Tested on real devices (Pixel 5, 6, 7 ,8 8a, 8Pro, Samsung Galaxy S22, S23, Poco X3 NFC, X5 5G, Tablet Lenovo M10)

AndraxDev commented 1 month ago

And another piece of advice. Do not use "@" mentions. It is the most terrible thing you can do because it sends me an extra notifications. Thanks!

thiswillbeyourgithub commented 1 month ago
  1. Cleartext traffic is not allowed because localhost must be https enabled. I have already told why I'm doing this.

My point is not about localhost, it's about thinking the endpoint is localhost when it is unset : Screenshot_20240622-122056

  1. I'm not paid to advertise API endpoints and providers so I will not put their names, sorry.

I'm talking about what you call friendly names so I don't what it has to do with advertissments: Screenshot_20240622-122253

I'm just saying that in the global settings (and chat setttings and quick settings) instead of showing the url it might be more intuitive to display the friendly name.

I'll answer soon for 3.

AndraxDev commented 1 month ago

I don't know how you get endpoint unset. If you removed endpoint then I'm not obliged to inform you that endpoint have been removed. If you have specified settings then share it with me. Otherwise this report will remain unclear and will be closed. Before providing your answer please make sure your answer is relevant and clear. Nobody pay me to answer and support users 24/7 even during weekends. I'm doing it only because I'm care about users and want them to be satisfied. But when the users are fluiding me with infinite numbers of bug reports and seeing only negative in my work then I'm loosing motivation to support such users. Today is Saturday (Not a working day in my country so please have consience). Sorry, I blew up...

thiswillbeyourgithub commented 1 month ago

About 3. I think I understand a bit better what's going on. Starting from mistral endpoint for ex, when I switch model to gpt-4o I have a notification that says "API has changed to support this model" the if I go back in I indeed see that the endpoint is now set to openai.

But if I switch from gpt-4o to gpt-4 for example I still see the same notification even though the endpoint shoumd be the same.

And moreover, when I switch models of openrouter, the endpoints always end up "unset" as I showed in the above image.

When you change model then SpeakGPT checks to which API endpoint the model belongs and swithching to it.

How does it do to check which API to use? Because I don't understand how I can specify what model should be assigned to which endpoint.

Another cause of your error may be your settings which you decided not to show.

I would have shared my settings but I have no idea what settings would be relevant to that. I don't think it's relevant to show my endpoints because they are all working. Same for my list of favorite models.

AndraxDev commented 1 month ago

Issue #127 is a good example why sharing the settings is a good idea and how it can help to resolve the issue.

AndraxDev commented 1 month ago

How does it do to check which API to use? > Because I don't understand how I can specify what model should be assigned to which endpoint.

Models like openai/gpt-4o or google/gemini-1.5 belongs to OpenRouter because model name consists of provider/modelname.

Model gpt-3.5-turbo (without /) is a model of a single provider (OpenAI API endpoint)

I don't want to add million clarifications and instructions because it will fluid and load the UI. I wany humans being humans and use the main things making us apart of animals - thinking (If model name contains provider name in their name then logically it will belong to the API endpoint that support multiple models from different providers). I'm here not to teach and explain obvious things.

thiswillbeyourgithub commented 1 month ago

I didn't see your answer in time before posting my last message so:

If you have specified settings then share it with me. Otherwise this report will remain unclear and will be closed. Before providing your answer please make sure your answer is relevant and clear.

I don't know what settings would be relevant. The endpoints and models are all working fine. Can you tell me what to provide? I don't see errors in the logs.

Nobody pay me to answer and support users 24/7 even during weekends. I'm doing it only because I'm care about users and want them to be satisfied. But when the users are fluiding me with infinite numbers of bug reports and seeing only negative in my work then I'm loosing motivation to support such users. Today is Saturday (Not a working day in my country so please have consience). Sorry, I blew up...

I'm really sorry you take it that way. I am too working a lot in the week (medical student) and the week ends are when I have more time to provide feedback. I don't want you to feel that you have to answer quickly or on weekends of course!

And let me insist again: this is your issue section I've told you more than anyone on github how good I think of your app. This is an ISSUE section, what am I supposed to post besides issues?! Bug reports are not a criticism of your value as a human but a feedback to help the dev and avoid issues for other users. Mental health of developpers is a concern to me but I don't see how you can think a happy heavy user that finds a bug is "seeing only the negative in my work". I really don't want you to lose motivation especially when I am a HAPPY USER. Speakgpt is providing great value to the world and that is thanks to you!

I don't know how you get endpoint unset. If you removed endpoint then I'm not obliged to inform you that endpoint have been removed.

I made a video to make it more clear:

https://github.com/AndraxDev/speak-gpt/assets/26625900/c27be45c-1c24-42a6-a877-47748c903c73

As you can see changing just the model unsets the endpoint.

AndraxDev commented 1 month ago

This is why I will not trust your report without providing a full set of settings + endpoints:

https://github.com/AndraxDev/speak-gpt/assets/43646136/c046a740-496c-4c78-9159-c3b811ca8fb6

thiswillbeyourgithub commented 1 month ago

https://openrouter.ai/api/v1/ https://api.openai.com/v1/ Screenshot_20240622-132050

AndraxDev commented 1 month ago

Screenshot_2024-06-22-13-25-28-967_org.teslasoft.assistant.jpg

I have almost the same endpoints list. But something may be different in the settings.

thiswillbeyourgithub commented 1 month ago

Screenshot_20240622-133037 Screenshot_20240622-133044 Screenshot_20240622-133051

thiswillbeyourgithub commented 1 month ago

I think I figured it out : I removed all the favorites and re added them and it seems I don't have the issue anymore. Maybe it was caused because I renamed or changed endpoints at some time? Does that mean that the favorites are linked to an endpoint name and not url? If so maybe the favourites that don't correspond to an endpoint anymore should be removed or greyed out instead of unsetting the endpoint.