Skip to content

[None][feat] add Poolside Laguna tool parser#14638

Merged
DomBrown merged 2 commits into
NVIDIA:mainfrom
DomBrown:dev/laguna-tool-use
May 29, 2026
Merged

[None][feat] add Poolside Laguna tool parser#14638
DomBrown merged 2 commits into
NVIDIA:mainfrom
DomBrown:dev/laguna-tool-use

Conversation

@DomBrown

@DomBrown DomBrown commented May 27, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • New Features

    • Added support for Poolside Laguna v1 tool-calling format, enabling parsing and execution of tool calls with both streaming and complete text processing.
  • Tests

    • Added comprehensive test coverage for the new tool parser, including streaming scenarios, error handling, and argument extraction validation.

Review Change Stack

Description

Adds poolside_v1 tool-call parsing for Laguna, wires model_type: laguna auto-detection, and covers parsing, streaming, type coercion, and factory behavior with tests.

Test Coverage

Relevant tests added to test_tool_parsers.py

PR Checklist

Please review the following before submitting your PR:

  • PR description clearly explains what and why. If using CodeRabbit's summary, please make sure it makes sense.

  • PR Follows TRT-LLM CODING GUIDELINES to the best of your knowledge.

  • Test cases are provided for new code paths (see test instructions)

  • If PR introduces API changes, an appropriate PR label is added - either api-compatible or api-breaking. For api-breaking, include BREAKING in the PR title.

  • Any new dependencies have been scanned for license and vulnerabilities

  • CODEOWNERS updated if ownership changes

  • Documentation updated as needed

  • Update tava architecture diagram if there is a significant design change in PR.

  • The reviewers assigned automatically/manually are appropriate for the PR.

  • Please check this after reviewing the above items as appropriate for this PR.

GitHub Bot Help

To see a list of available CI bot commands, please comment /bot help.

@DomBrown
DomBrown requested a review from a team as a code owner May 27, 2026 17:29
@DomBrown
DomBrown requested a review from JunyiXu-nv May 27, 2026 17:29
@coderabbitai

coderabbitai Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

This PR introduces Poolside V1 tool parser support for TensorRT-LLM. A new PoolsideV1ToolParser class parses tool-call blocks delimited by <tool_call>...</tool_call> with arguments in <arg_key>...</arg_key> and <arg_value>...</arg_value> pairs. The parser integrates with the existing tool parser factory, adds model type mapping for Laguna models, and updates the serve command to dynamically list supported models.

Changes

Poolside V1 Tool Parser

Layer / File(s) Summary
PoolsideV1ToolParser implementation
tensorrt_llm/serve/tool_parser/poolside_v1_parser.py
Introduces PoolsideV1ToolParser with complete and streaming parsing modes. Handles <tool_call>...<arg_key>key</arg_key><arg_value>value</arg_value>...</tool_call> syntax, extracts typed arguments via regex and JSON-schema coercion, detects complete blocks without premature termination on </tool_call> inside values, and emits tool-call deltas with streaming buffers.
Factory registration and model type mapping
tensorrt_llm/serve/tool_parser/tool_parser_factory.py
Imports PoolsideV1ToolParser, adds "laguna": "poolside_v1" mapping to MODEL_TYPE_TO_TOOL_PARSER so auto-detection resolves Laguna models, and registers "poolside_v1" in ToolParserFactory.parsers for factory instantiation.
Serve command-line tool updates
tensorrt_llm/commands/serve.py
Imports MODEL_TYPE_TO_TOOL_PARSER and replaces hardcoded supported model types list with a dynamically generated list from factory keys in the --tool_parser auto error message.
Test coverage for parser and factory
tests/unittest/llmapi/apps/test_tool_parsers.py
Adds TestPoolsideV1ToolParser with assertions for detection, parsing, streaming edge cases (split tags, truncated buffers, end-tags in values), schema-aware type coercion, and zero-arg calls. Adds TestPoolsideV1ToolParserFactory validating factory wiring, parser instantiation, model type mapping, and auto-resolution of Laguna models from config.json.

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 41.94% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: adding a Poolside Laguna tool parser, which aligns with the primary functionality introduced across the changeset.
Description check ✅ Passed The description concisely explains what is added (poolside_v1 tool-call parsing, auto-detection, type coercion) and identifies test coverage location, following the template structure adequately.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
tests/unittest/llmapi/apps/test_tool_parsers.py (1)

