dglazkov / polymath

MIT License
132 stars 9 forks source link

Simple web client #41

Open dalmaer opened 1 year ago

dalmaer commented 1 year ago

A simple web polymath client that lets you define which federated resources to query?

jkomoros commented 1 year ago

Just thinking out loud.

There might be two simple web clients, or perhaps one with two modes, for two use cases, where the end user has their own OPENAI_API_KEY and one where they don't.

The first can be 100% static and local, hosted anywhere. When you first load it it asks you to paste in your API key. It assures you that the API key won't be stored anywhere except sent to OpenAI. There's a way to opt-in for it to store the API key locally in local storage.

Another mode is for when someone else wants to "host" usage with their own API key. This has the possibility of exhausting their budget if they get a lot of traffic. This would require some kind of simple server side functionality where the key can be kept safe from the end user but applied to OpenAI requests. Perhaps a simple Firebase Cloud Function (downside being that would require rewriting the core logic of the context creation in javascript (which perhaps isn't that bad). Anyway, it allows an indirection that keeps the OpenAI key safe.

For both apps, we should stuff the endpoints you select into the URL of the tool, so when you share the URL with others they automatically query the same endpoints as you. The API key, obviously, is never transmitted.

dalmaer commented 1 year ago

"For both apps, we should stuff the endpoints you select into the URL of the tool, so when you share the URL with others they automatically query the same endpoints as you."

ohhhh that's kinda cool. the end points end up spreading like bits of DNA....

On Tue, Jan 10, 2023 at 7:22 AM Alex Komoroske @.***> wrote:

Just thinking out loud.

There might be two simple web clients, or perhaps one with two modes, for two use cases, where the end user has their own OPENAI_API_KEY and one where they don't.

The first can be 100% static and local, hosted anywhere. When you first load it it asks you to paste in your API key. It assures you that the API key won't be stored anywhere except sent to OpenAI. There's a way to opt-in for it to store the API key locally in local storage.

Another mode is for when someone else wants to "host" usage with their own API key. This has the possibility of exhausting their budget if they get a lot of traffic. This would require some kind of simple server side functionality where the key can be kept safe from the end user but applied to OpenAI requests. Perhaps a simple Firebase Cloud Function (downside being that would require rewriting the core logic of the context creation in javascript (which perhaps isn't that bad). Anyway, it allows an indirection that keeps the OpenAI key safe.

For both apps, we should stuff the endpoints you select into the URL of the tool, so when you share the URL with others they automatically query the same endpoints as you. The API key, obviously, is never transmitted.

— Reply to this email directly, view it on GitHub https://github.com/dglazkov/polymath/issues/41#issuecomment-1377356498, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAABFIR4HRU5JCJ7KHJREK3WRVWDLANCNFSM6AAAAAATWD3MIE . You are receiving this because you authored the thread.Message ID: @.***>