Add pricing for GPT-5.4 nano and GPT-4.5#144
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThis PR adds pricing configurations for two new language models ( Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/models.rs (1)
1021-1021: Consider adding dated aliases for consistency.Every other OpenAI model in
MODEL_ALIASEShas at least one date-suffixed alias (e.g.gpt-5.4-mini-2026-03-17→gpt-5.4-mini,gpt-4.1-2025-04-14→gpt-4.1). The newgpt-4.5andgpt-5.4-nanoentries only register the bare canonical name, so any dated variant reported by the API (e.g.gpt-4.5-preview-2025-02-27) will miss the lookup and fall through to the$0warning path. Add the corresponding dated aliases if you expect those IDs to appear in usage data.Also applies to: 1137-1137
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/models.rs` at line 1021, The MODEL_ALIASES map is missing date-suffixed aliases for the new entries (so dated IDs like "gpt-4.5-preview-2025-02-27" won't match); update the MODEL_ALIASES definition to include the corresponding dated aliases for "gpt-4.5" and "gpt-5.4-nano" using the same pattern used elsewhere (add the expected date-prefixed/preview variants mapping to the canonical names), e.g. add entries that map common dated forms such as "gpt-4.5-<date or preview-suffix>" -> "gpt-4.5" and similar for "gpt-5.4-nano" so lookups in MODEL_ALIASES succeed.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/models.rs`:
- Around line 235-242: The ModelInfo entry for the "gpt-4.5" variant currently
uses CachingSupport::None which causes calculate_cache_cost to return $0 for
cached input; update the "gpt-4.5" ModelInfo to use CachingSupport::OpenAI {
cached_input_per_1m: 37.5 } so cached prompt tokens are billed correctly (or, if
caching is intentionally ignored, add a clear comment on the ModelInfo for
"gpt-4.5" explaining why CachingSupport::None is used). Ensure you edit the
ModelInfo mapping where "gpt-4.5" is defined and adjust tests/fixtures that
expect cache charges if present.
---
Nitpick comments:
In `@src/models.rs`:
- Line 1021: The MODEL_ALIASES map is missing date-suffixed aliases for the new
entries (so dated IDs like "gpt-4.5-preview-2025-02-27" won't match); update the
MODEL_ALIASES definition to include the corresponding dated aliases for
"gpt-4.5" and "gpt-5.4-nano" using the same pattern used elsewhere (add the
expected date-prefixed/preview variants mapping to the canonical names), e.g.
add entries that map common dated forms such as "gpt-4.5-<date or
preview-suffix>" -> "gpt-4.5" and similar for "gpt-5.4-nano" so lookups in
MODEL_ALIASES succeed.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
Add GPT-5.4 nano and GPT-4.5 pricing entries plus regression tests covering the requested GPT-5.1 pricing.
28f55c9 to
6e01842
Compare
Summary
gpt-5.4-nanowith cached input supportgpt-4.5, including cached input pricinggpt-5.1,gpt-5.4-nano, andgpt-4.5pricingVerification
cargo fmt --all --quietcargo build --quietcargo test --quietcargo clippy --quiet -- -D warningscargo doc --quietSummary by CodeRabbit
Release Notes
New Features
gpt-4.5andgpt-5.4-nano. Both include input/output pricing and support for cached token pricing.Tests