This path keeps EDMG Studio's existing architecture intact:
- existing FastAPI backend
- existing Studio Home storage split
- optional Ollama
- optional ComfyUI
- optional Vite browser UI
- no permanent hardcoded public IP in packaged defaults
Use this when you want the desktop app or a browser-served frontend to attach to
an Ubuntu GPU VM running the current codex/Unified branch.
- Remote VM bootstrap script:
studio/edmg-studio/edmg_gcp_gpu_bootstrap.sh - Local Windows runner that uploads and executes the remote bootstrap through
gcloud compute sshandgcloud compute scp:studio/edmg-studio/run_gcp_edmg_bootstrap.ps1 - Local Studio connector script for pointing the desktop/dev frontend at the
remote backend:
studio/edmg-studio/set_studio_gcp_backend.ps1
The remote bootstrap covers the repo-specific work from the brief:
- install backend bundle on the VM
- install frontend dependencies
- validate
typecheck,test:ui, andbuild - create
~/bin/edmg-start-backend,~/bin/edmg-start-ui, and~/bin/edmg-check-cuda - create
/mnt/edmg-studio-home/{data,models,cache,logs,external} - validate CUDA visibility from PyTorch
- optionally install Ollama
- optionally queue curated model installs
- install a backend
systemdservice so the FastAPI backend survives reboot
The scripts intentionally do not auto-pick a GCP zone or bypass quota checks. GPU stock and quota are live-account concerns and should stay operator-visible.
Run these on the local machine first:
gcloud --version
git --version
ssh -VAuthenticate and choose the project:
gcloud auth login
gcloud auth application-default login
gcloud config set project YOUR_GCP_PROJECT_IDEnable required APIs:
gcloud services enable compute.googleapis.com
gcloud services enable storage.googleapis.comCheck quota before creating anything:
gcloud compute regions describe us-central1
gcloud compute project-info describeIf GPU quota is zero, stop. Do not silently fall back to a CPU-only VM.
Check live accelerator availability:
gcloud compute accelerator-types list --filter="name~'nvidia-l4|nvidia-tesla-a100|nvidia-h100|nvidia-rtx'"Recommended starting zones from the brief:
us-central1-aus-central1-bus-east4-aus-east4-bus-west1-aus-west4-a
Recommended starter shape:
- machine type:
g2-standard-24 - GPU:
1 x NVIDIA L4 - image:
ubuntu-2204-lts - disk:
500 GB pd-balanced
ssh-keygen -t ed25519 -f $HOME\.ssh\gcp_edmg_studio -C "gcp-edmg-studio"
gcloud compute os-login ssh-keys add --key-file $HOME\.ssh\gcp_edmg_studio.pubExample L4 / G2 VM:
gcloud compute instances create edmg-gpu-studio `
--zone=us-central1-a `
--machine-type=g2-standard-24 `
--maintenance-policy=TERMINATE `
--restart-on-failure `
--boot-disk-size=500GB `
--boot-disk-type=pd-balanced `
--image-family=ubuntu-2204-lts `
--image-project=ubuntu-os-cloud `
--metadata=enable-oslogin=TRUE `
--tags=edmg-studioIf the project only supports an N1 fallback:
gcloud compute instances create edmg-gpu-studio `
--zone=us-central1-a `
--machine-type=n1-standard-16 `
--accelerator=type=nvidia-tesla-t4,count=1 `
--maintenance-policy=TERMINATE `
--restart-on-failure `
--boot-disk-size=500GB `
--boot-disk-type=pd-balanced `
--image-family=ubuntu-2204-lts `
--image-project=ubuntu-os-cloud `
--metadata=enable-oslogin=TRUE `
--tags=edmg-studioDetermine the operator or VPN CIDR that should reach Studio, then restrict both ports to that network. Do not expose the development UI or raw backend port to the entire internet.
$StudioSourceCidr = "YOUR.PUBLIC.IP/32"
gcloud compute firewall-rules create edmg-backend-7863 `
--allow=tcp:7863 `
--target-tags=edmg-studio `
--source-ranges=$StudioSourceCidr
gcloud compute firewall-rules create edmg-ui-5173 `
--allow=tcp:5173 `
--target-tags=edmg-studio `
--source-ranges=$StudioSourceCidrThe bootstrap creates a mode-0600 backend bearer-token file under
/mnt/edmg-studio-home/config/backend-auth-token and never prints the token. Retrieve it through
your authenticated SSH session and save it in Studio Settings → Desktop Backend → Backend Access
Security. Keep Ollama private. Put the backend behind an HTTPS reverse proxy or authenticated
tunnel before using it across the public internet; direct-IP HTTP is for restricted private-network
validation only.
Before using the repo bootstrap, finish NVIDIA driver setup on the VM and make
sure nvidia-smi works. Driver install steps change over time, so keep that
step operator-driven against the current Google Compute Engine guidance.
Once the VM is reachable and nvidia-smi is healthy, run the repo helper from
the local machine:
cd studio\edmg-studio
.\run_gcp_edmg_bootstrap.ps1 `
-ProjectId YOUR_GCP_PROJECT_ID `
-Zone us-central1-a `
-InstanceName edmg-gpu-studioUseful switches:
-InstallOllamainstalls and starts Ollama on the VM, then pullsnemotron-3-ultra:cloud- Without
-InstallOllama, the bootstrap defaults tonemotron_cloud(NVIDIA NIM) -QueueDefaultModelsasks the remote bootstrap to queue curated model installs after the backend is healthy-SkipUiskips the Vite dev server if you only want the backend
What the remote bootstrap writes on the VM:
~/.edmg-env~/bin/edmg-start-backend~/bin/edmg-start-ui~/bin/edmg-check-cuda~/bin/edmg-queue-default-models
Runtime data stays under:
/mnt/edmg-studio-home/data/mnt/edmg-studio-home/models/mnt/edmg-studio-home/cache/mnt/edmg-studio-home/logs/mnt/edmg-studio-home/external
After the VM bootstrap prints the backend URL, update the local desktop/dev config:
cd studio\edmg-studio
.\set_studio_gcp_backend.ps1 -BackendUrl http://YOUR_VM_IP:7863For production, replace the direct-IP URL with the HTTPS URL from your reverse proxy or tunnel. After switching targets, paste the VM backend token into Studio's Backend Access Security panel and run Test authenticated connection.
On Linux or macOS, use the cross-platform helper instead:
cd studio/edmg-studio
bash scripts/set_studio_remote_backend.sh external http://YOUR_VM_IP:7863That script updates:
.env.env.locallauncher_env.jsonelectron-resources/runtime-defaults.json%APPDATA%\EDMG Studio\bootstrap.json
It stores the public GCP URL as the external connection target while keeping the
managed local bind host and port at 127.0.0.1:7863.
For the browser frontend, use:
http://YOUR_VM_IP:5173/?backendUrl=http://YOUR_VM_IP:7863
For the desktop app:
- Settings → Desktop Backend → Mode:
external - Desktop backend URL:
http://YOUR_VM_IP:7863
If you want Ollama on the VM:
.\run_gcp_edmg_bootstrap.ps1 `
-ProjectId YOUR_GCP_PROJECT_ID `
-Zone us-central1-a `
-InstanceName edmg-gpu-studio `
-InstallOllamaIf you skip Ollama, the bootstrap defaults the backend to the rule-based planner so the app still boots cleanly.
The bootstrap creates ~/bin/edmg-queue-default-models, but it does not queue
models unless you explicitly request it.
Manual model queue example on the VM:
source ~/.edmg-env
~/bin/edmg-queue-default-modelsIf you need gated Hugging Face repos, export a token first:
export HF_TOKEN=...
export HUGGING_FACE_HUB_TOKEN="$HF_TOKEN"Use GCS as backup or sync, not as the hot runtime model path:
gcloud storage buckets create gs://YOUR_EDMG_BUCKET --location=us-central1
gcloud storage rsync -r /mnt/edmg-studio-home/models gs://YOUR_EDMG_BUCKET/models
gcloud storage rsync -r /mnt/edmg-studio-home/data gs://YOUR_EDMG_BUCKET/dataOn the VM:
source ~/.edmg-env
~/bin/edmg-check-cuda
curl http://127.0.0.1:7863/health
curl http://127.0.0.1:5173From the local machine:
curl http://YOUR_VM_IP:7863/healthOpen:
http://YOUR_VM_IP:5173/?backendUrl=http://YOUR_VM_IP:7863
Definition of done:
- GPU VM exists and
nvidia-smiworks - PyTorch sees CUDA
codex/Unifiedis deployed on the VM- backend runs on
0.0.0.0:7863 /healthis green locally and externally- frontend can attach through
?backendUrl=... - Studio Home uses
/mnt/edmg-studio-home - local packaging defaults were not hardcoded to a permanent public IP