colab_execute_file
Execute a local .py script on a Google Colab GPU/TPU runtime. Supports T4, L4, A100, H100 accelerators.
Instructions
Execute a local Python file on a Google Colab GPU/TPU runtime.
Reads the file contents and sends them for execution on a Colab runtime. Use this instead of colab_execute when you already have a .py script file ready to run.
After execution:
Check exit_code and cell outputs in the response.
If you need to collect output files (models, images), use colab_execute_notebook instead.
Common issues:
Only .py files are accepted (security restriction).
File must exist at the given path on the local machine.
Args: file_path: Path to a local .py file to execute on Colab. accelerator: Hardware accelerator type. Default: "T4". GPU types: "T4" - NVIDIA Tesla T4 (16 GB, free-tier) "L4" - NVIDIA L4 (24 GB, Colab Pro) "A100" - NVIDIA A100 (40 GB, Colab Pro/Pro+) "H100" - NVIDIA H100 (80 GB, Colab Pro+) "G4" - NVIDIA G4 (Colab Pro+) TPU types: "V5E1" - TPU v5e-1 (Colab Pro+) "V6E1" - TPU v6e-1 (Colab Pro+) high_memory: Enable high-memory runtime (more RAM). Default: False. timeout: Max execution time in seconds (10-3600). Default: 300.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| timeout | No | ||
| file_path | Yes | ||
| accelerator | No | T4 | |
| high_memory | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |