Skip to content
| Marketplace
Sign in
Visual Studio Code>Machine Learning>ModalNew to Visual Studio Code? Get it now.
Modal

Modal

Samarth P

|
2 installs
| (1) | Free
Connect notebooks to Modal remote Jupyter kernels with GPU/CPU compute.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Modal VS Code Extension

Connect your VS Code notebooks to Modal's remote Jupyter kernels with flexible GPU/CPU compute resources.

Features

  • One-Click Server Creation: Launch Modal Jupyter servers directly from VS Code
  • Flexible Compute: Choose from CPU-only or GPU instances (T4, A10G, A100, H100)
  • Customizable Resources: Configure CPU cores, memory, and timeout settings
  • Server Management: List, create, and remove Modal servers with ease
  • Secure Storage: Server configurations stored securely in VS Code secrets

Prerequisites

  1. VS Code version 1.99.0 or higher

  2. Jupyter Extension for VS Code (automatically installed as dependency)

  3. Modal CLI installed and configured:

    pip install modal
    modal setup
    
  4. Modal Account: Sign up at modal.com (free $30/month credits)

Installation

  1. Install from the VS Code marketplace (coming soon) or install manually:

    cd modal-vscode
    npm install
    npm run compile
    
  2. Press F5 in VS Code to launch the extension in debug mode

Quick Start

  1. Open or create a notebook file (.ipynb)

  2. Select Kernel:

    • Click on the kernel picker in the top right
    • Choose "Modal" from the list
    • Select "New Modal Server"
  3. Configure your server:

    • Enter a name for your server
    • Choose GPU type (or CPU-only)
    • Set CPU cores and memory
  4. Wait for connection: The extension will automatically:

    • Generate a Modal app with your specifications
    • Deploy it to Modal's infrastructure
    • Connect your notebook to the remote kernel
  5. Start coding! Your notebook now runs on Modal's cloud infrastructure with automatic management

Commands

Access these via Command Palette (Ctrl+Shift+P or Cmd+Shift+P on Mac):

Command Description
Modal: Create New Server Launch a new Modal Jupyter server
Modal: List Servers View all configured Modal servers
Modal: Remove Server Delete a Modal server configuration
Modal: Refresh Servers Refresh the server list

Configuration

Configure the extension in VS Code Settings (Preferences: Open Settings (JSON)):

{
  "modal.logging.level": "info",  // off, error, warn, info, debug, trace
  "modal.apiUrl": "https://api.modal.com"
}

How It Works

  1. The extension integrates with VS Code's Jupyter extension
  2. When you create a new server, the extension automatically:
    • Generates a Modal Python app with your specifications
    • Saves it to a temporary location
    • Runs modal run in the background
    • Monitors the output for connection information
  3. Modal provisions the requested compute resources and starts Jupyter
  4. The extension automatically extracts the connection URL and token
  5. Your notebook connects seamlessly to the remote kernel
  6. Your code executes on Modal's infrastructure with the configured resources
  7. When you're done, removing the server cleans up all temporary files

GPU Options

Available GPU types:

  • T4: Cost-effective, great for development and light inference
  • A10G: Balanced performance for training and inference
  • A100: High-performance for large models and intensive training
  • H100: Latest generation, maximum performance

Example Use Cases

  • Machine Learning: Train models with GPU acceleration
  • Data Science: Process large datasets with ample memory
  • Deep Learning: Run PyTorch or TensorFlow on powerful GPUs
  • Research: Experiment with different compute configurations
  • Development: Test code on production-like infrastructure

Troubleshooting

Modal CLI not found

pip install modal
modal setup

Server won't start

  • Check that you're logged into Modal: modal token list
  • Verify you have sufficient credits: modal profile current
  • Check the Modal terminal output for detailed error messages
  • Ensure your Modal workspace has the necessary permissions
  • Check the Modal terminal output for detailed error messages
  • Ensure your Modal workspace has the necessary permissions

Can't connect to server

  • Wait for the "Connected!" notification before trying to use the kernel
  • Check that the Modal tunnel is still active in the background
  • Try refreshing the server list or recreating the server

Contributing

Contributions are welcome! This extension is inspired by Google's colab-vscode extension.

License

MIT License - See LICENSE file for details

Resources

  • Modal Documentation
  • Modal Examples
  • VS Code Jupyter Extension
  • Report Issues

Acknowledgments

This extension is modeled after Google Colab's VS Code extension and adapted for Modal's infrastructure.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft