Flux Compute VS Code Extension
Flux Compute lets students run model training remotely on cloud GPUs while continuing local development in VS Code.
Setup Guide
What it does
- Handles login/authentication from inside VS Code.
- Adds a dedicated Jobs panel (tree view) in the Flux Compute activity bar.
- Adds a click-first Control Center with action buttons in the Flux Compute activity bar.
- Scans the workspace and suggests likely training scripts.
- Prompts for:
- Training file to run
- GPU type
- Budget in USD
- Shows estimated cost before submit and warns if account balance is low.
- Shows a mandatory warning before upload not to send personal or regulated data.
- Packages project code using ignore rules similar to
.gitignore, excluding common secrets and bulky/generated files by default.
- Uploads package and queues a remote training job.
- Streams remote logs into the Flux Compute output channel.
- Notifies on completion or failure.
- Shows account balance (command + status bar).
- Downloads completed job artifacts (model, logs, outputs) into the workspace.
- Lets users delete remote uploaded source, logs, and outputs at any time.
Commands
Flux Compute: Submit Training Job
Flux Compute: Download Training Artifacts
Flux Compute: Login
Flux Compute: Logout
Flux Compute: Show Account Balance
Flux Compute: Refresh Jobs
Flux Compute: Open Job Details
Flux Compute: Delete Remote Job Data
Tip:
- Students can use the Control Center view with inline form fields and buttons (no input pop-up prompts) for login, submit, refresh status, balance, and artifact download.
Settings
cloudTrainer.apiBaseUrl: Base API URL (required)
cloudTrainer.apiKey: Bearer token for API auth
cloudTrainer.defaultGpuType: Default GPU shown in prompt
cloudTrainer.defaultBudgetUsd: Default budget shown in prompt
cloudTrainer.pollIntervalSeconds: Job polling interval
cloudTrainer.excludePatterns: Extra packaging excludes
Default sensitive-file exclusions include:
.env*, .aws, .ssh, private key files (*.pem, *.key, *.p12, *.pfx)
- credential-like file names (
*secret*, *token*, *credentials*.json, *service-account*.json)
- local databases (
*.db, *.sqlite, *.sqlite3)
Auth notes:
- Login stores a token in VS Code Secret Storage.
- You can also set
cloudTrainer.apiKey manually for non-interactive auth.
Expected API Contract
Submit job
POST /v1/jobs
Request body:
{
"metadata": {
"trainingFile": "train.py",
"gpuType": "NVIDIA T4",
"budgetUsd": 20
},
"archiveBase64": "<base64-zip>"
}
Response body:
{
"jobId": "job_123"
}
Login
POST /v1/auth/login
Request body:
{
"email": "student@example.com",
"password": "secret"
}
Response body:
{
"apiKey": "token_abc123",
"userName": "student"
}
Cost estimate
POST /v1/jobs/estimate
Request body:
{
"trainingFile": "train.py",
"gpuType": "NVIDIA T4",
"budgetUsd": 20
}
Response body:
{
"estimatedCostUsd": 12.75,
"estimatedDurationHours": 3.5
}
Account
GET /v1/account
Response body:
{
"balanceUsd": 45.2,
"currency": "USD"
}
Job state
GET /v1/jobs/:jobId
Response body:
{
"status": "running",
"logs": ["epoch 1 ...", "epoch 2 ..."],
"artifactUrl": "https://api.example.com/v1/jobs/job_123/artifact"
}
status can be: queued, running, completed, failed.
Delete job data
DELETE /v1/jobs/:jobId
Deletes the job's remote uploaded source bundle, logs, outputs, and artifact for the authenticated user.
Development
npm install
npm run compile
Press F5 in VS Code to launch an Extension Development Host and test commands.