Harness the power of code generation directly in your Domino Workspace. Domino has built-in coding assistants to help accelerate your productivity with a wide variety of tasks, including data preparation, analysis, training machine learning models, and more. Domino provides flexibility to use the best tools while also allowing administrative control to honor and enforce the security and privacy policies of your company. This article will guide you through multiple options to help you choose the best for your needs.
Jupyter AI gives data scientists an on-demand AI coding assistant to save time on mundane tasks and simplify complex ones. This helps you boost productivity by generating code that can fix errors, summarize content, ask questions, and even generate entire notebooks from natural language prompts. It also works with multiple IDEs, including notebook-based IDEs like VS Code and Jupyter Notebook, with Jupyter AI magic commands. With JupyterLab, you have access to the Jupyternaut chat interface.
UI-based Jupyternaut chatbot (JupyterLab)
To explore the Jupyternaut chatbot:
-
Create a new Workspace. Select JupyterLab and Domino Standard Environment for your Environment.
-
In JupyterLab, click on the chat icon in the left panel to open the chat interface.
To learn how to configure and use Jupyternaut, visit Jupyter AI’s official documentation.
Inline coding assistance with %ai and %%ai magic commands
Access Jupyter AI in notebook IDEs such as Jupyter and VS Code using the %ai
and %%ai
magic commands.
-
Create a new Workspace. Select Jupyter Notebooks and Domino Standard Environment for your Environment.
-
Get an API key from your LLM provider. For example, OpenAPI users can find their API keys on their OpenAI API Keys page.
-
In a notebook, update the environment variable matching the API key for your preferred LLM provider. For ChatGPT, use the
OPEN_AI_KEY
variable.%env OPEN_API_KEY = <YOUR_OPEN_API_KEY>
TipYou can use Domino environment variables to securely store credentials like API keys. -
Load the AI Magic extension with
%load_ext jupyter_ai_magics
.
You can now use the %ai
magic to call your CodeGen assistant. For more information, refer to the official Jupyter AI magic commands documentation.
Install Jupyter AI in a custom Environment
To avoid repeating the previous steps every time you launch a Workspace, you can pre-configure your Environments to store the API key as an environment variable and pre-enable the %%ai
magic extensions:
-
In Domino, click Environments > select your Environment > Edit definition > Dockerfile instructions.
-
Add the following Dockerfile instructions to save your API key as an environment variable:
ENV OPENAI_API_KEY=<Your OpenAI Key>
-
To enable the Magic Extension for JupyterAI, add the following code:
RUN ipython profile create && echo "c.InteractiveShellApp.extensions=['jupyter_ai_magics']" >> /home/ubuntu/.ipython/profile_default/ipython_config.py
Domino supports a diverse array of coding assistants, including GitHub Copilot, to enhance the development experience within VS Code workspaces. GitHub Copilot is an AI-powered code completion tool that assists developers by suggesting whole lines or blocks of code as they type. It’s like having a pair of expert eyes that help you code faster and learn new APIs and languages along the way.
To set up and use GitHub Copilot from within VS Code on Domino, follow the steps below.
Step 1: Install VS Code in Domino
Ensure that VS Code is installed and properly configured in your Domino Environment. If VS Code is not yet installed, refer to the Domino documentation on setting up development environments to integrate VS Code.
Step 2: Download the GitHub Copilot VSIX
-
Go to the GitHub Copilot extension page on the Visual Studio Marketplace.
-
Look for the Download Extension link on the right side of the page and download the
.vsix
file. Ensure you save this file to a location accessible from your Domino Environment.
Step 3: Install GitHub Copilot in VS Code
-
Launch VS Code from your Domino Workspace.
-
Open the Extensions view by clicking on the square icon on the sidebar or pressing
Ctrl+Shift+X
. -
Click on the … (More Actions) button at the top of the Extensions view.
-
Select Install from VSIX… from the dropdown menu.
-
Locate the
.vsix
file you downloaded earlier and select it to start the installation.
Step 4: Connect to GitHub Copilot
-
Once the installation is complete, sign in to GitHub to activate GitHub Copilot.
-
Follow the prompts in VS Code to sign in to your GitHub account. This may require generating a token from your GitHub account.
-
After signing in, enable GitHub Copilot by accessing the command palette (
Ctrl+Shift+P
), typing “Copilot”, and selecting GitHub Copilot: Enable. -
If prompted, configure any additional settings according to your preferences.
Domino Code Assist provides an intuitive point-and-click interface to accelerate common analysis and data science tasks. Code Assist generates modifiable boilerplate code in Python and R to jump-start productivity while giving you full control over your code.
Code Assist offers several benefits, including:
-
Enhanced productivity — Tests showed that Code Assist enhanced the productivity of analysts, who were new to Python (new graduates), by 5-20x.
Task Novice Productivity Gain Expert Productivity Gain Make a visualization
5x faster
1x faster
Connect to Snowflake and import data
5x faster
2x faster
Make an app
10x faster
2x faster
Publish & share a dashboard
20x faster
3x faster
-
Increased portability — The code generated by Code Assist is always generic Python or R code. Therefore, it’s perfectly portable and can be productionized or downloaded and run off-platform.
-
Enhanced skills — Generating Python and R code interactively via Code Assist is a powerful learning tool. It flattens the learning curve and makes complex topics easily accessible.
Code Assist data prep
Quickly import data from various data sources with boilerplate code generated from your data connections.
Clean and prep your data with Code Assist transformations.
AutoML and generative AI foundation models
Train a low-code model using Domino AutoML. Just choose your dataset and specify the prediction task. AutoML will handle data preparation, algorithm testing, and hyperparameter optimization to find the best model for you. AutoML speeds up repetitive tasks and provides starting code for more advanced projects.
![AutoML experiment options](/images/code-assist/automl/automl-configure-settings.png)
Fine-tune large language models (LLMs) and computer vision models affordably with Domino’s Foundation Models. You choose a foundation model and dataset to fine-tune it and Domino Code Assist generates code to preprocess the data and execute a model trainer. All the training code and experiment results are yours to track and change.
Streamline apps and visualizations
Quickly package and share your findings with data visualizations and applications, built directly from Jupyter code cell outputs.
![Create Code Assist data visualization apps](/images/code-assist/app/app-preview.png)
Reuse code snippets to automate repetitive tasks and build consistency.