feat: GPU Hour Calculator (M116)#256
Merged
Merged
Conversation
- GPUHourCalculator class in gpu_hours.py - TrafficProfile, HourlyTraffic, GPUHourReport, ScalingSavings, HourBreakdown models - 24-hour traffic profile with hourly QPS mapping to required instances - Auto-scaling savings estimation (fixed vs dynamic provisioning) - CLI gpu-hours subcommand with --benchmark, --traffic-profile, --gpu-cost - Programmatic calculate_gpu_hours() API - 24 new tests Closes #255
hlin99-Review-Bot
approved these changes
Apr 6, 2026
hlin99-Review-Bot
left a comment
Contributor
There was a problem hiding this comment.
✅ Approved (hlin99-Review-Bot)
CI all green (lint + tests 3.10/3.11/3.12). Code review:
- Idea: GPU Hour Calculator fits naturally as M116 — practical cost estimation from traffic profiles with auto-scaling savings analysis. Good addition.
- Code quality: Clean Pydantic models with proper validation (hour range, unique hours, sorted output). Calculator logic is straightforward and correct. CLI well-structured with Rich table + JSON output.
- Tests: 24 tests covering models, calculator, CLI, edge cases, and public imports. Good coverage.
- Docs: ROADMAP.md and iterations/current.md updated correctly.
Ship it.
hlin99-Review-BotX
approved these changes
Apr 6, 2026
hlin99-Review-BotX
left a comment
There was a problem hiding this comment.
✅ Approved (hlin99-Review-BotX)
CI all green (lint + tests 3.10/3.11/3.12). Code review:
- Idea: GPU Hour Calculator is a natural M116 addition — maps traffic profiles to GPU cost estimates with auto-scaling savings analysis. Practical and well-scoped.
- Code quality: Clean Pydantic models with proper validation (hour range 0-23, unique hours, sorted output). Calculator logic is straightforward — QPS-to-instance mapping with ceil, fixed vs dynamic comparison. CLI follows established patterns (Rich table + JSON).
- Tests: 24 tests covering models, calculator, CLI, edge cases, and public imports. Good coverage.
- Docs: ROADMAP.md (M115 ✅, M116 🔄) and iterations/current.md updated correctly.
Ship it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add GPU Hour Calculator (M116) — given benchmark data and a daily traffic profile (hourly QPS schedule), estimate total GPU hours, costs, and auto-scaling savings.
Changes
GPUHourCalculatorclass ingpu_hours.pywith QPS-to-instance mappingTrafficProfile,HourlyTraffic,GPUHourReport,ScalingSavings,HourBreakdownPydantic modelsgpu-hourssubcommand with--benchmark,--traffic-profile,--gpu-cost, Rich table + JSON outputcalculate_gpu_hours()APICloses #255