Requirements
- A Runpod account with a verified email address.
- Python 3.10 or higher.
Step 1: Install the SDK
Create a project directory and a virtual environment, then install therunpod package:
rp CLI.
Step 2: Log in
Authenticate with your Runpod account:~/.runpod/config.toml, and both the SDK and the CLI use them from then on.
Step 3: Write your app
Create a file calledmain.py with the following code:
runpod.App("quickstart")creates an app to hold your resources.@app.queue(...)turnsmatrix_multiplyinto an autoscaling queue endpoint on H100 GPUs that scales between 0 and 3 workers and installstorchon each worker.@runpod.local_entrypointmarksmainas the code that runs on your machine. Callingmatrix_multiply.remote(2000)sends the work to Runpod and waits for the result.
Step 4: Run a live development session
Start a development session:main, and streams worker logs back to your terminal. The first run takes longer while Runpod provisions a worker and installs dependencies:
main.py, for example by changing 2000 to 4000, and run it again. Later runs reuse the warm worker, so they return much faster.
When you’re done, press Ctrl-C. The session waits for the running entrypoint to finish and then deletes the temporary endpoints.
Step 5: Deploy your app
When your app works the way you want, deploy it:Clean up
To delete the endpoints you deployed, run:Next steps
- Learn what’s in the SDK, including tasks, HTTP services, and storage.
- Review the CLI commands.
- Call an existing endpoint with
runpod.Endpoint.