Skip to content

fix: add DeepSeek v4 Pro/Flash pricing and fix snapshot survival through runtime cache#366

Open
NihalJain wants to merge 1 commit into
getagentseal:mainfrom
NihalJain:add_deepseek_v4_claude
Open

fix: add DeepSeek v4 Pro/Flash pricing and fix snapshot survival through runtime cache#366
NihalJain wants to merge 1 commit into
getagentseal:mainfrom
NihalJain:add_deepseek_v4_claude

Conversation

@NihalJain
Copy link
Copy Markdown
Contributor

@NihalJain NihalJain commented May 20, 2026

Summary

Fixes #365!

Pricing sourced from api-docs.deepseek.com/quick_start/pricing:

deepseek-v4-flash: $0.14/M input · $0.28/M output · $0.0028/M cache-read · free cache-write
deepseek-v4-pro: $1.74/M input · $3.48/M output · $0.0145/M cache-read · free cache-write

Note: LiteLLM PR #27056 had incorrect cache-read prices (1.4e-8 for flash, 1.74e-7 for pro); corrected here to match the official docs (2.8e-9 and 1.45e-8 respectively).

Changes:

  • bundle-litellm.mjs: add both models to MANUAL_ENTRIES so they survive future re-bundles until LiteLLM PR #27056 is merged
  • models.ts: add display names; fix loadPricing() to merge bundled snapshot entries back after loading the 24-hour runtime cache file, so MANUAL_ENTRIES are never silently dropped
  • providers/claude.ts: add shortNames for the Claude provider display
  • tests/models.test.ts: regression tests for pricing values, provider-prefixed lookups, calculateCost with observed production token counts, and display names

Testing

  • I have tested this locally against real data (not just unit tests)
  • npm test passes
  • npm run build succeeds
  • node dist/cli.js today shows correct costs and session counts for this provider
  • node dist/cli.js today --provider claude shows correct model names and pricing
  • Screenshot or terminal output attached below
    • Before:
      • Screenshot 2026-05-20 at 9 58 21 PM
    • After:
      • Screenshot 2026-05-20 at 10 06 02 PM

…ugh runtime cache (getagentseal#365)

Pricing sourced from api-docs.deepseek.com/quick_start/pricing:

  deepseek-v4-flash: $0.14/M input · $0.28/M output · $0.0028/M cache-read · free cache-write
  deepseek-v4-pro:   $1.74/M input · $3.48/M output · $0.0145/M cache-read · free cache-write

Note: LiteLLM PR #27056 had incorrect cache-read prices (1.4e-8 for flash,
1.74e-7 for pro); corrected here to match the official docs (2.8e-9 and
1.45e-8 respectively).

Changes:
- bundle-litellm.mjs: add both models to MANUAL_ENTRIES so they survive
  future re-bundles until LiteLLM PR #27056 is merged
- models.ts: add display names; fix loadPricing() to merge bundled snapshot
  entries back after loading the 24-hour runtime cache file, so MANUAL_ENTRIES
  are never silently dropped
- providers/claude.ts: add shortNames for the Claude provider display
- tests/models.test.ts: regression tests for pricing values, provider-prefixed
  lookups, calculateCost with observed production token counts, and display names
@NihalJain NihalJain changed the title fix: add DeepSeek v4 Pro/Flash pricing and fix snapshot survival through runtime cache (#365) fix: add DeepSeek v4 Pro/Flash pricing and fix snapshot survival through runtime cache May 20, 2026
@NihalJain
Copy link
Copy Markdown
Contributor Author

Hi @iamtoruk please have a look

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.

Cost is 0 for deepseek-v4-* models with claude

1 participant