Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@daniel-lxs
Copy link
Member

@daniel-lxs daniel-lxs commented Dec 1, 2025

Summary

Adds native tool calling support for the LiteLLM provider, allowing it to use OpenAI-style tool calls when the user explicitly selects native protocol.

Changes

packages/types/src/providers/lite-llm.ts

  • Added supportsNativeTools: true to the default model info

src/api/providers/fetchers/litellm.ts

  • Extract supportsNativeTools from LiteLLM API response by checking:
    • supports_function_calling
    • supports_tool_choice
    • supports_tool_use

src/api/providers/lite-llm.ts

  • Check if model supports native tools and tools are provided with native protocol
  • Add tools, tool_choice, and parallel_tool_calls to API request when native protocol is used
  • Handle tool_call_partial chunks in streaming response for NativeToolCallParser

src/api/providers/fetchers/__tests__/litellm.spec.ts

  • Updated test expectations to include the new supportsNativeTools field

Notes

  • Default behavior is unchanged: XML protocol remains the default
  • Native tools only activate when the user explicitly sets toolProtocol: "native" in their profile settings
  • Follows the same pattern used by DeepInfra, XAI, Unbound, and other providers

Important

Adds native tool support for LiteLLM provider, enabling OpenAI-style tool calls with native protocol selection.

  • Behavior:
    • Adds native tool support for LiteLLM provider, enabling OpenAI-style tool calls when toolProtocol: "native" is set.
    • Default behavior remains unchanged; XML protocol is still the default.
  • Model Info:
    • Adds supportsNativeTools: true to litellmDefaultModelInfo in lite-llm.ts.
  • API Handling:
    • In fetchers/litellm.ts, extracts supportsNativeTools from API response based on supports_function_calling, supports_tool_choice, and supports_tool_use.
    • In lite-llm.ts, checks for native tool support and modifies API requests to include tools, tool_choice, and parallel_tool_calls when native protocol is used.
    • Handles tool_call_partial chunks in streaming responses for NativeToolCallParser.
  • Testing:
    • Updates test expectations in fetchers/__tests__/litellm.spec.ts to include supportsNativeTools.

This description was created by Ellipsis for 17e0e57. You can customize this summary. It will automatically update as commits are pushed.

- Add supportsNativeTools to litellmDefaultModelInfo
- Extract supportsNativeTools from LiteLLM API response (supports_function_calling, supports_tool_choice, supports_tool_use)
- Update LiteLLMHandler to include tools in request when native protocol is selected
- Handle tool_call_partial chunks in streaming response
- Update tests to include supportsNativeTools field
@daniel-lxs daniel-lxs requested review from cte, jr and mrubens as code owners December 1, 2025 21:17
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. Enhancement New feature or request labels Dec 1, 2025
@roomote
Copy link
Contributor

roomote bot commented Dec 1, 2025

Rooviewer Clock   See task on Roo Cloud

Review completed. All previously flagged issues have been resolved.

  • Fix native tools activation condition to require explicit toolProtocol === "native" instead of !== "xml"
Previous reviews

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Dec 1, 2025
…tion

Address review feedback: change condition from !== XML to === NATIVE
to require explicit opt-in for native tool protocol
@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Dec 1, 2025
@mrubens mrubens merged commit ad28e12 into main Dec 1, 2025
17 of 20 checks passed
@mrubens mrubens deleted the feat/litellm-native-tools branch December 1, 2025 21:35
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Dec 1, 2025
@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Dec 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement New feature or request Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. lgtm This PR has been approved by a maintainer size:M This PR changes 30-99 lines, ignoring generated files.

Projects

No open projects
Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants