Skip to main content

⚡ vspagent

PyPI version Python Versions License: MIT

Agent Orchestrator for AI model training and tuning.

vspagent is a lightweight Python agent orchestrator that connects any AI application, web backend, or developer CLI to Google Colab Cloud GPUs (Tesla T4, A100, V100) via the Model Context Protocol (MCP) with zero local VRAM/GPU requirements.

Whether you are orchestrating fine-tuning jobs (ModernBERT, Laya), running deep learning inference (TotalSegmentator, MedGemma), or dispatching heavy audio/vision pipelines (Demucs, Seed-VC), vspagent orchestrates the entire cloud GPU lifecycle seamlessly.


🌟 Key Capabilities

  • 🤖 Agentic MCP Orchestration: Manages the colab-mcp stdio daemon, JSON-RPC protocol, and tool invocations behind clean, Pythonic abstractions.
  • 👤 Intelligent Account & Profile Routing: Automatically detects signed-in Google/Chrome profiles across Linux, WSL, Windows, and macOS, dispatching browser pairing to the desired Google account.
  • 🚀 Remote Cloud GPU Dispatch: Injects, monitors, and cleans up remote execution payloads on Colab runtimes with real-time log streaming and traceback extraction.
  • 📁 Automated Cloud File Transfer: High-speed, chunked bidirectional file synchronization between local storage and remote Colab file systems.
  • 🔌 Drop-in Web Framework Adapters:
    • FastAPI: One-line app.include_router(get_colab_router()) providing ready-to-use /colab/status, /colab/accounts, /colab/connect, /colab/execute endpoints.
    • Flask: One-line app.register_blueprint(get_colab_blueprint()) supporting synchronous multi-threaded Flask backends.
  • 🖥️ Interactive Terminal CLI: Built-in developer CLI with rich tables, live account discovery, connection health checks, and direct code dispatch.
  • 🪶 Zero-Dependency Local Footprint: Keeps local environments clean (<1MB). Heavy machine learning dependencies (torch, cuda, transformers) stay isolated on the remote cloud GPU.

📦 Installation

pip install vspagent

🛠️ Quickstart

1. Python SDK — Direct Agent Orchestration

import asyncio
from vspagent import ColabClient

async def main():
    colab = ColabClient()
    
    # 1. Orchestrate pairing with the user's preferred Google account
    print("Initiating Colab agent handshake...")
    await colab.connect_browser(profile_directory="Default")
    
    # 2. Await tab authorization in Chrome
    await colab.ensure_connected(timeout=60.0)
    print(f"Connected to Cloud GPU: {colab.gpu_info}")
    
    # 3. Dispatch remote GPU execution
    payload = """
import torch
print("Agent GPU Ready:", torch.cuda.get_device_name(0))
    """
    res = await colab.execute_code(payload, keep_cell=False)
    print("Remote Output:\n", res["output"])

asyncio.run(main())

2. FastAPI Web Orchestration (e.g. Vibe-ML-Studio, Vibe-MI-Stdio)

Mount the orchestrator directly into your FastAPI application:

from fastapi import FastAPI
from vspagent.colab.integrations import get_colab_router

app = FastAPI(title="My GPU-Accelerated Service")

# Exposes /colab/status, /colab/accounts, /colab/connect, /colab/execute
app.include_router(get_colab_router(), prefix="/api")

3. Flask Web Orchestration (e.g. Karaoke Extractor)

from flask import Flask
from vspagent.colab.integrations import get_colab_blueprint

app = Flask(__name__)

# Exposes /colab/status, /colab/accounts, /colab/connect, /colab/execute
app.register_blueprint(get_colab_blueprint(), url_prefix="/api/colab")

4. Interactive Terminal CLI

# Discover available Google / Chrome profiles
vspagent colab accounts

# Inspect Colab MCP orchestrator status & GPU hardware
vspagent colab status

# Interactively pair terminal session with Colab tab
vspagent colab connect

# Dispatch inline code to Colab GPU
vspagent colab exec -c "import torch; print(torch.cuda.is_available())"

# Dispatch a local Python script to remote Colab GPU
vspagent colab exec -f ./train_model.py

📄 License

MIT License © Vishnu Suresh Perumbavoor

Metadata

Release files for vspagent 3.0.2

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

Source distribution (sdist)

Source distribution for vspagent 3.0.2
File Size Uploaded Provenance Actions
vspagent-3.0.2.tar.gz 19.4 kB Without provenance Details for vspagent-3.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for vspagent 3.0.2
File Interpreter ABI Platform Actions
vspagent-3.0.2-py3-none-any.whl Python 3 none any Details for vspagent-3.0.2-py3-none-any.whl

Total release size: 39.7 kB

Release files / vspagent-3.0.2.tar.gz

Download URL vspagent-3.0.2.tar.gz
Size 19.4 kB
Tags Source
SHA-256 checksum
How to use checksums
ef363dcce3129fb30b0c4510ff233f376a10860e20cab28ece22287b787f5992
BLAKE2b-256 checksum
How to use checksums
6e862c2a44d92fe51bf4161858504ed92d76198838d92b846c0d30b8c96cb625
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / vspagent-3.0.2-py3-none-any.whl

Download URL vspagent-3.0.2-py3-none-any.whl
Size 20.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3f75097332b6f6c15919c617fb202f2ccb52a161a8426ff5fbb364300bc18bfc
BLAKE2b-256 checksum
How to use checksums
c67a07bba0a3e0feb8b7aab8e6ca2e05d87e5ba31056481456c07061fe6feef4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Security for vspagent 3.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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