Google has announced the availability of a new Visual Studio Code extension that connects local notebooks to a Colab runtime. This allows developers to unify their previously separate local development setup and web-based Colab environment.
The Google Colab team explains they identified the gap existing between those two environments through community feedback, including blog posts, forum threads, and popular GitHub repositories documenting workarounds.
Until now, these two worlds have been mostly separate. Users had customized VS Code environments for project development, and web-based Colab environments for notebook execution, visualization, and training/inference workloads.
With the new Visual Studio Code Colab extension, developers can use Colab directly within the same VS Code editor that powers their development workflow by connecting local notebooks to Colab runtimes, including Pro-tier runtimes with premium GPUs and TPUs.
For Colab users, the new extension supports several common workflows, such as working on notebooks that are part of a larger project or Git repository. They also benefit from the more powerful IDE features that come with VS Code in comparison to the web-based Colab editor. ML engineer Wesley Kambale highlights several advanced workflows enabled by this new integration such as using RAPIDS cuDF for GPU accelerated analysis of large data collections, generating art from withing VS Code, and more. Kambale says that the Colab VS Code integration:
empowers developers and ML engineers to harness free GPUs and TPUs directly within their preferred editor, streamlining workflows and accelerating innovation. While still in its early stages, the extension represents a significant step forward in making AI and machine learning development more accessible and productive.
As Google developer Glen Yu explains, Colab was originally designed as a web-based interface, including features that cannot be entirely replicated within VS Code. In particular, developers cannot access user data via userdata.get() or mount Google Drive using drive.mount(). In his article, Yu also describes how the Colab extension can be used to fine-tune gemma_isntruct_1b using LoRA tuning and manage secrets you need to provide to external services to access ML models.
A full list of known issues and workarounds is available on the colab-vscode extension GitHub repo. The Colab team also noted that they will consider upvotes on GitHub issues when prioritizing work on missing features.
Before the VS Code extension was available, developers relied on workarounds to bridge the two environemnts. On common approach was using GitHub and git to work on a notebook locally, push it to a repo, and then open it from there using Google Colab. For more advanced integration, some developers used a remote tunnel from their local machines to a Colab runtime. For simples workflows, developers could also connect directly to Google Drive storage from Colab.
