A lightweight Go service that estimates the carbon footprint of LLM inference on the National Research Platform (NRP) Nautilus Kubernetes cluster.
Live dashboard: https://carbon-api.nrp-nautilus.io
This project is based upon the original NRP LLM Dashboard from [@ZihaoZhou], source repository: https://github.com/ZihaoZhou/nautilus-llm-status.
- GPU power is read from NVIDIA DCGM Exporter metrics already collected by the cluster's Prometheus instance.
- Token throughput is read from vLLM's built-in Prometheus metrics.
- Grid carbon intensity is looked up per node using
EPA eGRID 2022 subregion averages
(see
internal/carbon/intensity.go).
Carbon = Energy x Grid Intensity. See the Methodology page for full details.
export PROMETHEUS_URL=https://prometheus.nrp-nautilus.io
go run ./cmd
# → http://localhost:8080Build and push the container image, then apply the Kubernetes manifests:
docker build -t ghcr.io/boettiger-lab/carbon-api:latest .
docker push ghcr.io/boettiger-lab/carbon-api:latest
kubectl apply -f k8s/deployment.yaml
kubectl -n biodiversity rollout restart deployment/carbon-api| Endpoint | Description |
|---|---|
GET /api/v1/carbon |
Current metrics for all models |
GET /api/v1/carbon/timeseries?range=24h|7d|30d |
Cluster-wide CO2 and power time series |
GET /api/v1/carbon/{ns}/{container}/{metric}?range=... |
Per-model time series (power_watts, co2_grams_per_hour, co2_mg_per_token) |
GET /healthz |
Health check |