-
-
Notifications
You must be signed in to change notification settings - Fork 30
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
Package location for Generative AI in Jupyter #172
Comments
This looks like an awesome capability. Thanks for the proposal! Who will be maintaining this repo, at least initially? |
Summarizing notes from dev meeting discussion today (errors in summary are mine)
|
@3coins - How do we vote? I suggest picking two emojis for the two options. |
Another suggestion that was posted on the chat during the meeting was to first incubate the project under the Posting it here for visibility and to add it to the list of options for where this package could go. |
@jasongrout Let’s use a thumbs up emoji (:+1:) for “Yes” and thumbs down emoji (:-1:) for “No” |
@jasongrout |
Thanks for putting this together, definitely would be a great capability with potential! A few high-level thoughts that come to mind (as a GAI power-user for academic work and my browser extension):
Happy to volunteer and contribute where helpful, this is work close to my interest. |
@jtpio thank you for surfacing this question. Jupyter GAI should be developed and governed under Project Jupyter organizational umbrella accordingly to processes and guidelines established within the organization. And |
As discussed on the call (and some other percolating thoughts from the demo): Acronym branding The acronym-based branding, as it stands, is relatively opaque. Before last week, GAI has broadly referred to:
Broader applicability The case was made that the proposed models are not substantively different tools than spell checkers and formatters. Great! Perhaps a more effective branding is the more activity-based
The above all take different scopes:
Solving these problems in a general way will allow for many interesting applications, beyond pay-as-you-go ML models trained without regard to the licenses of the corpus, which have yet to play out in court. Jupyter just straight up can't be involved in these. Defining Data Structures Where Jupyter has been able to adopt existing standards, we can use existing tools to validate content. This is most notable in the notebook format, but additionally relevant in the documentation of Jupyter REST APIs, JupyterLab settings, notebook metadata, and others. Versioned schema, such as the Jupyter Notebook Format, also offer a way to provide forward and backward migration, which would alleviate some of the concerns about the ability of downstream plugins to be updated to the newest format. Recommended: use well-annotated JSON Schema rather than inventing something entirely new. User Experience Building on the above, JSON Schema can feed directly into Modal popups are pretty bad, and I hate seeing more added that aren't really undo-able and world-blocking, e.g. Delete all the files? [yes][no] As an iterative activity, I'd recommend moving the whole UI to a sidebar, such that one can operate/copy paste their content. Notebook 7 will support sidebars, so there's really little downside. In the specific case of a a suggestion to a notebook cell, reusing the Whether new cell(s) are created or existing ones patched, it seems relevant to carry some metadata about this suggestion, which could be further formalized and inspected, or reused. For example, storing the prompt for an image could become its accessibility-enhancing image caption, as could the source information, generation time, cost, random seeds, etc. Of course things like API tokens, usernames, etc. would not, and these should likely be in an entirely separate section of the UI. |
Thank you all for your engagement! It's wonderful to see everybody excited about this. Let me do my best to address some of the comments so far: @TiesdeKok You have raised all excellent points. The only actionable item right now is potentially changing how we handle secrets server-side, since the OpenAI model engines require an API key to function. Right now, we're encouraging users to store this in a traitlets configuration file, e.g. with contents @bollwyvl Thank you for documenting our concerns regarding the name. Again, we're very open to suggestions here, and we'll keep the team informed of any alternative name proposals we can offer.
Hm, could you elaborate more on your thoughts regarding this?
Thank you for the technical suggestion. What we were thinking is that the GAI server extension actually returns a form schema for prompt variables in the DescribeTask API, so that the frontend can render a form for the user to fill out, and then return these values when invoking the model via the Prompt API. This is how we plan on supporting multiple prompt variables beyond a user's text selection, e.g. "language version" or "image size".
Yes, we agree. As we mentioned in the call, we would very much like to migrate away from the "select-then-dialog" user experience we are providing today, and are open to ideas from the community.
This is actually already possible just by changing the logic of the inserters (insertion commands). Each inserter receives an |
right, but extensions themselves could also provide their templates as JSON schema, rather than some new thing like JSON schema.
The Jupyter Project, and by extension its user community, has been burned a number of times by having attractive capabilities that are strongly tied to a specific upstream API vendor. There is no reason to assume benign intent in any of the current large language model API providers, or their future acquirers. Upcoming litigation (or the threat thereof), and the generally gross misunderstanding of open source's role in the software supply chain, is probably enough reason to not expose users, maintainers, or the brand to these risks. By focusing on a sound, general API/UI could immediately provide offline/non-risky benefits like configurable spell check, formatting, etc. beyond what, say, the LSP CodeLens offers. |
@bollwyvl thank you for sound points and suggestions.
Agreed, use of JSON schema as standard format for extensions schemas seems like a good idea and perfectly fits existing architecture.
GAI is a model-agnostic framework that would allow people to experiment and interact with Generative AI engines. People using it are free to implement arbitrary tasks working through arbitrary engines or install tasks/engines implemented by others. We created DALL·E extension as an example; person using GAI can as well use it with open source models from https://huggingface.co/ or to test their own model. Creating general, extendable, engine-agnostic API/UI for interaction with generative AI engines is a goal of this project. So I think we are on the same page here. If I'm missing something and you are suggesting a different direction, please elaborate more. |
I understand you are concerned about upstream AI research companies, but what are your concerns specifically about this proposal? We believe that this proposal is sufficiently general and modular enough to be agnostic of whatever companies these models and their APIs originate from. |
I have one comment about the vote request. As stated in the decision making process, an informal discussion - as started here - is required to precise the request and may be sufficient to move forward without the need for a vote. If we need a vote, we should follow the Jupyter guidance. Meaning the first post must have a list of all eligible voters (aka the JupyterLab council members) with 3 checkboxes (
So I would suggest bringing this point again next Wednesday's meeting to see if the discussion brings a consensus. If not we can ask for a formal vote after the meeting. |
Hi everyone, thank you for all the comments, questions, and suggestions (disclosure: this is my team at AWS who is working on this). A few quick replies:
Thanks everyone! |
Hey team, we have finally returned with our naming suggestions for this repo and its packages. We believe a good name is described by the following:
Taking these guidelines into account, we believe the best name for the project is Jupyter AI. In other words, we propose simply dropping the "G". Keeping the adjective "generative" doesn't provide much additional context (as most models generate output), and leads to ambiguous and problematic pronunciation. Other terms used in the project that include the phrase "GAI" have also been renamed. "GAI modules" are now just AI modules. The monorepo name would be the project name in kebab-case, e.g.
Here, |
@jupyterlab/jupyterlab-council As per discussion in today's JupyterLab weekly meeting, community has decided to put a vote for this decision. I have added all JupyterLab council member names along with a checkbox for their decision in the summary section. The vote will be closed in a week on Thursday Feb 2nd. |
I’ve been trying to listen more than talk on this discussion because I know it’s not my area of expertise, but I still don’t feel like I’ve gotten a definitive answer to the question I asked on the January 18 JupyterLab call: why does this work belong in/under JupyterLab? Why is it not suited to be an extension or similar kind of satellite? To be clear, these questions aren’t a commentary on contribution quality or potential use cases or generative AI ethics. Here are the answers I think I’ve heard (for your confirmation and/or debunking):
Thanks in advance for giving this comment a look. I want to make sure we have this information as clear as we can before voting. I want to call out that the terminology section was very helpful to me. Thanks for taking the time to make sure we’re communicating precisely as we can. |
@isabela-pf thanks for your questions, hopefully I can answer them.
|
I think this is what felt off about this to me, I felt like the jupyterlab org was not quite the right place for it but couldn't figure out a solid reason why I felt that. Perhaps this package would be a good reason to reactivate the incubator and be the first active project under the new governance. I'll hold my vote until we can discuss more (possibly at tomorrow's meeting) |
@ajbozarth thanks, I will be sure to attend to discuss. |
We have talked with a few folks this week about this proposal to get more feedback. The sense we are getting is that the best place for this work is the Jupyter Incubator program. However, the Jupyter Incubator program is dormant and has not been refactored for the new Jupyter governance model. The new Executive Council and Software Steering Council will work together to relaunch the Jupyter incubator program, but we expect that to take a few months with all the other tasks those two bodies are working on right now. Given that, we would like to change this proposal along the following lines:
We will bring this to the weekly JupyterLab meeting today and will reset the vote and update the proposal accordingly. |
For precedent, the Jupyter Server team has agreed to "incubate" projects such as |
We discussed this in the JupyterLab weekly meeting. After a short discussion @isabela-pf and @jasongrout proposed we continue with the revised vote. Voting form has been updated and the time has been reset. Thanks everyone! |
Thank you all for participating in the vote. The voting period for this issue has closed. Here is the summary for the votes: Yes: 13 votes Given the 16 participating council members, the 50% quorum is met and the proposal passes. |
I don't seem to have permissions to create a new repo under |
I created https://github.com/jupyterlab/jupyter-ai and gave "maintain" access to the council. |
Thanks everyone for participating in the discussion and vote and Steve for
creating the repo.
…On Thu, Feb 9, 2023 at 1:39 PM Steven Silvester ***@***.***> wrote:
I created https://github.com/jupyterlab/jupyter-ai and gave "maintain"
access to the council.
—
Reply to this email directly, view it on GitHub
<#172 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAGXUGEGJTZE2AROFELTGLWWVP2ZANCNFSM6AAAAAAT7IQIPE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
Brian E. Granger
Senior Principal Technologist, AWS AI/ML ***@***.***)
On Leave - Professor of Physics and Data Science, Cal Poly
@ellisonbg on GitHub
|
This issue is to call a vote on the proposal in jupyterlab/jupyterlab#13804
Where should this work be placed?
We propose that the GAI service API and UI components along with the default model engines should be placed in a package under the JupyterLab org. We believe that GAI provides a core functionality central to working with generative AI in JupyterLab which is missing at the moment in the JupyterLab framework. GAI models can also produce content that is harmful, offensive, or misleading. Making this part of Jupyter will enable the Jupyter OSS community to engage directly in a manner consistent with Jupyter governance model and make sure we continue to build this in a manner that works long term for the Jupyter users.
Full text of the proposal
Generative AI (GAI) models can generate novel content rather than simply analyzing or acting on existing data. The generated data is both similar to the training data and a response to the user provided natural language prompt that describes a task or question. Recent generative AI models such as Amazon CodeWhisperer, Codex, Stable Diffusion, and ChatGPT have demonstrated solid results for many tasks involving natural language (content generation, summarization, question answering), images (generation, explanation, in-painting, out-painting, transformation), data (synthetic data generation, transformation, querying, etc.), and code (autocompletion, explanation, debugging, code reviews, etc.).
Jupyter already has an architecture and user interface for code generation through autocompletion. This architecture has been used to integrate AI provided autocompletions into JupyterLab and the Jupyter Notebook (Kite, Tabnine). As generative AI models expand to perform other tasks, a generalization of the Jupyter autocompletion architecture will empower users to use generative AI to perform any task in Jupyter’s applications.
We are proposing a new GAI architecture which is based on an extensible Jupyter server API for registering GAI models and the tasks they perform in Jupyter. This lets third parties integrate their generative AI models into Jupyter and it lets users enable the models and tasks. New GAI plugins are installed using the JupyterLab extension manager UI or a simple
pip
/conda install
. Once models have been enabled, users working in JupyterLab or the Jupyter Notebook canTerminology (users & developers)
BaseModelEngine
that executes a modelTerminology (contributors)
INotebookTracker#currentWidget
,IEditorTracker#currentWidget
DocumentWidget#content
Service API
Prompt API
The Prompt API synthesizes a prompt, executes the model, and returns the output for a given task. This will be the core handler that provides our generated recommendations in notebooks.
Request schema:
Response schema:
Task API
The Task API allows users to create, read, update, and delete tasks.
ListTasks
The ListTasks API allows users to list all the tasks for registered model engines.
Request schema:
Response schema:
DescribeTask
The DescribeTask API allows you to retrieve additional metadata about a task, such as the prompt template.
Request schema:
Response schema:
Engines API
ListEngines
The ListEngines API lists all model engines registered in the backend, i.e. ones that can be used to generate outputs via the the Prompt API.
Request schema:
Response schema:
Server implementation outline
jupyter_gai server extension
The base
jupyter_gai
extension adds handlers for the HTTP APIs. Exposes aBaseGaiModelEngine
class for other server extensions to extend.Developer guide
Registering GAI model engines
GAI extension uses the entry points under the group name
jupyter_gai.model_engine_class
to discover new model engines. Model engine providers can create a new engine by extending theBaseModelEngine
class and publishing a python package with this module exposed as an entry point. For example, here is the code and setup forTestModelEngine
.Expose this model engine as an entry point. Here, we are assuming that the package is named
jupyter_gai_test
.Registering default tasks
Each model engine exposes a method
list_default_tasks()
, which lists the default tasks that it will install into the Task DB. It has a return type ofList[DefaultTaskDefinition]
, which is defined as such:The engine-scoped task ID is combined with the engine name to form a human-readable, unique task ID for a default task. A default task ID must have a format of
f"{engine_name}:{task_id}"
. This constraint is required for the UI code to have a stable identifier for default tasks.Note that there is no such constraint on custom task IDs; any globally unique string is sufficient. For our implementation, we will likely just use UUIDv4 by default.
UI Components
Explain or codify cell button in cell toolbar
There is a new button in a cell toolbar that enables users to explain the code in a “code” cell or generates python3 code based on text in a “markdown” cell.
Explain code in code cell toolbar
Generate code in markdown cell toolbar
Generate output from selection...
“Generate output from selection” mode provides a set of tasks for generating output based on text selection. New tasks can be installed through python entry points (see “Registering default tasks” section).
Command driven insertion logic
Default commands are registered to allow prompt output to be added above, below or inline replacement of the selected text. These commands work for all document widgets with an editor. Extension writers can enable additional insertion modes by registering a command following the pattern
gai:insert-<insertion-mode>
, and handling the insertion logic within the execute callback. For example, here is the code that handles insertion of prompt output in the default inserter.This handler is registered as execute function in the default commands in the GAI app.
Summary
Vote Yes if you agree to **temporarily creating a new repo under JupyterLab for the proposed project and moving it to the Jupyter Incubator program once it is up and running again (estimated to be 2-3 months from now).
Vote No if you disagree.
@jupyterlab/jupyterlab-council votes
The voting window closed on February 8.
Quorum of
9/18
met with16/18
@jupyterlab/council voting.The result was Yes.
13
Yes,2
No,1
AbstainThe text was updated successfully, but these errors were encountered: