hermes - 💡(How to fix) Fix [Bug]: deepseek-v4-pro sessions show as unknown cost in `hermes insights` [2 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Root Cause

agent/usage_pricing.py:352-372 lists ("deepseek", "deepseek-chat") and ("deepseek", "deepseek-reasoner") but no ("deepseek", "deepseek-v4-pro"). The model id is registered for context-window lookup at agent/model_metadata.py:186 but never gained a matching pricing snapshot.

Fix Action

Fixed

RAW_BUFFERClick to expand / collapse

Bug Description

hermes insights and the gateway /usage view compute per-model cost from the static _OFFICIAL_DOCS_PRICING table in agent/usage_pricing.py. That table covers the legacy aliases deepseek-chat and deepseek-reasoner but is missing an entry for the first-class model id deepseek-v4-pro, which has been routable since v0.12 (release notes: RELEASE_v0.12.0.md, RELEASE_v0.13.0.md). As a result, any session run against deepseek-v4-pro is counted in unknown_cost_sessions and rendered with cost_status="unknown" instead of a dollar estimate.

Steps to Reproduce

  1. Run a chat session against deepseek/deepseek-v4-pro (e.g. via Nous Portal or OpenRouter), then exit so the session is recorded.
  2. Run hermes insights --days 30.
  3. Inspect the JSON report (e.g. python -c "from hermes_state import SessionDB; from agent.insights import InsightsEngine; print(InsightsEngine(SessionDB()).generate(days=30)['overview'])").

Expected Behavior

The session's estimated_cost_usd is populated from the official DeepSeek price list, contributes to overview.estimated_cost and the per-model cost field, and the session counts toward included_cost_sessions.

Actual Behavior

estimate_usage_cost("deepseek-v4-pro", ..., provider="deepseek") returns CostResult(amount_usd=None, status="unknown", source="none", label="n/a") because get_pricing_entry finds no match in _OFFICIAL_DOCS_PRICING. The session ends up in unknown_cost_sessions and its cost is dropped from totals.

Affected Component

  • Agent Core (cost accounting in agent/usage_pricing.py + agent/insights.py)

Root Cause

agent/usage_pricing.py:352-372 lists ("deepseek", "deepseek-chat") and ("deepseek", "deepseek-reasoner") but no ("deepseek", "deepseek-v4-pro"). The model id is registered for context-window lookup at agent/model_metadata.py:186 but never gained a matching pricing snapshot.

Proposed Fix

Add a PricingEntry for ("deepseek", "deepseek-v4-pro") using the published list price (api-docs.deepseek.com/quick_start/pricing): input $1.74 / output $3.48 / cache_read $0.0145 per 1M tokens. Standard list rate, not the 75% promo that expires 2026-05-31 — otherwise cost estimates would silently drift once the promo lapses.

PR: #24216

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING