7 ms·
Show HN: Adding Mistral Codestral and GPT-4o to Jupyter Notebooks
Hey HN! We’ve forked Jupyter Lab and added AI code generation features that feel native and have all the context about your notebook. You can see a demo video (2 min) here: https://www.tella.tv/video/clxt7ei4v00rr09i5gt1laop6/view https://www.tella.tv/video/clxt7ei4v00rr09i5gt1laop6/view
Try a hosted version here: https://pretzelai.app https://pretzelai.app
Jupyter is by far the most used Data Science tool. Despite its popularity, it still lacks good code-generation extensions. The flagship AI extension jupyter-ai lags far behind in features and UX compared to modern AI code generation and understanding tools (like https://www.continue.dev https://www.continue.dev and https://www.cursor.com https://www.cursor.com). Also, GitHub Copilot still isn’t supported in Jupyter, more than 2 years after its launch. We’re solving this with Pretzel.
Pretzel is a free and open-source fork of Jupyter. You can install it locally with “pip install pretzelai” and launch it with “pretzel lab”. We recommend creating a new python environment if you already have jupyter lab installed. Our GitHub README has more information: https://github.com/pretzelai/pretzelai https://github.com/pretzelai/pretzelai
For our first iteration, we’ve shipped 3 features:
1. Inline Tab autocomplete: This works similar to GitHub Copilot. You can choose between Mistral Codestral or GPT-4o in the settings
2. Cell level code generation: Click Ask AI or press Cmd+K / Ctrl+K to instruct AI to generate code in the active Jupyter Cell. We provide relevant context from the current notebook to the LLM with RAG. You can refer to existing variables in the notebook using the @variable syntax (for dataframes, it will pass the column names to the LLM)
3. Sidebar chat: Clicking the blue Pretzel Icon on the right sidebar opens this chat (Ctrl+Cmd+B / Ctrl+Alt+B). This chat always has context of your current cell or any selected text. Here too, we use RAG to send any relevant context from the current notebook to the LLM
All of these features work out-of-the-box via our “AI Server” but you have the option of using your own OpenAI API Key. This can be configured in the settings (Menu Bar > Settings > Settings Editor > Search for Pretzel). If you use your own OpenAI API Key but don’t have a Mistral API key, be sure to select OpenAI as the inline code completion model in the settings.
These features are just a start. We're building a modern version of Jupyter. Our roadmap includes frictionless, realtime collaboration (think pair-programming, comments, version history), full-fledged SQL support (both in code cells and as a standalone SQL IDE), a visual analysis builder, a VSCode-like coding experience powered by Monaco, and 1-click dashboard creation and sharing straight from your notebooks.
We’d love for you to try Pretzel and send us any feedback, no matter how minor (see my bio for contact info, or file a GitHub issue here: https://github.com/pretzelai/pretzelai/issues https://github.com/pretzelai/pretzelai/issues)
- carreau 2y agoCurious about the limitations that made you fork it instead of making an extension.
- prasoonds 2y agoSo we discuss this briefly on our FAQ but let me try to expand on it. Our goal is to make a modern literate programming tool. On a surface level, a tool like that would end up looking very similar to Jupyter, though with better features. We've mentioned some things we'd like to have in this final tool in our README and also in the post above. Our first thought was to make a tool from scratch. The challenge was, it's very hard to get people to switch and so, we had to go where people already are - that meant Jupyter. We could've made this one feature an extension with some difficulty (in-fact, our early experiments, we started by making an extension). It would have some downsides - we wouldn't have granular control over certain core Jupyter behaviours like we do right now (for eg, we wanted to allow creating hidden folders to store some files). But we probably could have made a 95% working version of Pretzel work as a jupyter extension. The bigger reason we chose to fork was because down the line, we want to completely change the code execution model to being DAG based to allow for reproducible notebooks (similar to https://plutojl.org/ https://plutojl.org/ for eg). Similarly, we want to completely remove Codemirror and replace it with Monaco (the core editor engine in VSCode) to provide a more IDE like experience in Jupyter. These things simply couldn't have been done as extensions.
- deleted 2y ago[deleted]
- ramonverse 2y agoRamon here, the other cofounder of Pretzel! Quick update: Based on some early feedback, we're already working on adding support for local LLMs and Claude Sonnet 3.5. Happy to answer any questions!
- westurner 2y agobraintrust-proxy: https://github.com/braintrustdata/braintrust-proxy https://github.com/braintrustdata/braintrust-proxy LocalAI: https://github.com/mudler/LocalAI https://github.com/mudler/LocalAI E.g promptfoo and chainforge have multi-LLM workflows. Promptfoo has a YAML configuration for prompts, providers,: https://www.promptfoo.dev/docs/configuration/guide/ https://www.promptfoo.dev/docs/configuration/guide/ What is the system prompt, and how does a system prompt also bias an analysis? /? "system prompt" https://hn.algolia.com/?dateRange=all&page=0&prefix=false&query=%22system%20prompt%22&sort=byDate&type=story https://hn.algolia.com/?dateRange=all&page=0&prefix=false&qu...