mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #562] [CLOSED] serve: /slots reports n_prompt_tokens, so a llama.cpp-style context m… #2692
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#2692
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/562
Author: @Zerschranzer
Created: 10/2/2026
Status: ❌ Closed
Base:
main← Head:slots-n-prompt-tokens📝 Commits (10+)
872af82Low-RAM mode, resident variant: the experts the GPU does not hold stay in RAM (--resident-experts), chosen by setup483953fMerge f-84 into rel-0.1.307e4ee54setup: the resident low-RAM variant keeps its RAM copy pageable on ROCm (STRATA_RESIDENT_PIN=0 in the config's env)1afdd47Merge f-coupled into rel-0.1.300704e7dHIP: enable RDNA4 gfx1201 (RX 9070 / AI PRO R9700)8616c60generate: the option parser's else-if chain in two statements (MSVC C1061: more than 128 nested blocks after the new options); the same order and effects538a0dfMerge f-resram into rel-0.1.30703ef30Merge f-189 (PR #189, the conversation snapshot core and RAM cache) into rel-0.1.30e46cccaConversation snapshots and checkpoints follow the session carve (#216): a session saves and restores only the layers it owns9907379HIP: RDNA4 gfx1201 beside gfx1100; the startup check compares the card with the compiled archs; setup picks ROCm and the hipBLASLt table per arch📊 Changes
3 files changed (+24 additions, -4 deletions)
View changed files
📝
docs/DETAILS.md(+2 -2)📝
serve/server.py(+7 -1)📝
serve/test_server.py(+15 -1)📄 Description
Why
Clients written against llama.cpp's endpoints read a context meter from
/slots: they dividen_prompt_tokensbyn_ctx. Strata's slot carried onlyid,n_ctxandis_processing, so such a meter sits at 0 % againstStrata however full the context is - and the reaction a user reaches for ("raise the context") changes nothing.
The number is already there, only not under that name. Same second, IQ3_S, 2x RX 9060 XT (gfx1200, HIP), engine
0.1.37:
I hit it with a chat front-end of my own that draws a context ring: it stayed at 0 % through a 120K-token
conversation, while
/statusand/metricshad the right number the whole time.What it changes
GET /slotsalso returnsn_prompt_tokens: the running request's prompt size, kept after it ends (theconversation cache carries it on). Read under
status_lock, so it is the same snapshot/statusserves.Nothing else in the response changes, and the Monitor's own
/metricsis untouched.serve/test_server.py:test_slot_reports_the_context_in_use- a setprompt_tokensshows up in the slot, andafter clearing it the slot reports 0. The existing exact-slot assertion in
test_build_model_path_and_slot_statuscarries the new key.docs/DETAILS.md: the endpoint table and the paragraph say what/slotsreports.Semantics, on purpose
n_prompt_tokensdoes not count them; the nextrequest's prompt carries them through the conversation cache, so a meter catches up on the next round.
token by token.
[], so a client hides the meter rather than showing 0 %.n_prompt_tokens_processedandn_prompt_tokens_cache(also llama.cpp names) are deliberately left out untilsomeone needs them; the engine's
reusedwould map onto the latter.Tests
against the mock engine, no GPU and no pack. Live on the same build:
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.