runpod-serverless
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseRunPod Serverless Creator
RunPod 无服务器端点创建工具
This skill helps you create and configure serverless endpoints on RunPod.io. It handles both the Template creation (software config) and the Endpoint creation (hardware config).
该技能可帮助你在RunPod.io上创建和配置无服务器端点,同时支持模板创建(软件配置)和端点创建(硬件配置)。
How to Use
使用方法
The primary tool is the script. It is idempotent: if a template or endpoint with the same name exists, it will reuse the template and update the endpoint.
scripts/create_serverless.py核心工具是脚本,它具备幂等性:如果已存在同名的模板或端点,将复用该模板并更新端点。
scripts/create_serverless.pyPrerequisites
前置条件
- API Key: You need a RunPod API Key.
- Ask the user to provide it or check if is in the environment.
RUNPOD_API_KEY - Security: Do not hardcode the key in the script. Pass it via environment variable .
RUNPOD_API_KEY
- Ask the user to provide it or check if
- API密钥:你需要一个RunPod API密钥。
- 可要求用户提供该密钥,或检查环境变量中是否已设置。
RUNPOD_API_KEY - 安全提示:请勿在脚本中硬编码密钥,通过环境变量传递。
RUNPOD_API_KEY
- 可要求用户提供该密钥,或检查环境变量中是否已设置
Command
命令
bash
python runpod-serverless/scripts/create_serverless.py \
--name <NAME> \
--runtime <python|node> \
--gpu <GPU_TYPE> \
[--disk <GB>] \
[--min-workers <INT>] \
[--max-workers <INT>]bash
python runpod-serverless/scripts/create_serverless.py \
--name <NAME> \
--runtime <python|node> \
--gpu <GPU_TYPE> \
[--disk <GB>] \
[--min-workers <INT>] \
[--max-workers <INT>]Arguments
参数
- (Required): Unique name for the template and endpoint.
--name - (Required):
--runtimeorpython. Maps to standard RunPod serverless base images.node - (Required): GPU type alias (e.g.,
--gpu,3090,4090,a100) or specific ID (e.g.,a6000).AMPERE_24 - : Container disk size in GB (default: 10).
--disk - : Minimum active workers (default: 0 for cold-start serverless).
--min-workers - : Maximum active workers (default: 1).
--max-workers
- (必填):模板和端点的唯一名称。
--name - (必填):
--runtime或python,对应RunPod标准无服务器基础镜像。node - (必填):GPU类型别名(如
--gpu、3090、4090、a100)或特定ID(如a6000)。AMPERE_24 - :容器磁盘大小,单位为GB(默认值:10)。
--disk - :最小活跃工作节点数(无服务器冷启动场景默认值:0)。
--min-workers - :最大活跃工作节点数(默认值:1)。
--max-workers
GPU Options (Aliases)
GPU选项(别名)
- ->
3090(24GB VRAM)AMPERE_24 - ->
4090(24GB VRAM)ADA_24 - ->
a4000(16GB VRAM)AMPERE_16 - ->
a6000(48GB VRAM)AMPERE_48 - ->
a100(80GB VRAM)AMPERE_80
See for full API details and ID mappings.
references/runpod_api.md- ->
3090(24GB显存)AMPERE_24 - ->
4090(24GB显存)ADA_24 - ->
a4000(16GB显存)AMPERE_16 - ->
a6000(48GB显存)AMPERE_48 - ->
a100(80GB显存)AMPERE_80
如需完整的API详情和ID映射关系,请查看。
references/runpod_api.mdExample Workflow
示例流程
-
Ask User for:
- Application Name
- Runtime (Python/Node)
- Preferred GPU
- API Key (if not known)
-
Run Script:bash
$env:RUNPOD_API_KEY="<USER_KEY>"; python runpod-serverless/scripts/create_serverless.py --name my-ai-api --runtime python --gpu 3090 -
Verify: The script outputs the Template ID and Endpoint ID upon success.
-
向用户收集以下信息:
- 应用名称
- 运行时环境(Python/Node)
- 偏好的GPU类型
- API密钥(若未获取)
-
运行脚本:bash
$env:RUNPOD_API_KEY="<USER_KEY>"; python runpod-serverless/scripts/create_serverless.py --name my-ai-api --runtime python --gpu 3090 -
验证:脚本执行成功后会输出模板ID和端点ID。