Skip to content

Comments

docs: Add comprehensive image storage analysis#110

Merged
Classic298 merged 3 commits intoperf-models-apifrom
claude/optimize-models-api-WVojf
Dec 17, 2025
Merged

docs: Add comprehensive image storage analysis#110
Classic298 merged 3 commits intoperf-models-apifrom
claude/optimize-models-api-WVojf

Conversation

@Classic298
Copy link
Owner

No description provided.

- Analyze current implementation of ENABLE_CHAT_RESPONSE_BASE64_IMAGE_URL_CONVERSION
- Document how response images are converted from base64 to file URLs
- Identify missing implementation for user input images
- Explain access control for image files
- Provide solution approach for converting user input images
- Document expected performance improvements

Related to GitHub discussion open-webui#13122
Replace sequential database queries with batch loading in get_filtered_models()
functions across utils/models.py, routers/openai.py, and routers/ollama.py.

Changes:
- Add ModelAccessControl response model for lightweight access control data
- Add get_models_access_control_by_ids() method to fetch multiple models in
  a single query, excluding heavy meta field containing base64 images
- Update three get_filtered_models() implementations to use batch loading
  instead of calling get_model_by_id() in a loop

Performance Impact:
- Reduces database queries from N to 1 (where N = number of models)
- Excludes meta field with base64 profile images from access control checks
- Significantly improves /api/models endpoint response time

Fixes: open-webui#20004, open-webui#18950
@Classic298 Classic298 merged commit 11c7835 into perf-models-api Dec 17, 2025
@Classic298 Classic298 deleted the claude/optimize-models-api-WVojf branch December 17, 2025 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants