Feature/add user parameter support to LiteLLM node#6121
Open
jwp83 wants to merge 3 commits intoFlowiseAI:mainfrom
Open
Feature/add user parameter support to LiteLLM node#6121jwp83 wants to merge 3 commits intoFlowiseAI:mainfrom
jwp83 wants to merge 3 commits intoFlowiseAI:mainfrom
Conversation
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 code
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
Contributor
There was a problem hiding this comment.
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 |
Contributor
There was a problem hiding this comment.
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds the ability to pass the
userparameter 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
userinput field to the node's UI configuration (under additional parameters).uservalue fromnodeDatato theOpenAIChatInputobject to ensure the user identifier is correctly included in the API request payload.