mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-08 21:09:41 -05:00
[PR #11150] [CLOSED] feat(credit): add user credit model and credit calculator #61524
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?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/11150
Author: @OrenZhang
Created: 3/4/2025
Status: ❌ Closed
Base:
dev← Head:feat_usage📝 Commits (10+)
522c522feat(credit): add user credit model and credit calculator0013da8refactor(models): revert code lint770ae8frefactor(models): revert code lintd5ea32brefactor(middlewares): revert code linta2babbdrefactor(middlewares): revert code lint9db440crefactor(main): revert code lint15618f2refactor(migration): merge migrationsecf4cearefactor(migration): merge migrationsc967625refactor(credit): credit deduct should apply before filter63efe87refactor(credit): change description📊 Changes
67 files changed (+1075 additions, -65 deletions)
View changed files
📝
backend/open_webui/config.py(+26 -1)📝
backend/open_webui/main.py(+13 -1)➕
backend/open_webui/migrations/versions/a959f8a63245_add_credits.py(+58 -0)➕
backend/open_webui/models/credits.py(+166 -0)📝
backend/open_webui/models/models.py(+15 -4)📝
backend/open_webui/models/users.py(+7 -1)📝
backend/open_webui/routers/openai.py(+26 -2)📝
backend/open_webui/routers/tasks.py(+24 -0)📝
backend/open_webui/routers/users.py(+80 -3)📝
backend/open_webui/utils/auth.py(+86 -37)➕
backend/open_webui/utils/usage.py(+216 -0)📝
src/lib/apis/users/index.ts(+3 -1)📝
src/lib/components/admin/Users/UserList.svelte(+26 -0)📝
src/lib/components/admin/Users/UserList/EditUserModal.svelte(+16 -1)📝
src/lib/components/workspace/Models/ModelEditor.svelte(+39 -0)📝
src/lib/i18n/locales/ar-BH/translation.json(+5 -0)📝
src/lib/i18n/locales/ar/translation.json(+5 -0)📝
src/lib/i18n/locales/bg-BG/translation.json(+5 -0)📝
src/lib/i18n/locales/bn-BD/translation.json(+5 -0)📝
src/lib/i18n/locales/bo-TB/translation.json(+5 -0)...and 47 more files
📄 Description
close #6692
Added
Additional Information
I've tested this feature with both the API and WebUI, and it's functioning properly.
Please provide me with some suggestions on whether this implementation is feasible or acceptable, so I can adjust my development direction accordingly.
Screenshots
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.