Use a Colab runtime from a local VS Code notebook
Google’s VS Code extension connects local notebooks to hosted compute, with GPU availability and file-transfer limits.
Google released an official Colab extension for VS Code in November 2025. It lets you keep editing a local .ipynb notebook in VS Code while running its cells on a hosted Colab runtime. This brings Colab’s compute options into a familiar editor without moving the notebook itself into the browser.
The exciting shorthand is “local files, free T4 GPU,” but it needs two qualifications. Colab’s free tier can offer GPU access, yet Google does not guarantee a particular GPU type, availability, or unlimited runtime. And the hosted runtime is a separate computer: it cannot read arbitrary files from your laptop just because the notebook is local. Upload the needed data or make it available through an appropriate remote source.
Connect a notebook
Install the official Google Colab extension from the VS Code Marketplace. Open or create a local .ipynb file, run a cell or choose Select Kernel, select Colab, choose a runtime, and sign in. Google notes that the Jupyter extension may also be required.
Check the actual hardware
Select a GPU runtime if the workload needs one, then inspect the assigned hardware in the session before planning around T4-specific memory or performance. Colab’s free resources and usage limits fluctuate. Premium GPUs and TPUs are available through paid tiers when offered, and even those resources remain subject to availability.
Move data deliberately
The local notebook file stays in your VS Code workspace, while code executes in Google’s hosted runtime. A relative path such as data/train.csv resolves on that remote machine, not on your laptop. The extension provides file-upload actions, and other workflows can use cloud storage. Confirm that the required file exists in the remote runtime before running an expensive job.
Where it helps
This setup is useful when a project already lives in VS Code and only selected notebook work needs remote acceleration. Keep reproducible environment setup and data locations in the notebook or project notes, because Colab sessions can time out or be replaced.