[PR #13764] [MERGED] parsers: refactor Nemotron parser to reuse Qwen3Coder for tool calls #14378

Closed
opened 2026-04-13 00:52:18 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/13764
Author: @jmorganca
Created: 1/17/2026
Status: Merged
Merged: 1/18/2026
Merged by: @jmorganca

Base: mainHead: fix-nemotron-parser


📝 Commits (1)

  • bb9c1b2 parsers: refactor Nemotron parser to reuse Qwen3Coder for tool calls

📊 Changes

3 files changed (+163 additions, -446 deletions)

View changed files

📝 model/parsers/nemotron3nano.go (+66 -196)
📝 model/parsers/nemotron3nano_test.go (+66 -250)
📝 model/parsers/qwen3coder_test.go (+31 -0)

📄 Description

Simplify Nemotron3NanoParser by delegating tool call parsing to Qwen3CoderParser (which is more sophisticated) instead of duplicating the parsing logic. The Nemotron parser now only handles the thinking state machine and transitions to Qwen3CoderParser for content and tool call parsing.

This also fixes an issue where tool calls without would cause the parser to get stuck in thinking mode.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/13764 **Author:** [@jmorganca](https://github.com/jmorganca) **Created:** 1/17/2026 **Status:** ✅ Merged **Merged:** 1/18/2026 **Merged by:** [@jmorganca](https://github.com/jmorganca) **Base:** `main` ← **Head:** `fix-nemotron-parser` --- ### 📝 Commits (1) - [`bb9c1b2`](https://github.com/ollama/ollama/commit/bb9c1b2561acad1a3a3940f11eab0c5f2fff8055) parsers: refactor Nemotron parser to reuse Qwen3Coder for tool calls ### 📊 Changes **3 files changed** (+163 additions, -446 deletions) <details> <summary>View changed files</summary> 📝 `model/parsers/nemotron3nano.go` (+66 -196) 📝 `model/parsers/nemotron3nano_test.go` (+66 -250) 📝 `model/parsers/qwen3coder_test.go` (+31 -0) </details> ### 📄 Description Simplify Nemotron3NanoParser by delegating tool call parsing to Qwen3CoderParser (which is more sophisticated) instead of duplicating the parsing logic. The Nemotron parser now only handles the thinking state machine and transitions to Qwen3CoderParser for content and tool call parsing. This also fixes an issue where tool calls without </think> would cause the parser to get stuck in thinking mode. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-13 00:52:18 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#14378