Skip to main content

An LLM assistant magic command for Google Colab notebooks.

Project description

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.

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

colab_ask-0.1.1.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

colab_ask-0.1.1-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file colab_ask-0.1.1.tar.gz.

File metadata

  • Download URL: colab_ask-0.1.1.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for colab_ask-0.1.1.tar.gz
Algorithm Hash digest
SHA256 3ff3d7ce81e73b34030e35c945ca338784e685ddcd6cacee11f22fa26d203918
MD5 2be80274b38d5bf0b7a76b2dae4bc5ea
BLAKE2b-256 54f9d85c09fb976adb084842eb7767dd14c3c224ee9d22962aa05f3396d81c2a

See more details on using hashes here.

File details

Details for the file colab_ask-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: colab_ask-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for colab_ask-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 66fd91e1260e182cf80b36f6e573aaee044b258de3beaa6a0dfaf24e1562faf0
MD5 c55e2a9e2502edf83e3e4faf2069b6de
BLAKE2b-256 1186307f254f623230c29d35d2188c40eee2b7dc808477fa8758e0d9ace5b3fc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page