Skip to content

DeepSeek Harness Source

  • $DSH_HOME/sessions/*/session-*/session.v3.jsonl.zstd
  • ~/.dsh/sessions/*/session-*/session.v3.jsonl.zstd

The adapter reads any committed log name the harness writes: session.jsonl or session.vN.jsonl, plain or with .zstd.

$DSH_HOME is the harness home; when it is unset or blank the adapter falls back to ~/.dsh. Each session-* directory holds one session log.

Terminal window
llm-usage daily --source dsh --dsh-dir /path/to/.dsh/sessions

dsh is directory-backed, so generic source directory overrides also work:

Terminal window
llm-usage daily --source-dir dsh=/path/to/.dsh/sessions

DeepSeek Harness appends one independently zstd-compressed frame per flush, so the adapter decodes the log frame by frame instead of once for the whole file: a single whole-file decode would stop at the first frame and hide most of a session. A torn final frame from an interrupted append is reported as undecodable_jsonl_frame and never discards the frames before it.

  • Each assistant/message record that carries a usage block becomes one event.
  • inputTokens is already the uncached prompt size, so it maps directly to input tokens; cacheReadTokens and cacheWriteTokens are preserved as separate buckets.
  • reasoningTokens is a subset of outputTokens and is carried for cache and reasoning reporting without being billed twice.
  • sessionId comes from the session header, repoRoot from its cwd, and provider/model from the message source, falling back to the route recorded by session/title-llm-request when a message omits them.
  • Tool calls, step boundaries, and other lifecycle records carry no usage and are skipped silently.

Only the session log is read. The harness projection cache under ~/.dsh/storages holds session totals rather than per-request usage, so it is never used as an event source.

The harness reports its default route as deepseek-flash. As checked on October 4, 2026, LiteLLM’s upstream catalog includes this key with DeepSeek’s peak rates. A refreshed pricing cache can therefore price it directly. The bundled snapshot also contains deepseek-flash, at the same peak rates ($0.30 input, $1.20 output, $0.006 cache read per million tokens), so offline runs price it without an override.

DeepSeek’s current pricing page lists these V4.1-Flash rates per million tokens:

Window Input (cache hit) Input (cache miss) Output
Off-peak $0.003 $0.15 $0.60
Peak $0.006 $0.30 $1.20

Peak hours are 01:00–04:00 and 06:00–10:00 UTC on weekdays, excluding Chinese public holidays. Other hours use off-peak rates. Check the linked rate card before copying these values; prices can change.

Use an override for offline pricing, a chosen tier, or historical rates. This example uses the peak tier:

{
"models": {
"deepseek-flash": {
"inputPer1MUsd": 0.3,
"outputPer1MUsd": 1.2,
"cacheReadPer1MUsd": 0.006
}
}
}

Halve those rates to estimate an entirely off-peak workload. Neither constant tier reconstructs a mixed workload exactly.

Terminal window
llm-usage monthly --source dsh --pricing-overrides ./pricing-overrides.json

Overrides match the event’s model name. Use the same override for every command whose costs you want to compare, or save it once:

[pricing]
overridesPath = "/absolute/path/to/pricing-overrides.json"

DeepSeek’s pricing page also says the legacy deepseek-v4-flash and deepseek-v4-flash-vision-exp names now route to V4.1-Flash and use its prices. The bundled snapshot prices deepseek-v4-flash and deepseek-v4-flash-vision-exp at the same peak rates as deepseek-flash. Add an override under the exact name present in your events if you want off-peak rates or rates for a different period. See Pricing for the full override shape.