SuperAPI AI 工具集

cost-calculator

通用与其它

查看项目

更新于 10-16 05:47

技能介绍

用途:为 ML 训练与推理提供成本估算工具,覆盖 Modal、Lambda Labs、RunPod 三个云 GPU 平台,帮助估算训练成本、比较平台价格、计算 GPU 小时、做预算、优化推理成本并规划资源分配。

主要能力:包含四个脚本。scripts/estimate-training-cost.sh 依据模型规模、数据量、轮数、GPU 类型与平台估算训练成本;scripts/estimate-inference-cost.sh 估算生产推理成本;scripts/calculate-gpu-hours.sh 将训练参数换算为 GPU 小时;scripts/compare-platforms.sh 跨平台比较费用。另有模板 templates/cost-breakdown.json、templates/platform-pricing.yaml,以及训练与推理成本示例文档。估算采用每样本约 500 tokens、各 GPU 吞吐率、PEFT 显存下降、混合精度加速等方法。

使用方式:例如运行 bash scripts/estimate-training-cost.sh --model-size 7B --dataset-size 10000 --epochs 3 --gpu t4 --platform modal;推理示例为 bash scripts/estimate-inference-cost.sh --requests-per-day 1000 --avg-latency 2 --gpu t4 --platform modal --deployment serverless;GPU 小时示例为 bash scripts/calculate-gpu-hours.sh --model-params 7B --tokens-total 30M --gpu a100-40gb;平台对比为 bash scripts/compare-platforms.sh --training-hours 4 --gpu-type a100-40gb。

依赖与限制:需 Bash 4.0+、jq、bc、yq。资料给出的价格为示例,实际价格可能变动,应以平台实时计费为准;脚本仅依据输入的模型规模、数据量与吞吐基准估算,未提供真实账单校验或自动优化执行能力。