Repository navigation
Conversation
V4's encoder with V4.1's System token, numeric reasoning-effort budget and thinking-by-default, for plain chats (no tools, no mid-conversation system messages). Selected by name; tested against the checkpoint's shipped encoding/encoding.py. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copy messages instead of unpacking them into a TypedDict literal, reject non-text system content, and drop unneeded type-ignore comments. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
samsja
added a commit
to PrimeIntellect-ai/prime-rl
that referenced
this pull request
Oct 15, 2026
…-V4.1-Flash Bump deps/renderers to PrimeIntellect-ai/renderers#192, which ships the V4.1 renderer, and drop the example's custom renderer file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The V4.1 renderer now renders tools, assistant tool calls and tool results like the checkpoint's encoding/encoding.py, and parses completions with vLLM's deepseek_v41 DSML format: - DSML tags are space-prefixed: <|DSML| calls>, <|DSML| invoke>, <|DSML| parameter>, in the tools block, the rendered calls and the parser. - Tools attach to a leading system message, or to an empty one that the <|System|> token opens. - A user turn holding only tool results does not start a new turn, so dropped historical reasoning stops at the last real user message. - JSON-string arguments may be double-encoded; arguments that do not decode to an object render as a single "arguments" parameter. - The prefix-extension bridge is enabled again. DeepSeekV4Renderer gains small hooks for these (tag names, grammar, preamble, turn start, tool target, argument decoding); its output is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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 a
deepseek-v4.1renderer for DeepSeek-V4.1-Flash, moved here from prime-rl's example custom renderer (PrimeIntellect-ai/prime-rl#4057) so configs can select it by name (including on hosted training, where a repo-relativeimport_pathdoes not resolve).For plain chats, V4.1's reference encoder (
encoding/encoding.pyin the checkpoint) is V4's with three changes, applied on top ofDeepSeekV4Renderer:<|System|>token leads the conversation whenever it opens with a reasoning-effort prefix or a system message;Reasoning Effort: {budget} (range 1-100, ...), thinking mode only, defaulthigh(75);low/high/maxmap to 50 / 75 / 100;A leading inline
<think>...</think>in an assistant's content moves intoreasoning_content, as other renderers do.Not supported yet: tool calls (V4.1 renamed the DSML tags) and mid-conversation system messages; both raise
NotImplementedError.bridge_to_next_turnreturnsNone(full re-render) since V4's extension path would emit V4's tags.Selected by name only (
name = "deepseek-v4.1"): it is not inMODEL_RENDERER_MAP, because auto-mapped renderers must pass the shared parity suites, which need tool support.Test plan
tests/test_deepseek_v41.py: token-for-token parity with the checkpoint's shippedencoding/encoding.py(downloaded from the Hub) over 4 conversations × thinking on/off × effortlow/high/max/30; config discriminator and effort range; inline-reasoning split; tool and mid-conversation system rejection.pytest tests/test_deepseek_v41.py tests/test_deepseek_v4.py tests/test_renderer_config.py tests/test_reasoning_boundaries.py: 989 passed.🤖 Generated with Claude Code
Note
Add
DeepSeekV41Rendererfor DeepSeek-V4.1-FlashDeepSeekV4Rendererin deepseek_v41.py, with thinking enabled by default and areasoning_effortfield acceptinglow,high,max, or integers 1–100 (named levels map to budgets 50, 75, 100).deepseek-v4.1in the renderer name registry, the lazy renderer map, and theRendererConfigdiscriminated union in configs.py and base.py.NotImplementedError), and splits a leading inline think block in assistant messages into separate reasoning content.bridge_to_next_turnonDeepSeekV41Rendereralways returnsNone, so incremental turn bridging is unavailable for this model.Macroscope summarized c949a28. (Automatic summaries will resume when PR exits draft mode or review begins).