2332-2629: QA list update is unnecessary for this unittest-only scope.

No tests/integration/test_lists/qa/* update is needed for these parser unit tests under tests/unittest.

As per coding guidelines, unit-only changes like these should not be added to QA integration test lists.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/unittest/llmapi/apps/test_tool_parsers.py` around lines 2332 - 2629,
The PR accidentally included QA integration-list updates for integration tests
that aren't needed for these unit-only changes; revert or remove any
modifications to tests/integration/test_lists/qa/* so only unit test files
(e.g., TestPoolsideV1ToolParser and TestPoolsideV1ToolParserFactory in
tests/unittest/llmapi/apps/test_tool_parsers.py) remain changed, ensure the
commit/patch does not touch integration QA lists, and re-run the unit tests to
validate.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@tests/unittest/llmapi/apps/test_tool_parsers.py`:
- Around line 2332-2629: The PR accidentally included QA integration-list
updates for integration tests that aren't needed for these unit-only changes;
revert or remove any modifications to tests/integration/test_lists/qa/* so only
unit test files (e.g., TestPoolsideV1ToolParser and
TestPoolsideV1ToolParserFactory in
tests/unittest/llmapi/apps/test_tool_parsers.py) remain changed, ensure the
commit/patch does not touch integration QA lists, and re-run the unit tests to
validate.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: bc2af57b-1eb8-410e-b3f1-a2eecf66640d

📥 Commits

Reviewing files that changed from the base of the PR and between af74e00 and 009cbb2.

📒 Files selected for processing (4)
  • tensorrt_llm/commands/serve.py
  • tensorrt_llm/serve/tool_parser/poolside_v1_parser.py
  • tensorrt_llm/serve/tool_parser/tool_parser_factory.py
  • tests/unittest/llmapi/apps/test_tool_parsers.py

@DomBrown

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #50588 [ run ] triggered by Bot. Commit: 009cbb2 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #50588 [ run ] completed with state FAILURE. Commit: 009cbb2
/LLM/main/L0_MergeRequest_PR pipeline #40087 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

@DomBrown

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #50605 [ run ] triggered by Bot. Commit: 009cbb2 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #50605 [ run ] completed with state FAILURE. Commit: 009cbb2
/LLM/main/L0_MergeRequest_PR pipeline #40100 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

Link to invocation

DomBrown added 2 commits May 27, 2026 22:52
Signed-off-by: Dom Brown <3886319+DomBrown@users.noreply.github.com>
Signed-off-by: Dom Brown <3886319+DomBrown@users.noreply.github.com>
@DomBrown
DomBrown force-pushed the dev/laguna-tool-use branch from 009cbb2 to 64c89a6 Compare May 27, 2026 21:52
@DomBrown

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #50621 [ run ] triggered by Bot. Commit: 64c89a6 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #50621 [ run ] completed with state SUCCESS. Commit: 64c89a6
/LLM/main/L0_MergeRequest_PR pipeline #40114 completed with status: 'SUCCESS'
Pipeline passed with automatic retried tests. Check the rerun report for details.

CI Report

Link to invocation

@Superjomn Superjomn left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@DomBrown
DomBrown merged commit c7683f2 into NVIDIA:main May 29, 2026
7 checks passed
@DomBrown
DomBrown deleted the dev/laguna-tool-use branch May 29, 2026 12:52
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.

3 participants