pymike00 / tinychat

🔮 TinyChat is a lightweight Desktop client for modern Language Models designed for straightforward comprehension. Supports OpenAI, Anthropic, Meta, Mistral, Google and Cohere APIs.
MIT License
38 stars 7 forks source link

Support custom API base #6

Open johnd0e opened 4 months ago

johnd0e commented 4 months ago

I would like this feature to be available in the settings. The default value should be https://api.openai.com/v1, however, it should also allow the specification of custom values.

I would also like to see similar setting for Google Gemini API base, with default value https://generativelanguage.googleapis.com or https://generativelanguage.googleapis.com/v1beta.

This should not be a fixed option, as there may be a need to switch APIs dynamically.

Please note:

pymike00 commented 4 months ago

Hi there and thanks for the suggestion!

Please tell me more. Why would having the a default value in settings be useful?

How does that improve the ability to create new models for a given provider?

Aside from cleaning up the codebase which I agree it would by moving the hardcoding in a more suitable place! But why the base url?

What other endpoints are you thinking about using?

johnd0e commented 4 months ago

Please tell me more. Why would having the a default value in settings be useful? How does that improve the ability to create new models for a given provider?

Uh.. It seems to me that we do not speak about the same matter. I will try to explain further.

But why the base url? What other endpoints are you thinking about using?

I am not thinking about other endpoints at all. I mean quite opposite: there is only one possible endpoint (/chat/completion), but many variable base api urls possible. Besides, it is quite common practice - to specify base url.

Because there are a lot of other services, that are compatible with OpenAI.