Skip to content

[v3-future] Enhance and generalize secret/key management? #1237

@krassowski

Description

@krassowski
  • The API keys set on the UI need to be set again in the kernel for %ai magics to work
  • There is a larger interest in having a general Secrets manager, mostly driven by the move to remote APIs for LLM interactions (beyond usage of jupyter-ai alone)

As in my earlier comment:

More generally JupyterLab, could benefit from having a first-class citizen Credentials Store. The Eugo team (@sanjay1890 and @BwL1289) recently brought up to my attention that Google Colab has a Secrets tab in the sidebar:

Image

and that there is a (non-maintained) https://github.com/frankzickert/jupyterlab-credentialstore extension for JupyterLab implementing a similar approach.

We could pass the secrets via environment variables (we already pass JPY_SESSION_NAME down to the kernel to let user now the notebook name).

It feels like moving some of that logic out of jupyter-ai would be a good investment because we would have only one place where we need to validate the logic for security (rather than multiple implementations). The benefits of reuse would seem higher than in the current effort to reuse the chat component.

Any thoughts?

Originally posted by @krassowski in #1103

While I would stop short of proposing to make a new repo like jupyter-sercets, I wonder if shifting the code within the monorepo to a new package to create a "Key Manager" and making it a server extension with a way to pass keys as environment variables to kernels (and possible a UI for adding more secrets) could be in scope of jupyter-ai?

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

Status

3.x backlog

Relationships

None yet

Development

No branches or pull requests

Issue actions