-
-
Notifications
You must be signed in to change notification settings - Fork 340
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide non-UI way to specify API keys and other essential config fields for Jupyter AI chat #505
Comments
@andrii-i if you want your vendor specific API key available to all single user notebook instances, you can set this as an environment variable in Below is an example using c.Spawner environment vars, notably I am using openai. This is referenced here for jupyter-ai env vars. c.Spawner.environment = {
'PROVIDER_API_KEY':'YOUR_API_KEY_HERE',
'OPENAI_API_KEY': 'sk-.............'
} Don't forget to make sure the file is secured with OH wait I thought that would work for the UI lab extension but it does not! |
Hello, Can you please verify if it's correct that setting the provider API_KEY (OPENAI_API_KEY) as an environment variable for Jupyter AI chat is not supported? This pertains to #685. Specifically, my goal is to configure provider details through the Our enterprise prefers managing sensitive information through a secret manager, either within 'jupyter_jupyter_ai_config.json' or as an environment variable. what would be the recommended approach to achieve this? Thank you! |
i have a similar question -- the environment variable seems to apply to the magic command and not the chat? is there a way to have the chat sidebar rely on environment variables to set API keys? |
I just left a relevant comment in a related issue (context: this should also work with a config file outside the home directory for interoperability with JupyterHub on Kubernetes). Excerpting here for visibility:
[1] Here are all the other extensions that this approach works with, in case it's helpful:
|
I am having the same issue. I would be great if the chat UI could be configured using the API keys from env variables (like the AI magics command) |
Problem
Currently only way for the user to specify an API key for Jupyter AI chat is to use chat settings UI or edit
config.json
directly (and we don't want users to editconfig.json
directly). Specifying API key through env variables would only work for AI magics.Relevant discussion: #503.
Proposed Solution
Provide non-UI way to specify API keys and other essential config fields for Jupyter AI chat. For example, making chat pick up API env variable would be a good start.
The text was updated successfully, but these errors were encountered: