fix(tokenlab): refresh the model cost entries from the live catalog

The TokenLab entries were taken from an earlier catalog. 35 of them named
models TokenLab no longer serves, 62 carried old prices, and 13 claimed
tool, vision, caching or reasoning support the catalog does not list.
Prices, cache prices, token limits and those four capability flags now
follow https://api.tokenlab.sh/v1/models; entries for removed models are
gone. The cost tests read the expected price from the cost map instead of
repeating a number that changes with the catalog.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
hedging8563 2026-10-03 06:17:10 +08:00
parent 46b7b1a617
commit d01252cfbc
3 changed files with 459 additions and 1887 deletions

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -163,8 +163,11 @@ class TestTokenLabCostMap:
prompt_tokens=1_000_000,
completion_tokens=1_000_000,
)
assert prompt_cost == pytest.approx(1.5)
assert completion_cost == pytest.approx(9.0)
assert prompt_cost == pytest.approx(litellm.model_cost["tokenlab/gpt-5.5"]["input_cost_per_token"] * 1_000_000)
assert completion_cost == pytest.approx(
litellm.model_cost["tokenlab/gpt-5.5"]["output_cost_per_token"] * 1_000_000
)
assert prompt_cost > 0 and completion_cost > 0
def test_embedding_cost_is_wired(self):
prompt_cost, completion_cost = litellm.cost_per_token(
@ -172,5 +175,8 @@ class TestTokenLabCostMap:
prompt_tokens=1_000_000,
completion_tokens=0,
)
assert prompt_cost == pytest.approx(0.02)
assert prompt_cost == pytest.approx(
litellm.model_cost["tokenlab/text-embedding-3-small"]["input_cost_per_token"] * 1_000_000
)
assert prompt_cost > 0
assert completion_cost == 0