[GH-ISSUE #4742] [Engine] serve: agree the scope: keeping the Monitor's token counts, and pricing them #2174

Open
opened 2026-11-04 01:57:14 +07:00 by bsakaguchi · 5 comments
Owner

Originally created by @au70ma70n on GitHub (Oct 30, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4742

Part of the token-costing work is a feature and a default change, so per CONTRIBUTING the scope wants agreement before the code does. Three pull requests tell one story, in this order:

  1. Keep the Monitor's token counts between starts - the counts cover one start today, so every restart loses them; they would live beside the run config as <name>.totals.json, written when a request ends. --totals-file none keeps the old behaviour. This is a default change (a small file appears next to the run config, and the counters now span starts). Related: #4631, which wants a way to clear them; this keeps them and adds --totals-reset for a costing window, but no button.
  2. Print what the counted tokens would have cost at your own prices - two numbers the page's Settings view edits (cost_input_per_million, cost_output_per_million), because the machine charges nothing of its own and a dollar figure is only useful as what an API would have asked. No price set: no figure printed.
  3. Price a prompt the way an API does - two more numbers for a cache write and a cache read, each falling back to the plain input price when unset, so a model priced without prompt caching needs only the first two.

The fourth pull request in the set is the settings-card layout fix, which is a fix, not a feature, and needs no agreement.

Nothing here changes what the engine does to a prompt; it is the Monitor's counting and the arithmetic beside it. Validation on each branch: serve.test_totals plus test_prometheus, test_monitor, test_request_accounting, test_lifecycle, test_web_i18n - 43, 54, 62 and 73 tests in landing order, all OK, 2 skipped (node missing, symlinks need privilege). Not run: npm test and the Terminal suite, and any figure against a real API bill.


Strata version: 0.2.10 (engine 0.1.56) - strata.py --version printed
strata 0.2.10 (build 0.1.56; python 3.10.11), and engine\strata.exe --version printed
strata 0.1.56.

Graphics card, memory and system: NVIDIA GeForce RTX 5090 with 32 GB VRAM
(nvidia-smi: 32607 MiB, driver 621.01), 128 GB RAM, Windows 11 Pro build 26200.
An AMD Radeon integrated GPU is also present but Strata ran on the RTX 5090.

Originally created by @au70ma70n on GitHub (Oct 30, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/4742 Part of the token-costing work is a feature and a default change, so per CONTRIBUTING the scope wants agreement before the code does. Three pull requests tell one story, in this order: 1. **Keep the Monitor's token counts between starts** - the counts cover one start today, so every restart loses them; they would live beside the run config as `<name>.totals.json`, written when a request ends. `--totals-file none` keeps the old behaviour. This is a default change (a small file appears next to the run config, and the counters now span starts). Related: #4631, which wants a way to clear them; this keeps them and adds `--totals-reset` for a costing window, but no button. 2. **Print what the counted tokens would have cost at your own prices** - two numbers the page's Settings view edits (`cost_input_per_million`, `cost_output_per_million`), because the machine charges nothing of its own and a dollar figure is only useful as what an API would have asked. No price set: no figure printed. 3. **Price a prompt the way an API does** - two more numbers for a cache write and a cache read, each falling back to the plain input price when unset, so a model priced without prompt caching needs only the first two. The fourth pull request in the set is the settings-card layout fix, which is a fix, not a feature, and needs no agreement. Nothing here changes what the engine does to a prompt; it is the Monitor's counting and the arithmetic beside it. Validation on each branch: `serve.test_totals` plus `test_prometheus`, `test_monitor`, `test_request_accounting`, `test_lifecycle`, `test_web_i18n` - 43, 54, 62 and 73 tests in landing order, all OK, 2 skipped (`node` missing, symlinks need privilege). Not run: `npm test` and the Terminal suite, and any figure against a real API bill. --- **Strata version:** 0.2.10 (engine 0.1.56) - `strata.py --version` printed `strata 0.2.10 (build 0.1.56; python 3.10.11)`, and `engine\strata.exe --version` printed `strata 0.1.56`. **Graphics card, memory and system:** NVIDIA GeForce RTX 5090 with 32 GB VRAM (`nvidia-smi`: 32607 MiB, driver 621.01), 128 GB RAM, Windows 11 Pro build 26200. An AMD Radeon integrated GPU is also present but Strata ran on the RTX 5090.
Author
Owner

@github-actions[bot] commented on GitHub (Oct 30, 2026):

Thanks for the issue. To keep the tracker readable, every item needs an area prefix in the title and the parts of the issue form filled in. This one is missing:

  • Add the Strata version (Settings > About, or strata --version).
  • Add your graphics card with its VRAM, your RAM and your operating system.

Edit the issue (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment /reopen.

Details: CONTRIBUTING.md

<!-- gh-comment-id:6533555529 --> @github-actions[bot] commented on GitHub (Oct 30, 2026): Thanks for the issue. To keep the tracker readable, every item needs an area prefix in the title and the parts of the issue form filled in. This one is missing: - [ ] Add the Strata version (Settings > About, or `strata --version`). - [ ] Add your graphics card with its VRAM, your RAM and your operating system. Edit the issue (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment `/reopen`. Details: [CONTRIBUTING.md](https://github.com/Niko1221/Strata/blob/main/CONTRIBUTING.md)
Author
Owner

@github-actions[bot] commented on GitHub (Nov 5, 2026):

Closing this issue because it still did not follow the format after 5 days. That is housekeeping, not a rejection.

To bring it back: fix the title (area prefix) and the missing parts, then comment /reopen. A check runs and reopens it, or tells you what is still missing. See CONTRIBUTING.md.

<!-- gh-comment-id:6649632733 --> @github-actions[bot] commented on GitHub (Nov 5, 2026): Closing this issue because it still did not follow the format after 5 days. That is housekeeping, not a rejection. To bring it back: fix the title (area prefix) and the missing parts, then comment `/reopen`. A check runs and reopens it, or tells you what is still missing. See [CONTRIBUTING.md](https://github.com/Niko1221/Strata/blob/main/CONTRIBUTING.md).
Author
Owner

@au70ma70n commented on GitHub (Nov 5, 2026):

/reopen

<!-- gh-comment-id:6650040604 --> @au70ma70n commented on GitHub (Nov 5, 2026): /reopen
Author
Owner

@github-actions[bot] commented on GitHub (Nov 5, 2026):

Thanks, this follows the format now.

<!-- gh-comment-id:6650042591 --> @github-actions[bot] commented on GitHub (Nov 5, 2026): Thanks, this follows the format now.
Author
Owner

@github-actions[bot] commented on GitHub (Nov 5, 2026):

Reopened, thank you. A maintainer will pick it up from here.

<!-- gh-comment-id:6650043180 --> @github-actions[bot] commented on GitHub (Nov 5, 2026): Reopened, thank you. A maintainer will pick it up from here.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#2174
No description provided.