Skip to content

pricing: add model weights for DeepSeek and Qwen models - #308

Open
Xinghan Pan (PStarH) wants to merge 1 commit into
microsoft:mainfrom
PStarH:feat/pricing-deepseek-and-qwen-models
Open

Xinghan Pan (PStarH) wants to merge 1 commit into
microsoft:mainfrom
PStarH:feat/pricing-deepseek-and-qwen-models

Conversation

@PStarH

Copy link
Copy Markdown

Summary

DeepSeek (deepseek-chat V3, deepseek-reasoner R1) and Alibaba Qwen (qwen-2.5-coder-32b, qwen-plus, qwen-max) are widely used in coding agent sessions (e.g. via OpenCode, Cline, and proxy adapters).

Without explicit price ratio entries in MODEL_WEIGHTS, sessions on these models fall back to the generic fallback curve (cache hit 0.10x, output 6x). This significantly distorts effective cost accounting:

  • DeepSeek V3 output is 2.0x input (not 6.0x);
  • DeepSeek R1 cache hit is ~0.2545x input and output is ~3.982x input;
  • Qwen models bill cache hits at 0.20x to 0.25x input with 3.0x to 4.0x output.

Changes

  • In tokeneconomizer/pricing.py: add deepseek-chat, deepseek-reasoner, qwen-2.5-coder-32b, qwen-plus, and qwen-max with published Standard-tier price ratios.
  • In tests/test_pricing_new_models.py: add all 5 models to the parameterized price verification table.

Verification

All 38 tests in tests/test_pricing_new_models.py pass.

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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant