Google just released Colab - VS Code Extension
You can now run GPU/TPU Hardware Accelerator Kernels on VS Code
Attention VS Code developers: Google just released the Colab extension. Now let the GPU go brrr right in VS Code.
If you spend most of your time in VS Code but still rely on Colab for GPU or quick testing, this little extension makes life easier. No more switching tabs or copying code back and forth.
Let me break this down for you.
Watch Step-by-step video
Google Colab <> VS Code Extension
Alright, firstly, let’s install the extension: Open VS Code, head to the Extensions tab (you can just press Ctrl+Shift+X on Windows or Cmd+Shift+X on Mac), and search for “Google Colab”. If not, click here to re-direct: Colab<>VS Code.
Click Install on the official one. If it asks you to install the Jupyter extension too, go ahead. It’s just helping things run behind the scenes.
Now, create a new file with the
.ipynbextension. Then look up in the top-right corner, you’ll see a little button that says something like “Select Kernel.” Click it.Then pick “Colab” from the list. A prompt will pop up that redirects to sign in with your Google account.
After signing in with your Google account, click Select Kernel again, choose New Colab Server.
Pick your preferred hardware accelerator, for example GPU. Once selected, choose T4 as your runtime, give your kernel a name (any name), and press Enter.
That’s it. Congratulations, you’ve successfully connected Colab runtime to VS Code editor.
Testing Time: Getting started with Colab in VS Code
Check Hardware Accelerator
We’ll use PyTorch to verify if a GPU is available for your tasks.
Notice we didn’t need to install PyTorch separately with UV because Colab comes pre-loaded with the most common packages.
This is one of the conveniences of working in the Colab environment and starting from now, in VS Code too.
import torch
if torch.cuda.is_available():
print(f"Using GPU: {torch.cuda.get_device_name(0)}")
else:
print("Using CPU")We can also run !nvidia-smi to get a detailed view of the GPU hardware, including memory usage and driver info.
!nvidia-smiAlright, now that I have 24GB of VRAM on the NVIDIA L4, let’s put it to the test by running inference with Ollama models.
Ollama on VS Code using GPU from Colab
Installation
!uv pip install ollamaServe Ollama
!curl -fsSL https://ollama.com/install.sh | sh
!nohup ollama serve > ollama.log &Pull Ollama Model
import ollama
model_name = "gemma3n:e4b"
ollama.pull(model_name)Run User Query
user_query = """
What is special about Lantau Island?-> talk as a Native speaker
"""
response = ollama.chat(model=model_name, messages=[
{"role": "user",
"content": user_query,
}])
print(response.message.content)Output:
Alright, so you want to know what makes Lantau Island special? As a local, I can tell you it’s a really unique place – a bit of a mix of old and new, and definitely has its own vibe.
First off, **the Big Buddha (Tian Tan Buddha) and Po Lin Monastery are iconic**. Seriously, you can’t come to Lantau without seeing them. They’re not just beautiful structures, they’re a symbol of Hong Kong’s spiritual side and a really peaceful place to visit. The hike up to the Buddha is stunning, too, with incredible views of the coastline.
But it’s more than just that. **Lantau has a really laid-back, almost rural feel in parts.** You can find hidden beaches, quiet villages, and lush hiking trails that feel a world away from the hustle and bustle of the city. It’s a great place to escape and reconnect with nature.
**The Ngong Ping 360 cable car is a big draw, of course.** It’s a fantastic way to get up to the Big Buddha and offers breathtaking panoramic views. But even without the cable car, the island has a lot of hidden gems.
**It’s also got a fascinating history.** Lantau was a major trading post in the past, and you can still see remnants of that history in some of the old villages and temples.
And finally, **the people are friendly and welcoming.** It’s a slower pace of life out there, and you’ll often find locals happy to chat and share a bit about their island home.
So, yeah, Lantau is special because it’s got this incredible blend of spiritual significance, natural beauty, historical depth, and a relaxed atmosphere. It’s a place that really stays with you. It’s not just a destination, it’s an experience.This is me at Lantau Island 🇭🇰, haha. Amazing place to be honest:


If you haven’t watched the latest YouTube video on Dataset Creation to Evaluate RAG | LLM as a Judge Explained. Watch now:








Great Article and crisp helpful for everyone.Quick testing in colab and work in vscode project great share Tarun.
@Tarun Jain when we are using colab and using TPU for some project where it stored. I checked it is not stored in drive so is it getting stored locally or it is just there for temporary time!