aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-08-21 22:54:09 +0200
committerDanilo M. <danix@danix.xyz>2026-08-21 22:54:09 +0200
commita241128e5a70cb75df9b7846f34f725ea84e4eeb (patch)
tree1e6a143c823c850a32dfc2d28b8c00fb95d33658 /README.md
parenta7422ddeb7771983e984350b31092fe4898897c6 (diff)
downloadllamachat-a241128e5a70cb75df9b7846f34f725ea84e4eeb.tar.gz
llamachat-a241128e5a70cb75df9b7846f34f725ea84e4eeb.zip
fix: store per-turn token sums so searched turns price every round
A searched turn makes one API call per search round and all of them are billed, but prompt_tokens/completion_tokens held only the last round's counts, so a searched turn under-reported its cost. The columns now hold the sum across rounds; usage_json keeps each round's raw usage block as a JSON array for external consumers to verify against. A single-round turn stores the same numbers as before.
Diffstat (limited to 'README.md')
-rw-r--r--README.md11
1 files changed, 6 insertions, 5 deletions
diff --git a/README.md b/README.md
index 416a84c..f53d167 100644
--- a/README.md
+++ b/README.md
@@ -312,11 +312,12 @@ web pages would compete with messages the user actually wrote.
`provider` records which provider served the reply (`local` or a configured
provider name), written when the reply finishes so history stays
self-describing even if `config.toml` later renames or drops the provider.
-`usage_json` keeps every round's raw usage block from the stream as a JSON
-array — a searched turn makes one API call per search round, and each round
-is billed separately, so all of them are kept verbatim and token details
-beyond the two counts (e.g. cached or reasoning tokens on a cloud endpoint)
-are recoverable later without re-guessing a field mapping.
+`prompt_tokens` and `completion_tokens` hold the turn's totals summed across
+every round — a searched turn makes one API call per search round and all of
+them are billed, so the last round's counts alone would under-report it.
+`usage_json` keeps each round's raw usage block as a JSON array, verbatim, so
+token details beyond the two counts (e.g. cached or reasoning tokens on a
+cloud endpoint) are recoverable later without re-guessing a field mapping.
`reported_cost_usd` is the GUI's hand-entered-price estimate for that one
reply (summed across rounds), stored as a sanity check for external
consumers — it is approximate and never a source of truth; it stays NULL for