Repository navigation
Fix compaction using actual context usage - #684
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A short message can fail with “Lower Max output to leave room for conversation compaction” when a saved Max output setting is equal to or larger than the effective context window. For example, context 4,096 and Max output 4,096 should allow “Hello” to generate a short answer.
Trigger compaction from actual input usage at the selected percentage (75% by default), without subtracting Max output or changing its saved value. Document fitting also stops reserving unused output tokens when Auto compact is enabled. The server counts and, when necessary, compacts the input before limiting generation to the smaller of Max output and the remaining context capacity.
Pin the bundled mlx-vlm server to the companion fix in Blaizzy/mlx-vlm#2458 (
0a46548aab8fd034a68f54f5cb49cc6ce113728a). PreserveMLX_VLM_SOURCE_PATHoverrides when resolving the pinned requirements. External servers need the companion fix as well. Compaction still happens between generation requests, including tool rounds; reaching the context limit ends a response with a length result.Validation:
SystemMonitorIdentityTestsimport/configuration failure.--only-binary=:all:option.response.incomplete.Addresses #670.