Contents
Google Colab's G4 GPU instance (NVIDIA RTX PRO 6000 Blackwell with 96GB VRAM + 176GB system RAM) is just big enough to run dealignai/Qwen3.8-Flash-Next-CYBERSECURITY-NVFP4 at its full 262K context window on a single card, reaching 130–176 tok/s single-stream generation with MTP speculative decoding enabled.
I packed environment setup, precompiled kernel restoration, weight pulling / Google Drive mounting, SGLang startup, and Cloudflare Tunnel reverse proxying into a single script, open-sourced at mizorewww/colab-qwen38-g4. Follow the four copy-paste steps below to deploy, connect, and shut down cleanly.
Step 1: Install and Log In to the colab CLI
Make sure your Google account has Colab Pro / Pro+ (with G4 quota), then run in your local terminal:
uv tool install google-colab-cli
gcloud auth application-default login \
--scopes=openid,https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/userinfo.email,https://www.googleapis.com/auth/colaboratory
# Verify login succeeded:
colab sessionsbashStep 2: Clone the Repository and Launch
git clone https://github.com/mizorewww/colab-qwen38-g4.git
cd colab-qwen38-g4
# Interactive launch (just press Enter through the prompts):
python3 run_qwen38_g4.pybashThe script will prompt you in order (pressing Enter accepts the recommended defaults):
- Session name: defaults to
qwen38-g4(automatically provisions a new G4 instance if it doesn't exist yet). - Weight download method:
- For your first run, pick the default
[1] Fast Direct NVMeto pull weights directly from HuggingFace to Colab's local disk at high speed (~6.5 minutes, takes zero Google Drive space); - If you want to persist the weights in your own Google Drive for future sessions, pick
[2] Mount Google Driveand click the authorization link printed in the terminal.
- For your first run, pick the default
- Acceleration mode: defaults to
[1]with MTP speculative decoding enabled (130–176 tok/s, allocating a 472K-token KV cache pool). - API Key: generates a random key by default to protect the reverse-proxy tunnel.
- Write to
piconfig: enteryafter deployment to automatically update~/.pi/agent/models.json.
If you prefer a non-interactive run, you can launch everything with a single command:
colab run --gpu G4 --keep -s qwen38-g4 --timeout 1800 run_qwen38_g4.pybashOnce the terminal prints the block below, the server is ready:
========================================================================
DEPLOYMENT SUCCESSFUL
TUNNEL_BASE_URL=https://xxxx.trycloudflare.com/v1
API_KEY=sk-qwen38-...
MODEL_ID=dealignai/Qwen3.8-Flash-Next-CYBERSECURITY-NVFP4
========================================================================Step 3: Use It in pi or Any OpenAI Client
If you chose to automatically update ~/.pi/agent/models.json in the wizard, you can use it right away:
pi --model "colab-g4/dealignai/Qwen3.8-Flash-Next-CYBERSECURITY-NVFP4" -p "Check my local machine specs"bashTo configure ~/.pi/agent/models.json manually, copy and paste the snippet below (replacing baseUrl and apiKey with the values printed in your terminal):
{
"providers": {
"colab-g4": {
"name": "Colab G4 SGLang",
"baseUrl": "https://xxxx.trycloudflare.com/v1",
"api": "openai-completions",
"apiKey": "sk-qwen38-...",
"models": [
{
"id": "dealignai/Qwen3.8-Flash-Next-CYBERSECURITY-NVFP4",
"name": "Qwen 3.8 Flash Next Cybersecurity NVFP4 (Colab G4)",
"reasoning": true,
"input": ["text", "image"],
"contextWindow": 262144,
"maxTokens": 65536,
"compat": {
"supportsStore": false,
"supportsDeveloperRole": false
},
"thinkingLevelMap": {
"off": null,
"minimal": "low",
"low": "low",
"medium": "medium",
"high": "xhigh",
"xhigh": "xhigh",
"max": "xhigh"
},
"samplingParams": {
"temperature": 1.0,
"top_p": 0.95
},
"samplingParamsByThinkingLevel": {
"off": {
"temperature": 0.7,
"top_p": 0.8
}
}
}
]
}
}
}jsonYou can also call the endpoint directly with curl:
curl -s "https://xxxx.trycloudflare.com/v1/chat/completions" \
-H "Authorization: Bearer sk-qwen38-..." \
-H "Content-Type: application/json" \
-d '{
"model": "dealignai/Qwen3.8-Flash-Next-CYBERSECURITY-NVFP4",
"messages": [{"role": "user", "content": "Hello"}],
"chat_template_kwargs": {"reasoning_effort": "low"}
}'bashStep 4: Shut Down When Done (Stop Billing)
Remember to stop the instance when you are done so it doesn't keep burning compute units:
colab stop -s qwen38-g4
colab sessionsbash