Skip to content

[staging] unslothai/unsloth#19159: reuse the native prompt count in a GGUF chat's context fit - #280

Closed
Lyxot wants to merge 5 commits into
mainfrom
staging/19159-native-prompt-count
Closed

Lyxot wants to merge 5 commits into
mainfrom
staging/19159-native-prompt-count

Conversation

@Lyxot

@Lyxot Lyxot commented Nov 24, 2026

Copy link
Copy Markdown
Owner

Staging copy of unslothai#19159 (same head) for CI, because upstream runners are backed up. Will be closed once CI and Codex review converge.

NilayYadav and others added 5 commits November 23, 2026 21:55
…nd native counts

Both count paths now compute the native key once and look it up before the native call; the miss test also covers a changed system prompt and template options.
llama-server renders tool schema keys in the order the request sends them, so reordered parameters change the prompt and its count (267 vs 266 tokens on Qwen3.5). Sorting keys made both orders share one memo entry, letting the context fit reuse a count for a different prompt.
…e count

A render count hitting the native memo returned before any cancellation check, so a cancelled turn's context fit could take the cached count and go on to trim and archive. Poll should_abort before the shared lookup for every caller, and reorder nested schema keys in the key-order miss test.
@Lyxot

Lyxot commented Nov 24, 2026

Copy link
Copy Markdown
Owner Author

Closing: CI checked and Codex converged on the upstream PR.

@Lyxot Lyxot closed this Nov 24, 2026
@Lyxot
Lyxot deleted the staging/19159-native-prompt-count branch November 24, 2026 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants