From ebefe1bb5060afd3267eea0c18983cb33f1ea34c Mon Sep 17 00:00:00 2001 From: PStarH Date: Sun, 22 Nov 2026 14:34:52 +0800 Subject: [PATCH] pricing: add model weights for DeepSeek and Qwen models DeepSeek (deepseek-chat V3, deepseek-reasoner R1) and Alibaba Qwen (qwen-2.5-coder-32b, qwen-plus, qwen-max) are widely used in agent coding sessions (via OpenCode, Cursor, and custom proxies). Without model weight entries, sessions on these models fall back to the default curve (cache hit 0.10x, output 6x), which misprices DeepSeek output cost (output is 2.0x for V3 and ~3.98x for R1) and cache hit ratios. Add published Standard-tier price ratios for: - deepseek-chat (zsh.14 in / zsh.014 cached / zsh.28 out => cr 0.10, out 2.0) - deepseek-reasoner (zsh.55 in / zsh.14 cached / .19 out => cr 0.2545, out 3.982) - qwen-2.5-coder-32b (zsh.07 in / zsh.014 cached / zsh.28 out => cr 0.20, out 4.0) - qwen-plus (zsh.40 in / zsh.08 cached / .20 out => cr 0.20, out 3.0) - qwen-max (.60 in / zsh.40 cached / .40 out => cr 0.25, out 4.0) --- tests/test_pricing_new_models.py | 5 +++++ tokeneconomizer/pricing.py | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/tests/test_pricing_new_models.py b/tests/test_pricing_new_models.py index 4b14489c..56100cb9 100644 --- a/tests/test_pricing_new_models.py +++ b/tests/test_pricing_new_models.py @@ -24,6 +24,11 @@ ("gemini-4-argon", 2.00, 0.10, None, 10.00), ("gemini-4-carbon", 2.00, 0.10, None, 10.00), ("gemini-4-hydrogen", 1.50, 0.075, None, 7.50), + ("deepseek-chat", 0.14, 0.014, None, 0.28), + ("deepseek-reasoner", 0.55, 0.14, None, 2.19), + ("qwen-2.5-coder-32b", 0.07, 0.014, None, 0.28), + ("qwen-plus", 0.40, 0.08, None, 1.20), + ("qwen-max", 1.60, 0.40, None, 6.40), ] IDS = [p[0] for p in PRICES] diff --git a/tokeneconomizer/pricing.py b/tokeneconomizer/pricing.py index 9e14a3df..37f3357d 100644 --- a/tokeneconomizer/pricing.py +++ b/tokeneconomizer/pricing.py @@ -121,6 +121,15 @@ "gemini-4-argon": dict(input=1.0, cache_read=0.05, cache_write=0.0, output=5.0), "gemini-4-carbon": dict(input=1.0, cache_read=0.05, cache_write=0.0, output=5.0), "gemini-4-hydrogen": dict(input=1.0, cache_read=0.05, cache_write=0.0, output=5.0), + # DeepSeek, https://api-docs.deepseek.com/quick_start/pricing. No cache-write charge. + # deepseek-chat (V3): $0.14 in / $0.014 cached (0.10x) / $0.28 out (2.0x). + # deepseek-reasoner (R1): $0.55 in / $0.14 cached (0.2545x) / $2.19 out (3.982x). + "deepseek-chat": dict(input=1.0, cache_read=0.10, cache_write=0.0, output=2.0), + "deepseek-reasoner": dict(input=1.0, cache_read=0.2545, cache_write=0.0, output=3.982), + # Alibaba Qwen, https://www.alibabacloud.com/help/en/model-studio/developer-reference/pricing. + "qwen-2.5-coder-32b": dict(input=1.0, cache_read=0.20, cache_write=0.0, output=4.0), + "qwen-plus": dict(input=1.0, cache_read=0.20, cache_write=0.0, output=3.0), + "qwen-max": dict(input=1.0, cache_read=0.25, cache_write=0.0, output=4.0), } # Billed model id for an agent when a row does NOT pin one (rec['model'] is None).