Skip to content

Feature/add user parameter support to LiteLLM node#6121

Open
jwp83 wants to merge 3 commits intoFlowiseAI:mainfrom
jwp83:feature/add-litellm-user-param
Open

Feature/add user parameter support to LiteLLM node#6121
jwp83 wants to merge 3 commits intoFlowiseAI:mainfrom
jwp83:feature/add-litellm-user-param

Conversation

@jwp83
Copy link
Copy Markdown

@jwp83 jwp83 commented Apr 2, 2026

Description

This PR adds the ability to pass the user parameter when using the LiteLLM chat model node. This is useful for tracking specific user interactions, logging, or applying user-level rate limits on the LiteLLM server side.

Changes

  • Added a user input field to the node's UI configuration (under additional parameters).
  • Mapped the user value from nodeData to the OpenAIChatInput object to ensure the user identifier is correctly included in the API request payload.

jwp83 added 3 commits April 2, 2026 14:39
feat: add user parameter support to LiteLLM node

- Add 'user' input field to node UI configuration
- Map 'user' from nodeData to OpenAIChatInput object to ensure the user identifier is included in the API request payload
test: add unit tests for LiteLLM node

- Add ChatLitellm.test.ts to verify node initialization and parameter mapping
- Ensure the newly added 'user' parameter is correctly mapped to the API payload
- Verify custom configurations like basePath and modelName
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new user parameter to the ChatLitellm node, enabling end-user identification for monitoring and abuse detection. It also adds a comprehensive test suite in ChatLitellm.test.ts to verify property initialization and parameter mapping. The review feedback suggests improving the user experience by adding a description and a more standard placeholder to the new input field.

Comment on lines +105 to +110
label: 'User',
name: 'user',
type: 'string',
placeholder: 'user id',
optional: true,
additionalParams: true
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.

medium

Adding a description for the user parameter is recommended to clarify its purpose for end-users (e.g., for tracking or rate-limiting). Also, using a more descriptive placeholder like 'user-1234' is consistent with other LLM nodes in the repository.

                label: 'User',
                name: 'user',
                type: 'string',
                description: 'A unique identifier representing your end-user, which can help LiteLLM to monitor and detect abuse.',
                placeholder: 'user-1234',
                optional: true,
                additionalParams: true

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