mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-16 06:03:26 -05:00
[GH-ISSUE #24462] feat: Dynamic Variable for User Groups #107302
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @taylorwilsdon on GitHub (May 8, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/24462
Check Existing Issues
Verify Feature Scope
Problem Description
We currently have dynamic Jinja2-style variables like {{USER_NAME}} and {{CURRENT_DATE}} so the system prompt adapts to each user and session automatically, which can be very useful. However, we don't have a {{USER_GROUPS}} option, which would make a model or session aware of things a user might have access to or inherent knowledge about their role in an organization. I'd like to have that.
Desired Solution you'd like
Create a new dynamic variable {{USER_GROUPS}} that expands to a comma separated list of Open-WebUI groups they're listed in.
Alternatives Considered
No response
Additional Context
I will happily build if you are game to merge @tjbck / @Classic298
@owui-terminator[bot] commented on GitHub (May 8, 2026):
🔍 Related Issues Found
I found some existing issues that might be related. Please check if any of these are duplicates or contain helpful solutions:
🟣 #15589 feat: user prompt variables
This is the core precursor feature for dynamic user prompt variables, which introduced the same Jinja2-style variable mechanism that {{USER_GROUPS}} would extend. It is the closest direct match to a request for adding a new user-specific prompt variable.
by tjbck
🟣 #16990 feat: Group level system prompts
This request is about applying system prompts at the group level, so it is conceptually related to making prompts aware of a user's group membership. While it does not ask for a variable, it targets the same group-aware prompt customization area.
by Phizicks
🟣 #22527 bug: Group membership is not updated for admin users
This bug concerns how group membership is synced and represented in Open WebUI. Since {{USER_GROUPS}} would depend on accurate group membership data, this issue is relevant to the underlying group-membership functionality.
by tomekpz ·
bug🟣 #24401 issue: KV cache invalidation with dynamic variables in system prompt
This issue is about dynamic variables in system prompts and how they are recalculated. It is relevant because {{USER_GROUPS}} would use the same dynamic-variable system and could be subject to the same prompt-processing behavior.
by FrederikDeVree ·
bug💡 If your issue is a duplicate, please close it and add any additional details to the existing issue instead.
This comment was generated automatically. React with 👍 if helpful, 👎 if not.
@tjbck commented on GitHub (May 8, 2026):
Added as a backend only prompt variable in dev!
@taylorwilsdon commented on GitHub (May 8, 2026):
Hell yeah, amazing thanks!