mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-08 03:08:45 +00:00
test(xai): update grok-4.20 cost expectations to corrected $1.25/$2.50
The xai cost-calculator tests hard-coded the previous $2/$6 grok-4.20 rates. Update the three affected expectations (beta-reasoning, beta-non-reasoning, multi-agent) to $1.25e-6 input / $2.5e-6 output to match the price-map correction in this PR. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
eedf4ef4e0
commit
5795a1cada
1 changed files with 12 additions and 12 deletions
|
|
@ -432,10 +432,10 @@ class TestXAICostCalculator:
|
|||
model="grok-4.20-beta-0309-reasoning", usage=usage
|
||||
)
|
||||
|
||||
# Input: 100 tokens * $2e-6 = $0.0002
|
||||
# Output: 200 tokens * $6e-6 = $0.0012
|
||||
expected_prompt_cost = 100 * 2e-6
|
||||
expected_completion_cost = 200 * 6e-6
|
||||
# Input: 100 tokens * $1.25e-6 = $0.000125
|
||||
# Output: 200 tokens * $2.5e-6 = $0.0005
|
||||
expected_prompt_cost = 100 * 1.25e-6
|
||||
expected_completion_cost = 200 * 2.5e-6
|
||||
|
||||
assert math.isclose(prompt_cost, expected_prompt_cost, rel_tol=1e-10)
|
||||
assert math.isclose(completion_cost, expected_completion_cost, rel_tol=1e-10)
|
||||
|
|
@ -448,10 +448,10 @@ class TestXAICostCalculator:
|
|||
model="grok-4.20-beta-0309-non-reasoning", usage=usage
|
||||
)
|
||||
|
||||
# Input: 50 tokens * $2e-6 = $0.0001
|
||||
# Output: 100 tokens * $6e-6 = $0.0006
|
||||
expected_prompt_cost = 50 * 2e-6
|
||||
expected_completion_cost = 100 * 6e-6
|
||||
# Input: 50 tokens * $1.25e-6 = $0.0000625
|
||||
# Output: 100 tokens * $2.5e-6 = $0.00025
|
||||
expected_prompt_cost = 50 * 1.25e-6
|
||||
expected_completion_cost = 100 * 2.5e-6
|
||||
|
||||
assert math.isclose(prompt_cost, expected_prompt_cost, rel_tol=1e-10)
|
||||
assert math.isclose(completion_cost, expected_completion_cost, rel_tol=1e-10)
|
||||
|
|
@ -464,10 +464,10 @@ class TestXAICostCalculator:
|
|||
model="grok-4.20-multi-agent-beta-0309", usage=usage
|
||||
)
|
||||
|
||||
# Input: 200 tokens * $2e-6 = $0.0004
|
||||
# Output: 300 tokens * $6e-6 = $0.0018
|
||||
expected_prompt_cost = 200 * 2e-6
|
||||
expected_completion_cost = 300 * 6e-6
|
||||
# Input: 200 tokens * $1.25e-6 = $0.00025
|
||||
# Output: 300 tokens * $2.5e-6 = $0.00075
|
||||
expected_prompt_cost = 200 * 1.25e-6
|
||||
expected_completion_cost = 300 * 2.5e-6
|
||||
|
||||
assert math.isclose(prompt_cost, expected_prompt_cost, rel_tol=1e-10)
|
||||
assert math.isclose(completion_cost, expected_completion_cost, rel_tol=1e-10)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue