feat(models): set aws-bedrock claude models to 30% discount - #1368
Conversation
Apply 40% discount to all AWS Bedrock Claude model variants. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
WalkthroughAdded a per-provider Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
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.
Pull request overview
This PR applies a 40% discount to all AWS Bedrock Claude model variants by adding a discount: 0.4 field to their provider configurations. The discount is consistently applied across all Claude model families (Sonnet, Opus, and Haiku) available on AWS Bedrock.
- Adds
discount: 0.4field to 9 AWS Bedrock Claude model provider configurations - Covers all Claude model variants: Sonnet (3.5, 3.7, 4, 4.5), Opus (4, 4.1, 4.5), and Haiku (3.5)
- Maintains consistency in placement and formatting across all modified provider objects
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The test was incorrectly calculating the discount price without accounting for provider priority, causing false test failures. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Update discount from 40% to 30% per request. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/models/src/models.spec.ts (1)
522-559: Fix the effective price calculation for the regular provider—apply discount uniformly across all providers.The test calculates effective prices differently from the implementation. The
selectByPriceOnlyfunction applies the discount multiplier to all providers:const totalPrice = (((inputPrice + outputPrice) / 2) * (1 - discount))However, the test only applies the discount to
discountProviderbut omits it forregularProvider. Update the test to apply the discount uniformly:const regularDiscount = (regularProvider as ProviderModelMapping).discount ?? 0; const regularDiscountMultiplier = 1 - regularDiscount; const regularBasePrice = ((regularProvider.inputPrice! + regularProvider.outputPrice!) / 2) * regularDiscountMultiplier;Additionally, when effective prices are equal, the implementation selects the first provider in the loop. The test should either handle this tie-breaking behavior explicitly or ensure test data always produces distinct effective prices.
📜 Review details
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
packages/models/src/models.spec.tspackages/models/src/models/anthropic.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- packages/models/src/models/anthropic.ts
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.{ts,tsx}: Never useanyoras anyunless absolutely necessary in TypeScript code
For database reads: Usedb().query.<table>.findMany()ordb().query.<table>.findFirst()
Files:
packages/models/src/models.spec.ts
**/*.{ts,tsx,js,jsx,json,md}
📄 CodeRabbit inference engine (CLAUDE.md)
Always use tabs for indentation
Files:
packages/models/src/models.spec.ts
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.{ts,tsx,js,jsx}: Always use top-levelimport, never use require or dynamic imports
No unnecessary code comments
Files:
packages/models/src/models.spec.ts
**/*.spec.ts
📄 CodeRabbit inference engine (CLAUDE.md)
Unit tests should use
*.spec.tsfile naming convention
Files:
packages/models/src/models.spec.ts
**/*.{js,ts,tsx,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
Always use top-level
import, never use require or dynamic imports
Files:
packages/models/src/models.spec.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
- GitHub Check: e2e-shards (4)
- GitHub Check: e2e-shards (3)
- GitHub Check: e2e-shards (5)
- GitHub Check: e2e-shards (1)
- GitHub Check: e2e-shards (2)
- GitHub Check: generate / run
- GitHub Check: lint / run
- GitHub Check: build / run
- GitHub Check: test / run
- GitHub Check: autofix
🔇 Additional comments (1)
packages/models/src/models.spec.ts (1)
7-7: LGTM!The import of
getProviderDefinitionis necessary to access provider priority data for the updated effective price calculations in the test below.
Apply 30% discount to all AWS Bedrock Claude model variants including Sonnet, Opus, and Haiku models across all versions.
🤖 Generated with Claude Code
Summary by CodeRabbit
Chores
Tests
✏️ Tip: You can customize this high-level summary in your review settings.