Skip to main content
This quickstart takes you from installing the Runpod SDK to running a function on a cloud GPU. You’ll write a small app, run it in a live development session, and deploy it as a Serverless endpoint.

Requirements

Step 1: Install the SDK

Create a project directory and a virtual environment, then install the runpod package:
Installing the package also installs the rp CLI.

Step 2: Log in

Authenticate with your Runpod account:
This opens your browser so you can approve access. Your credentials are saved to ~/.runpod/config.toml, and both the SDK and the CLI use them from then on.
To skip the browser, run rp login --api-key API_KEY with a key from the API keys page, or set the RUNPOD_API_KEY environment variable.

Step 3: Write your app

Create a file called main.py with the following code:
This code does three things:
  • runpod.App("quickstart") creates an app to hold your resources.
  • @app.queue(...) turns matrix_multiply into an autoscaling queue endpoint on H100 GPUs that scales between 0 and 3 workers and installs torch on each worker.
  • @runpod.local_entrypoint marks main as the code that runs on your machine. Calling matrix_multiply.remote(2000) sends the work to Runpod and waits for the result.
Import installed packages such as torch inside the remote function body, not at the top of the file. Top-level imports run on your machine, where the package may not be installed.

Step 4: Run a live development session

Start a development session:
The CLI creates a temporary endpoint, runs main, and streams worker logs back to your terminal. The first run takes longer while Runpod provisions a worker and installs dependencies:
Edit 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:
This creates production endpoints that stay up after you close your terminal. List your deployed apps with:

Clean up

To delete the endpoints you deployed, run:

Next steps

Last modified on October 2, 2026