Skip to content

feat(implement): rewrite reasoning-parser recipe with token discovery guide#10

Merged
slin1237 merged 1 commit intomainfrom
feat/reasoning-parser-recipe-v2
Mar 3, 2026
Merged

feat(implement): rewrite reasoning-parser recipe with token discovery guide#10
slin1237 merged 1 commit intomainfrom
feat/reasoning-parser-recipe-v2

Conversation

@slin1237
Copy link
Copy Markdown
Member

@slin1237 slin1237 commented Mar 3, 2026

Summary

Rewrite the reasoning-parser recipe from a vague description into a parameterized template with a concrete token discovery guide referencing vLLM and SGLang.

Problem

The old recipe told you to "check model card or API docs for reasoning delimiters" — but reasoning tokens live in different places depending on the model. Contributors had to rediscover this every time.

Changes

  • skills/implement/reasoning-parser.md (321 insertions, 44 deletions):
    • Token discovery guide — 6-step priority order:
      1. Check vLLM (17 models) and SGLang first — tokens already validated
      2. HuggingFace tokenizer_config.jsonadded_tokens_decoder
      3. HuggingFace tokenizer_config.jsonchat_template
      4. HuggingFace model card
      5. Provider API docs
      6. Test request observation
    • Reference links to actual GitHub source:
      • vLLM: https://github.com/vllm-project/vllm/tree/main/vllm/reasoning
      • SGLang: https://github.com/sgl-project/sglang/blob/main/python/sglang/srt/parser/reasoning_parser.py
    • Known token tables: 9 in SMG + 8 in vLLM/SGLang not yet in SMG
    • Parameterized template: Complete Rust parser with 7 tests
    • initial_in_reasoning guide: Check add_generation_prompt or observe first token

Test Plan

  • All GitHub links resolve to correct files
  • Token table covers all existing SMG parsers
  • Template compiles when substituted with real values

… guide

The old recipe described what to do but left the agent to figure out
the boilerplate and token discovery. Since adding a reasoning parser
is almost entirely mechanical (4 inputs → 4 files touched), the new
recipe provides:

Token discovery guide (6-step priority order):
1. Check vLLM (17 models) and SGLang implementations first — tokens
   already validated against real model output
2. HuggingFace tokenizer_config.json → added_tokens_decoder
3. HuggingFace tokenizer_config.json → chat_template Jinja2
4. HuggingFace model card / README
5. Provider API docs
6. Send test request and observe raw output

Reference tables:
- 9 model families currently in SMG with exact tokens and flags
- 8 model families in vLLM/SGLang not yet in SMG (candidates to add)
- initial_in_reasoning decision guide

Template:
- Complete parameterized Rust parser file with 7 tests
- Exact registration steps for mod.rs, lib.rs, factory.rs
- Custom logic section for MiniMax-style edge cases
- Common mistakes table with consequences and fixes

Signed-off-by: Simo Lin <slin1237@gmail.com>
Signed-off-by: Simo Lin <linsimo.mark@gmail.com>
@slin1237 slin1237 merged commit deb8bcf into main Mar 3, 2026
2 checks passed
@slin1237 slin1237 deleted the feat/reasoning-parser-recipe-v2 branch March 3, 2026 03:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant