How kushalkumarj2006/colab-api works
This repository implements a FastAPI service for authorizing users and managing remote Google Colab runtimes. The main workflow obtains OAuth credentials, assigns a Colab runtime (optionally with a GPU or TPU), initializes a Jupyter kernel, and exposes runtime operations such as code execution and session keep-alive or deletion. The sampled source shows the authentication, assignment, kernel-creation, and lifecycle calls; the execution endpoint’s intervening code is omitted, so its connection to the runtime is shown as unverified.
Main entry points: main.py FastAPI service
Components 10
HTTP API
- FastAPI service
main.py
Authorization
- OAuth helpers
main.py - Credential refresh
main.py
Remote runtime
- Colab client
main.py - Runtime client
main.py - Code execution
main.py
Other components
- API client
- Google OAuth
- Colab service
- Jupyter kernel
Connections 13
- API client → FastAPI service: calls endpoints
main.py - FastAPI service → OAuth helpers: requests auth URL
main.py - FastAPI service → OAuth helpers: exchanges code
main.py - OAuth helpers → Google OAuth: requests tokens
main.py - FastAPI service → Credential refresh: refreshes credentials
main.py - FastAPI service → Colab client: assigns runtime
main.py - Colab client → Colab service: sends requests
main.py - FastAPI service → Runtime client: creates kernel
main.py - Runtime client → Jupyter kernel: creates kernel
main.py - FastAPI service → Code execution: handles execution
main.py - Code execution → Runtime client: runs code
main.py - FastAPI service → Colab client: keeps alive
main.py - FastAPI service → Colab client: unassigns runtime
main.py