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.
This quickstart requires runpod 2.0 or later. If you already have an older version installed, upgrade with pip install --upgrade runpod (or uv add 'runpod>=2').

Step 2: Log in

Authenticate with your Runpod account:
This opens your browser so you can approve access. After you approve, copy the API key the console shows and paste it at the prompt in your terminal. 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 that runs on any available GPU, scales between 0 and 3 workers, and installs torch on each worker. To request specific hardware, use a short name such as gpu="4090" or gpu="H100".
  • @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 November 9, 2026