hermes - 💡(How to fix) Fix insights: DeepSeek v4-pro/v4-flash pricing not matching + cost not rendered in output [1 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…

hermes insights has the infrastructure to compute API costs, but two disconnects prevent it from working for DeepSeek models and from being visible to users.

Root Cause

Because resolve_billing_route() doesn't recognize deepseek as a known provider:

  • billing_mode falls through to "unknown"
  • _lookup_official_docs_pricing() does exact match on (provider, model_name)("deepseek", "deepseek-v4-pro") misses ("deepseek", "deepseek-chat")
  • DeepSeek's /v1/models endpoint doesn't return pricing info (verified 2026-05-12), so _pricing_entry_from_metadata() returns None
  • Result: estimated_cost = $0.00 with status="unknown"

Fix Action

Fixed

Code Example

Est. cost:          ~$0.04
RAW_BUFFERClick to expand / collapse

Summary

hermes insights has the infrastructure to compute API costs, but two disconnects prevent it from working for DeepSeek models and from being visible to users.

Issues

1. DeepSeek v4-pro / v4-flash not in pricing table

agent/usage_pricing.py _OFFICIAL_DOCS_PRICING has entries for deepseek-chat and deepseek-reasoner, but not deepseek-v4-pro or deepseek-v4-flash — the actual model IDs returned by DeepSeek's /v1/models endpoint.

Because resolve_billing_route() doesn't recognize deepseek as a known provider:

  • billing_mode falls through to "unknown"
  • _lookup_official_docs_pricing() does exact match on (provider, model_name)("deepseek", "deepseek-v4-pro") misses ("deepseek", "deepseek-chat")
  • DeepSeek's /v1/models endpoint doesn't return pricing info (verified 2026-05-12), so _pricing_entry_from_metadata() returns None
  • Result: estimated_cost = $0.00 with status="unknown"

2. format_terminal() and format_gateway() don't render cost

_compute_overview() returns estimated_cost and actual_cost fields, but neither InsightsEngine.format_terminal() nor .format_gateway() displays them. The cost is computed internally but never surfaced to the user.

3. Feature request: --json output

A --json flag would let external consumers (cron jobs, dashboards) consume the full report data without regex-parsing terminal output. The report dict already has all the structured data.

Proposed fix

For (1): add ("deepseek", "deepseek-v4-pro") and ("deepseek", "deepseek-v4-flash") to _OFFICIAL_DOCS_PRICING using the deepseek-chat pricing ($0.14/M input, $0.28/M output per https://api-docs.deepseek.com/quick_start/pricing). Alternatively, add a model-name prefix/suffix matching heuristic.

For (2): add a cost line to the Overview section in both format methods, e.g.:

  Est. cost:          ~$0.04

For (3): a --json or --format json flag that outputs json.dumps(report).

Related code

  • agent/usage_pricing.py:352-372 — DeepSeek pricing entries
  • agent/usage_pricing.py:516-542resolve_billing_route()
  • agent/insights.py:759-768format_terminal() Overview section (no cost line)
  • agent/insights.py:878-882format_gateway() Overview section (no cost line)
  • hermes_cli/main.py:10383-10394cmd_insights() (no JSON flag)

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

hermes - 💡(How to fix) Fix insights: DeepSeek v4-pro/v4-flash pricing not matching + cost not rendered in output [1 pull requests]