Repository navigation
S25-E: recording proxy and chat-template token alignment (N10.5-10.6) - #273
Draft
michaellchung wants to merge 2 commits into
Draft
michaellchung wants to merge 2 commits into
michaellchung wants to merge 2 commits into
Conversation
…5/N10.6) - SamplerEngine port: optional TokenSamplerEngine.generate_tokens (token-id prompts, stop token ids); SGLang (input_ids), vLLM (id-list prompts) and the fake engine implement it. - RecordingBackend: a gateway SessionBackend that samples the engine directly and keeps one append-only token stream per session, with loss mask, log-probs, policy version and provenance per turn; SGLang-style meta_info in the reply; per-turn render drift check; optional CompactionRL context compaction reusing yeto.rl.compaction. - RecordsProxy: the existing Gateway (Responses/Chat translation, chains, signed sampling) over the records backend, with an aiohttp shell (Responses SSE reuses the Codex bridge encoder). - chat_templates: template registry (glm5, qwen3), output parsers and the token alignment check against apply_chat_template. GLM5.3-Flash tokenizer is not available; glm5 is checked with the GLM-4.7-Flash tokenizer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The turn's policy version was read after generate_tokens returned, so a reload during the call recorded the new version for tokens the old one may have sampled. The backend now reads the version before and after the call and refuses the turn when it changed. Signed repetition_penalty is passed to SamplingParams so check() refuses it instead of dropping it silently, and prompt_tokens is computed under the session lock. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Testing: Full remote test suite on the stack tip: 0 failures. Not validated on PPU/NPU hardware (machines busy).
Part of the S25 stack (NPU+PPU heterogeneous GLM5.3-Flash full-param RL). Draft; do not merge before the S24 stack (#262–#268).
🤖 Generated with Claude Code