mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-07 11:28:35 -05:00
[PR #14427] [CLOSED] wip: Optimize get_all_models #39098
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/14427
Author: @torisetxd
Created: 5/27/2025
Status: ❌ Closed
Base:
dev← Head:optimize-model-fetching-v2📝 Commits (1)
dd70595Add function to retrieve functions by IDs and optimize model fetching logic📊 Changes
2 files changed (+131 additions, -125 deletions)
View changed files
📝
backend/open_webui/models/functions.py(+11 -0)📝
backend/open_webui/utils/models.py(+120 -125)📄 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
get_all_models()function to reduce run time from 1.5~ seconds to 0.54~ seconds (in my environment) for about a 60%~ speed improvement.get_all_base_modelsmethod.Added
Functions.get_functions_by_ids()to batch multiple function lookups by idChanged
Functions.get_functions_by_ids()extend()method for better memory efficiencyDeprecated
Removed
Breaking Changes
Additional Information
This code likely works though I haven't thoroughly tested it.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.