CHAPTER 09 OF 12
Deploy in your own cloud account
Plan total cost, use a private connection, verify the service and remove every resource.
In this chapter
Rent compute for a defined reason
Cloud hardware can help when your local machine cannot run the required artifact or when a workload needs resources only occasionally. It also adds billing, account access, networking, storage lifecycle and recovery work. Choose it because those tradeoffs fit the task, not because a provider offers a referral commission.
Compare a specific workload: required GPU memory, supported runtime, expected request duration, concurrency, region, data requirements and acceptable startup delay. Availability changes. A listed GPU and a published hourly price do not prove that an instance is available in your region or that the total job will cost only that headline rate.
This chapter's deployment procedure is for a new Linux GPU virtual machine that you control. Container-based GPU products may have a different environment; do not assume that a container is a full VM or that nested Docker is available. Check the provider's own connection and storage documentation.
Calculate the whole session
Include active and idle compute time, attached storage during and after compute use, model downloads or egress where billed, snapshots, public IP charges where applicable, minimum billing increments, and taxes. Record currency and the date you checked each input. A cost estimate is not an invoice or a spending guarantee.
Run the illustrative worksheet:
python3 rtm_lab.py budget --output budget-example.jsonIts fictional rates produce USD 1.88: USD 1.50 for three compute hours, USD 0.20 for three days of storage using a 30-day convention, and USD 0.18 for egress. These are teaching inputs, not any provider's prices. Substitute current provider values and its actual billing rules before spending money.
Prerequisites
The cost worksheet needs only Python. The deployment needs an account and approved spending limit, an available Linux GPU VM, SSH access, enough storage, and a working GPU driver. No cloud VM was provisioned for this edition. Setup, remote inference, shutdown and billing verification below remain unexecuted.
Steps: a private deployment drill
Before creating anything, write a budget, region, intended session length and cleanup owner. Save the provider's current compute and storage rates. Create only a disposable instance for this exercise and retain its resource ID.
Follow the provider's SSH instructions. Restrict network access to what you need; do not expose the model API publicly. On the VM, record
uname -aandnvidia-smioutput. Resolve GPU-driver errors before testing inference.Download Ollama's official Linux installer for review, then install the reference version if it is available for the VM:
curl -fsSL https://ollama.com/install.sh -o install-ollama.sh
less install-ollama.sh
OLLAMA_VERSION=0.16.3 sh install-ollama.sh
ollama --versionOn this new dedicated VM, stop the installer's default service so the lab instance is unambiguous. Start the loopback-only lab server in an SSH terminal:
sudo systemctl stop ollama
OLLAMA_NO_CLOUD=1 \
OLLAMA_HOST=127.0.0.1:11435 ollama serveIn another SSH session, download and inspect the package:
OLLAMA_HOST=127.0.0.1:11435 ollama pull qwen2.5:0.5b
OLLAMA_HOST=127.0.0.1:11435 ollama show qwen2.5:0.5bOn your own computer, replace the uppercase placeholders with the provider's actual SSH user and address, then create a local tunnel:
ssh -N -L 127.0.0.1:11437:127.0.0.1:11435 \
VM_USER@VM_ADDRESSKeep the tunnel open. Run the client through it:
python3 rtm_lab.py extract \
--base-url http://127.0.0.1:11437 \
--output cloud-response.jsonLabel inference as happening on the cloud VM. The client computer's hardware report does not identify the remote GPU. Attach the VM's separately captured hardware, region, runtime, artifact and billing records to your report.
Verification, shutdown and deletion
A successful deployment needs a real answer passing the rubric, matching artifact identity, and evidence of where computation occurred. If it fails, stop accumulating charges while diagnosing the problem.
Save the evidence you need. In the remote server terminal press Control-C; close the tunnel with Control-C in its terminal. Stopping a process does not stop instance billing. Use the provider console to stop or terminate the exact instance, then verify the terminal state. Inspect attached disks, network volumes, snapshots and allocated addresses separately. Delete only the disposable resources you created and no longer need, after preserving needed data. Finally inspect the billing/resource dashboard for remaining chargeable items.
Common failures
A tunnel can conflict with a local port; choose an unused local port and update the client. A GPU VM may have incompatible drivers. Model downloads consume billed time. Stopped compute can leave storage charges. A terminated instance can destroy files that were not on persistent storage. Check the specific product's lifecycle rules before acting.
Exercise
Complete a deployment worksheet without creating resources. Include one alternative provider, a region, dated rates, a maximum session length, storage retention and exact deletion steps. Explain how you would verify both successful inference and the end of billing.
Sources
Use Lambda's on-demand documentation, Runpod's Pod lifecycle documentation and Ollama Linux setup for their respective products. This chapter contains no active affiliate claim and no managed one-click deployment.