A Python library for distributed inference and serving of machine learning models
Project description
Flash
Flash is a Python SDK for developing cloud-native AI apps where you define everything—hardware, remote functions, and dependencies—using local code.
import asyncio
from runpod_flash import Endpoint, GpuType
# Mark the function below for remote execution
@Endpoint(name="hello-gpu", gpu=GpuType.NVIDIA_GEFORCE_RTX_4090, dependencies=["torch"])
async def hello(): # This function runs on Runpod
import torch
gpu_name = torch.cuda.get_device_name(0)
print(f"Hello from your GPU! ({gpu_name})")
return {"gpu": gpu_name}
asyncio.run(hello())
print("Done!") # This runs locally
Write @Endpoint decorated Python functions on your local machine. Run them, and Flash automatically handles GPU/CPU provisioning and worker scaling on Runpod Serverless.
Setup
Install Flash
Install Flash using pip or uv:
# Install with pip
pip install runpod-flash
# Or uv
uv add runpod-flash
Flash requires Python 3.10+, and is currently available for macOS and Linux. Windows support is in development.
Authentication
Before you can use Flash, you need to authenticate with your Runpod account:
flash login
This saves your API key securely and allows you to use the Flash CLI and run @Endpoint functions.
Coding agent integration (optional)
Install the Flash skill package for AI coding agents like Claude Code, Cline, and Cursor:
npx skills add runpod/skills
You can review the SKILL.md file in the runpod/skills repository.
Quickstart
Create gpu_demo.py:
import asyncio
from runpod_flash import Endpoint, GpuType
@Endpoint(
name="flash-quickstart",
gpu=GpuType.NVIDIA_GEFORCE_RTX_4090,
workers=3,
dependencies=["numpy", "torch"]
)
def gpu_matrix_multiply(size):
# IMPORTANT: Import packages INSIDE the function
import numpy as np
import torch
# Get GPU name
device_name = torch.cuda.get_device_name(0)
# Create random matrices
A = np.random.rand(size, size)
B = np.random.rand(size, size)
# Multiply matrices
C = np.dot(A, B)
return {
"matrix_size": size,
"result_mean": float(np.mean(C)),
"gpu": device_name
}
# Call the function
async def main():
print("Running matrix multiplication on Runpod GPU...")
result = await gpu_matrix_multiply(1000)
print(f"\n✓ Matrix size: {result['matrix_size']}x{result['matrix_size']}")
print(f"✓ Result mean: {result['result_mean']:.4f}")
print(f"✓ GPU used: {result['gpu']}")
if __name__ == "__main__":
asyncio.run(main())
Run it:
python gpu_demo.py
First run takes 30-60 seconds (provisioning). Subsequent runs take 2-3 seconds.
What Flash does
- Remote execution:
@Endpointfunctions run on Runpod Serverless GPUs/CPUs - Auto-scaling: Workers scale from 0 to N based on demand
- Dependency management: Packages install automatically on remote workers
- Two patterns: Queue-based (
@Endpoint) for batch work, load-balanced (Endpoint()+ routes) for REST APIs
Documentation
Full documentation: docs.runpod.io/flash
- Quickstart - First GPU workload in 5 minutes
- Create endpoints - Queue-based, load-balancing, and custom Docker endpoints
- CLI reference -
flash run,flash deploy,flash build - Configuration - All endpoint parameters
Flash apps
When you're ready to move beyond scripts and build a production-ready API, you can create a Flash app (a collection of interconnected endpoints with diverse hardware configurations) and deploy it to Runpod.
Follow this tutorial to build your first Flash app.
Flash CLI
The Flash CLI provides a set of commands for managing your Flash apps and endpoints.
flash --help
Learn more about the Flash CLI.
Examples
Browse working examples: github.com/runpod/flash-examples
Requirements
- Python 3.12
- macOS or Linux (Windows support in development)
- A Runpod account (email must be verified) with an API key
Contributing
We welcome contributions! See RELEASE_SYSTEM.md for development workflow.
# Clone and install
git clone https://github.com/runpod/flash.git
cd flash
pip install -e ".[dev]"
# Use conventional commits
git commit -m "feat: add new feature"
git commit -m "fix: resolve issue"
Support
- Discord - Community support
- GitHub Issues - Bug reports
License
MIT License - see LICENSE for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file runpod_flash-1.12.0.tar.gz.
File metadata
- Download URL: runpod_flash-1.12.0.tar.gz
- Upload date:
- Size: 197.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a3216d23b72b6117c0a2568913fc5393f6aa1e9168b726263b274b59e5764620
|
|
| MD5 |
ee23ed9220a061d8cc38305863fbe93d
|
|
| BLAKE2b-256 |
d7ebb8f94e265d56bc1e99161b0e33c6fe80dee703192ff24276eaa252531536
|
Provenance
The following attestation bundles were made for runpod_flash-1.12.0.tar.gz:
Publisher:
release-please.yml on runpod/flash
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
runpod_flash-1.12.0.tar.gz -
Subject digest:
a3216d23b72b6117c0a2568913fc5393f6aa1e9168b726263b274b59e5764620 - Sigstore transparency entry: 1266278034
- Sigstore integration time:
-
Permalink:
runpod/flash@930eee64f57e8fabd66d8591323d918e3e5f6bc4 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/runpod
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-please.yml@930eee64f57e8fabd66d8591323d918e3e5f6bc4 -
Trigger Event:
push
-
Statement type:
File details
Details for the file runpod_flash-1.12.0-py3-none-any.whl.
File metadata
- Download URL: runpod_flash-1.12.0-py3-none-any.whl
- Upload date:
- Size: 235.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3156c773d1ce77c5f38906f1439746c700882e48a637019dc7ca649f8ab0cd87
|
|
| MD5 |
0327eb0b106023bc264ca6b03d02a10d
|
|
| BLAKE2b-256 |
1dd2dffbc5585f44cc5a64041173c4999882b94b795fd00be15df182f5afb9e8
|
Provenance
The following attestation bundles were made for runpod_flash-1.12.0-py3-none-any.whl:
Publisher:
release-please.yml on runpod/flash
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
runpod_flash-1.12.0-py3-none-any.whl -
Subject digest:
3156c773d1ce77c5f38906f1439746c700882e48a637019dc7ca649f8ab0cd87 - Sigstore transparency entry: 1266278215
- Sigstore integration time:
-
Permalink:
runpod/flash@930eee64f57e8fabd66d8591323d918e3e5f6bc4 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/runpod
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-please.yml@930eee64f57e8fabd66d8591323d918e3e5f6bc4 -
Trigger Event:
push
-
Statement type: