#!/usr/bin/env python3
# Source: t6-practitioner-toolkit.html
def cost_per_1k_predictions(gpu_hour_usd, qps_per_gpu, utilization=0.6):
    """Rough serving cost. utilization covers headroom for peaks."""
    preds_per_hour = qps_per_gpu * 3600 * utilization
    return 1000 * gpu_hour_usd / preds_per_hour

# A big model: 200 QPS per GPU at $2.50/hr
print(round(cost_per_1k_predictions(2.50, 200), 4))   # 0.0058 dollars
# Distilled model: 1500 QPS per GPU
print(round(cost_per_1k_predictions(2.50, 1500), 4))  # 0.0008 dollars
