Repository navigation
feat(inkling2): map Inkling 2 Mini and bridge to the next turn - #225
Merged
Merged
Conversation
`thinkingmachines/Inkling-2-Mini` has the same `tokenizer.json` as Inkling 2 Small, and its chat template renders the same tokens: it only adds transformers' generation markers around assistant messages. So it takes the same renderer. The parity catalog and the Inkling 2 tests now cover both checkpoints at pinned revisions, and the config table lists the renderer. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
`Inkling2Renderer.bridge_to_next_turn` extends a stop-terminated sampled turn with the template's own span for every new user or tool message, so the sampled tokens stay exactly as the model produced them (a full re-render canonicalises a tool call's JSON). The template renders each message independently of its neighbours, which is what makes the extension equal to a full render. It declines, so the caller re-renders, when the extension cannot be proven equal: a truncated turn (the template would add a close), an unnamed tool result (its name comes from the issuing assistant, which the new messages omit), or any other role. The renderer also declares `effective_thinking_retention = "all"`: the template keeps every historical reasoning block. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
aniravich
force-pushed
the
feat/inkling-2-mini
branch
from
November 24, 2026 18:42
f2bcaeb to
8d7cfd3
Compare
aniravich
marked this pull request as ready for review
November 25, 2026 00:31
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — Adds Inkling 2 Mini support and guarded next-turn bridging, while treating literal delimiters as ordinary content. The model-specific scope and reference-parity coverage leave no obvious material risk requiring human judgment. Notes:
You can add or adjust custom eligibility rules. Learn more. |
This was referenced Nov 25, 2026
hallerite
previously approved these changes
Nov 25, 2026
hallerite
dismissed stale reviews from macroscopeapp[bot] and themself
via
November 25, 2026 14:53
0e3289c
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.
What this does
The
inkling-2renderer from #222 (it turns chat messages into token ids) now covers Inkling 2 Mini by name. For each later turn it keeps the earlier tokens and appends only the new messages, instead of rebuilding from text. A rebuild gave other tokens than the stored ones in 130 of 202 stored conversations.Where it fits
This was found while adding Inkling 2 Mini to prime-rl, and it stands alone.
The Inkling 2 Mini stack: PrimeIntellect-ai/prime-rl#4723, PrimeIntellect-ai/prime-rl#4724, PrimeIntellect-ai/prime-rl#4725, PrimeIntellect-ai/prime-rl#4726, PrimeIntellect-ai/prime-rl#4727, PrimeIntellect-ai/prime-rl#4732.
prime-rl uses this change only once its pin of the renderers library is moved, which none of these pull requests does.
What changes
MODEL_RENDERER_MAPmapsthinkingmachines/Inkling-2-Minitoinkling-2; the Mini has Inkling 2 Small's tokenizer.bridge_to_next_turn: appends the chat template's tokens for each new user or tool message.None, and the caller rebuilds from text, for a cut-off reply, an unnamed tool result or another role.How to try it
How we know it works
Limits
🤖 Generated with Claude Code
Note
Add Inkling 2 Mini renderer support and bridge-to-next-turn
thinkingmachines/Inkling-2-Minito the inkling-2 renderer inMODEL_RENDERER_MAPand pins its test revisionInkling2Renderer._applyto mark template-emitted token spellings with a lone-surrogate boundary marker, so special-token spellings inside ordinary message text encode as ordinary textInkling2Renderer.bridge_to_next_turn, which appends rendered user/tool messages after a completion that ends at a sampling stop or a complete final tool call, preserving the prior prompt and sampled completion IDs. It returnsNonefor empty tails, incomplete completions, unnamed tool messages, and tails with other rolestml_renderersrenderer for prompts, supervised token weights, literal delimiters, and sampled turns, running against both Inkling 2 Small and Mini checkpointsInkling2Renderernow reportsalleffective thinking retention; content attribution in_text_content_maskuses the new ordinary-text encodingChanges since #225 opened
modeljob of thetestGitHub Actions workflow to refer to the Inkling renderers instead of the Inkling 2 renderer. [0e3289c]Macroscope summarized 6f57718.