This is the first part of implementing #17429.
The rest is available here: #17431, #17433, #17436
Pull Request Checklist
Note to first-time contributors: Please open a discussion post in Discussions and describe your changes before submitting a pull request.
Before submitting, make sure you've checked the following:
Target branch: Please verify that the pull request targets the dev branch.
Description: Provide a concise description of the changes made in this pull request.
Changelog: Ensure a changelog entry following the format of Keep a Changelog is added at the bottom of the PR description.
Documentation: Have you updated relevant documentation Open WebUI Docs, or other documentation sources?
Dependencies: Are there any new dependencies? Have you updated the dependency versions in the documentation?
Testing: Have you written and run sufficient tests to validate the changes?
Code review: Have you performed a self-review of your code, addressing any coding standard issues and ensuring adherence to the project's coding standards?
Prefix: To clearly categorize this pull request, prefix the pull request title using one of the following:
BREAKING CHANGE: Significant changes that may affect compatibility
build: Changes that affect the build system or external dependencies
ci: Changes to our continuous integration processes or workflows
chore: Refactor, cleanup, or other non-functional code changes
docs: Documentation update or addition
feat: Introduces a new feature or enhancement to the codebase
fix: Bug fix or error correction
i18n: Internationalization or localization changes
perf: Performance improvement
refactor: Code restructuring for better maintainability, readability, or scalability
style: Changes that do not affect the meaning of the code (white space, formatting, missing semi-colons, etc.)
test: Adding missing tests or correcting existing tests
WIP: Work in progress, a temporary label for incomplete or ongoing work
Changelog Entry
Description
Move the existing ~3k-line config.py file into a new config/ package structure without breaking any existing functionality. This is part 1 of 4 in a staged refactor to modularize the config.py file for better maintainability and organization. All existing imports continue to work unchanged through re-exports in the new package structure.
Added
New backend/open_webui/config/ package directory structure
backend/open_webui/config/__init__.py with complete re-exports for backward compatibility
backend/open_webui/config/legacy.py containing the original config.py content
Changed
Moved existing config.py content to config/legacy.py within the new package structure
All imports now go through the config package instead of the config module
Package structure allows for future modularization while maintaining compatibility
Deprecated
None
Removed
Original backend/open_webui/config.py file (functionality preserved through package re-exports)
Fixed
None
Security
None
Breaking Changes
No breaking changes - All existing from open_webui.config import X imports continue to work unchanged
Additional Information
This is part 1 of 4 in a comprehensive config.py refactoring series to improve code organization and maintainability
The refactoring maintains 100% backward compatibility - no existing code needs to be updated
See discussion: #17429 for the complete refactoring plan
Future PRs in this series will gradually extract components from legacy.py into logical modules
This foundational change enables the package structure needed for the subsequent modularization steps
Screenshots or Videos
[Attach any relevant screenshots or videos demonstrating the changes]
Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
## 📋 Pull Request Information
**Original PR:** https://github.com/open-webui/open-webui/pull/17430
**Author:** [@luxass](https://github.com/luxass)
**Created:** 9/14/2025
**Status:** ❌ Closed
**Base:** `dev` ← **Head:** `refactor/move-to-config-module`
---
### 📝 Commits (5)
- [`5ee3521`](https://github.com/open-webui/open-webui/commit/5ee3521647152a91e29b4bd4c81bed221af29dea) refactor: move config.py into config/ package structure
- [`5efefcb`](https://github.com/open-webui/open-webui/commit/5efefcbad6452fa2d7e4cf44d61cd2ac25cbc3fc) Merge branch 'dev' into refactor/move-to-config-module
- [`8b67a4a`](https://github.com/open-webui/open-webui/commit/8b67a4aad31736e028ce4344c183c777c4d5a736) Merge branch 'dev' into refactor/move-to-config-module
- [`5d1ae32`](https://github.com/open-webui/open-webui/commit/5d1ae32ed9ac7bef76ca3d70c128f74ae3add1c1) chore: format
- [`44a40c9`](https://github.com/open-webui/open-webui/commit/44a40c9fee5017dc6c85c47dfb2281f0a0d53b62) Merge branch 'dev' into refactor/move-to-config-module
### 📊 Changes
**3 files changed** (+7 additions, -1 deletions)
<details>
<summary>View changed files</summary>
➕ `backend/open_webui/config/__init__.py` (+1 -0)
📝 `backend/open_webui/config/legacy.py` (+1 -0)
📝 `backend/open_webui/utils/oauth.py` (+5 -1)
</details>
### 📄 Description
> [!IMPORTANT]
> This is the first part of implementing #17429.
> The rest is available here: #17431, #17433, #17436
# Pull Request Checklist
### Note to first-time contributors: Please open a discussion post in [Discussions](https://github.com/open-webui/open-webui/discussions) and describe your changes before submitting a pull request.
**Before submitting, make sure you've checked the following:**
- [x] **Target branch:** Please verify that the pull request targets the `dev` branch.
- [x] **Description:** Provide a concise description of the changes made in this pull request.
- [x] **Changelog:** Ensure a changelog entry following the format of [Keep a Changelog](https://keepachangelog.com/) is added at the bottom of the PR description.
- [x] **Documentation:** Have you updated relevant documentation [Open WebUI Docs](https://github.com/open-webui/docs), or other documentation sources?
- [x] **Dependencies:** Are there any new dependencies? Have you updated the dependency versions in the documentation?
- [x] **Testing:** Have you written and run sufficient tests to validate the changes?
- [x] **Code review:** Have you performed a self-review of your code, addressing any coding standard issues and ensuring adherence to the project's coding standards?
- [x] **Prefix:** To clearly categorize this pull request, prefix the pull request title using one of the following:
- **BREAKING CHANGE**: Significant changes that may affect compatibility
- **build**: Changes that affect the build system or external dependencies
- **ci**: Changes to our continuous integration processes or workflows
- **chore**: Refactor, cleanup, or other non-functional code changes
- **docs**: Documentation update or addition
- **feat**: Introduces a new feature or enhancement to the codebase
- **fix**: Bug fix or error correction
- **i18n**: Internationalization or localization changes
- **perf**: Performance improvement
- **refactor**: Code restructuring for better maintainability, readability, or scalability
- **style**: Changes that do not affect the meaning of the code (white space, formatting, missing semi-colons, etc.)
- **test**: Adding missing tests or correcting existing tests
- **WIP**: Work in progress, a temporary label for incomplete or ongoing work
# Changelog Entry
### Description
Move the existing ~3k-line `config.py` file into a new `config/` package structure without breaking any existing functionality. This is part 1 of 4 in a staged refactor to modularize the config.py file for better maintainability and organization. All existing imports continue to work unchanged through re-exports in the new package structure.
### Added
- New `backend/open_webui/config/` package directory structure
- `backend/open_webui/config/__init__.py` with complete re-exports for backward compatibility
- `backend/open_webui/config/legacy.py` containing the original config.py content
### Changed
- Moved existing `config.py` content to `config/legacy.py` within the new package structure
- All imports now go through the config package instead of the config module
- Package structure allows for future modularization while maintaining compatibility
### Deprecated
- None
### Removed
- Original `backend/open_webui/config.py` file (functionality preserved through package re-exports)
### Fixed
- None
### Security
- None
### Breaking Changes
- **No breaking changes** - All existing `from open_webui.config import X` imports continue to work unchanged
---
### Additional Information
- This is **part 1 of 4** in a comprehensive config.py refactoring series to improve code organization and maintainability
- The refactoring maintains 100% backward compatibility - no existing code needs to be updated
- See discussion: [#17429](https://github.com/open-webui/open-webui/discussions/17429) for the complete refactoring plan
- Future PRs in this series will gradually extract components from `legacy.py` into logical modules
- This foundational change enables the package structure needed for the subsequent modularization steps
### Screenshots or Videos
- [Attach any relevant screenshots or videos demonstrating the changes]
### Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the [Contributor License Agreement (CLA)](https://github.com/open-webui/open-webui/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT), and I am providing my contributions under its terms.
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/17430
Author: @luxass
Created: 9/14/2025
Status: ❌ Closed
Base:
dev← Head:refactor/move-to-config-module📝 Commits (5)
5ee3521refactor: move config.py into config/ package structure5efefcbMerge branch 'dev' into refactor/move-to-config-module8b67a4aMerge branch 'dev' into refactor/move-to-config-module5d1ae32chore: format44a40c9Merge branch 'dev' into refactor/move-to-config-module📊 Changes
3 files changed (+7 additions, -1 deletions)
View changed files
➕
backend/open_webui/config/__init__.py(+1 -0)📝
backend/open_webui/config/legacy.py(+1 -0)📝
backend/open_webui/utils/oauth.py(+5 -1)📄 Description
Pull Request Checklist
Note to first-time contributors: Please open a discussion post in Discussions and describe your changes before submitting a pull request.
Before submitting, make sure you've checked the following:
devbranch.Changelog Entry
Description
Move the existing ~3k-line
config.pyfile into a newconfig/package structure without breaking any existing functionality. This is part 1 of 4 in a staged refactor to modularize the config.py file for better maintainability and organization. All existing imports continue to work unchanged through re-exports in the new package structure.Added
backend/open_webui/config/package directory structurebackend/open_webui/config/__init__.pywith complete re-exports for backward compatibilitybackend/open_webui/config/legacy.pycontaining the original config.py contentChanged
config.pycontent toconfig/legacy.pywithin the new package structureDeprecated
Removed
backend/open_webui/config.pyfile (functionality preserved through package re-exports)Fixed
Security
Breaking Changes
from open_webui.config import Ximports continue to work unchangedAdditional Information
legacy.pyinto logical modulesScreenshots or Videos
Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.