feat(laguna): add poolside/Laguna-S-2.1 support via a dedicated renderer - #111
Open
eexwhyzee wants to merge 2 commits into
Open
feat(laguna): add poolside/Laguna-S-2.1 support via a dedicated renderer#111eexwhyzee wants to merge 2 commits into
eexwhyzee wants to merge 2 commits into
Conversation
ApprovabilityVerdict: Needs human review This PR adds a new model renderer (LagunaS21Renderer) for poolside/Laguna-S-2.1, introducing new user-facing capability. While the implementation is a thin subclass following existing patterns, new feature additions warrant human review to verify the integration and default behavior differences. You can customize Macroscope's approvability policy. Learn more. |
S-2.1 is a larger sibling of XS-2.1 (48 layers, hidden 3072, top-10 of 256 experts) but ships a byte-identical chat_template.jinja and tokenizer (same special tokens/ids, same vocab). It reuses LagunaXS21Renderer via an exact-match MODEL_RENDERER_MAP entry; no new renderer/config/parser needed. Added to the shared render-parity matrices (config-parity, is_content, sampled_mask); token-exact parity against apply_chat_template verified for both enable_thinking polarities across all conversation shapes.
eexwhyzee
force-pushed
the
feature/laguna-s-2.1-route
branch
from
July 24, 2026 17:36
268b752 to
cdc158e
Compare
…late The initial routing (cdc158e) assumed S-2.1 shipped a byte-identical chat template to XS-2.1 and reused LagunaXS21Renderer. It doesn't: S-2.1 shares XS-2.1's tokenizer (same vocab/merges/special tokens) but its template defaults enable_thinking to True (XS-2.1 defaults False) and adds a preserve_thinking kwarg, widening the reasoning-display gate to `enable_thinking or preserve_thinking`. Reusing the XS-2.1 renderer mismatched apply_chat_template on the default flag (bare `</think>` vs empty `<think></think>` wrapper), failing test_render_ids / test_build_helpers. The config-parity barrage missed this because it always sets enable_thinking explicitly, never exercising the differing default. Add LagunaS21RendererConfig (enable_thinking=True, preserve_thinking=False) and LagunaS21Renderer, a thin LagunaXS21Renderer subclass that overrides only the reasoning-display gate. Route poolside/Laguna-S-2.1 to it. The token format is otherwise identical, so everything else is inherited. Verified token-exact against apply_chat_template for all enable_thinking × preserve_thinking combinations; added tests/test_laguna_s21.py for the S-2.1-specific behaviours the shared barrage can't reach. Co-Authored-By: Claude Opus 4.8 (1M context) <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.
Summary
Adds renderer support for
poolside/Laguna-S-2.1, a larger sibling of XS-2.1.S-2.1 shares XS-2.1's tokenizer (same vocab, merges, and special tokens/ids) but ships a different chat template: it defaults
enable_thinkingtoTrue(XS-2.1 defaultsFalse) and adds apreserve_thinkingkwarg that widens the reasoning-display gate toenable_thinking or preserve_thinking. The token format is otherwise identical.Changes
LagunaS21RendererConfig—enable_thinking=True,preserve_thinking=Falsedefaults, matching S-2.1's template. Registered in the discriminated union,_CONFIG_BY_NAME, and exports.LagunaS21Renderer— a thinLagunaXS21Renderersubclass that overrides only the reasoning-display gate (enable_thinking or preserve_thinking); everything else (role tags, tool-call packing, system-block gate, generation prompt, parse skeleton) is inherited unchanged.poolside/Laguna-S-2.1→laguna-s-2.1inMODEL_RENDERER_MAP; register the renderer; lazy-import + exports.__init__accepts the config union; subclass narrowsself.config).Testing
tests/test_laguna_s21.py: token-exact parity vsapply_chat_templatefor all fourenable_thinking × preserve_thinkingcombinations, plus the thinking-on default and thepreserve_thinkinghistory-retention behaviour.ruff+tyclean (no new diagnostics vs main).🤖 Generated with Claude Code