Skip to main content

colab-ask 🪄

Ask Example Animation

Colab-Ask is a magic command that sends your code, outputs, and even generated images (matplotlib, etc.) directly to models like Claude or GPT-4 for context-aware help.

Why use this?

  • Context Aware: It sees your text and code cells, and error traces.
  • Vision Capable: It can see embedded images and graphs.
  • Native Integration: Lives inside Colab. No alt-tabbing to ChatGPT.
  • Privacy First: Your data goes straight to the API. No middleman servers.

Prerequisites (Before you start)

  1. Google Colab: This extension is designed specifically for the Colab environment.
  2. API Keys: You need an API key for your preferred provider (OpenAI, Anthropic, Gemini, etc.).
    • Click the Key Icon (Secrets) on the left sidebar in Colab.
    • Add a new secret (e.g., ANTHROPIC_API_KEY or OPENAI_API_KEY).
    • Toggle "Notebook access" ON.

Quick Start

Run this in a cell to install and load the extension:

!pip install colab-ask
%load_ext colab-ask

1. The Basic Ask

Use %%ask to chat about your current notebook state.

%%ask
My training loop is stalling at epoch 5. based on the logs above, why?

2. The Vision Ask

Since colab-ask sees images, you can ask about plots:

# (After generating a matplotlib chart)
%%ask
Look at the plot above. Is the model overfitting?

Configuration

Change Model: Uses LiteLLM under the hood. Any supported model string works. Check https://docs.litellm.ai/docs/providers

%set_model claude-3-5-sonnet-20241022

Set System Prompt: Want a specific teaching style?

%%set_sys
You are a senior Python engineer. Be concise. 
Focus on performance optimization and vectorized operations.

Default System Prompt

By default, colab-ask uses this system prompt:

You are an AI assistant inside a Google Colab notebook.
In your response, craft guidance on the next step, whether code related, or more strategy related.
Don't spew out all the steps at once, the user wants to go slow, they will ask for more if they need it.
The user is interested in improving their coding, and may choose to make code blocks in response to your input.

This prompt is inspired by SolveIt (the fast.ai dialog engineering environment), which emphasizes:

  • Small steps: Breaking down problems incrementally
  • Interactive learning: Waiting for user feedback before proceeding
  • Code-focused: Encouraging hands-on implementation

Privacy & Data

  • Direct Communication: Notebook data is sent directly from your browser/runtime to the LLM provider (OpenAI/Anthropic/Google).
  • Zero Logs: We do not run a middleware server. We do not store your code.

Metadata

Release files for colab-ask 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for colab-ask 0.1.6
File Size Uploaded
colab_ask-0.1.6.tar.gz 7.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for colab-ask 0.1.6
File Interpreter ABI Platform
colab_ask-0.1.6-py3-none-any.whl Python 3 none any Details

Total release size: 14.8 kB

Release files / colab_ask-0.1.6.tar.gz

Download URL colab_ask-0.1.6.tar.gz
Size 7.3 kB
Tags Source
SHA-256 checksum
How to use checksums
23a93186d31b69bfea68d8ed35e426b7187dfc899a4a94fe3641cc21e0c3e1ab
BLAKE2b-256 checksum
How to use checksums
6bd35b90e45e0bfd0430e3c64966be621252b0f3504586a44d484031e25b792c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.9

Release files / colab_ask-0.1.6-py3-none-any.whl

Download URL colab_ask-0.1.6-py3-none-any.whl
Size 7.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
60b727c38b701ce46fa81578859575b2e49c65861d3960733ca5b6babe6745b9
BLAKE2b-256 checksum
How to use checksums
02919a8675f7942a6bf052a4e66937406e42626504e3034e3e0a5a87eadfd31e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.9

Release history Release notifications | RSS feed

This release

0.1.6 This release

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page