adding support for .svg files in UI logo UI_LOGO param override for admin panel #17898
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Title
Add /ui Logo .svg file support
Relevant issues
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
tests/litellm/directory, Adding at least 1 test is a hard requirement - see detailsmake test-unitType
🧹 Refactoring
✅ Test
Changes
What this PR changes (SVG logo support)
Adds SVG/SVGZ MIME handling helpers
New litellm/proxy/common_utils/logo_utils.py provides:
infer_logo_content_type() to detect image/svg+xml for .svg / .svgz (and mark .svgz as gzip-encoded).
normalize_logo_content_type() to normalize headers like image/svg → image/svg+xml (and image/jpg → image/jpeg).
cache_extension_for_logo() to choose the right cache filename extension (.svg, .svgz, or a best-effort extension for other image types).
Fixes /get_image to return correct Content-Type for SVG
In litellm/proxy/proxy_server.py, /get_image now:
Returns media_type="image/svg+xml" for local UI_LOGO_PATH pointing to .svg/.svgz instead of always image/jpeg.
For remote logos (HTTP/HTTPS), reads Content-Type from the response when present, otherwise infers it from the URL path.
Caches remote logos using the correct extension (cached_logo.svg / cached_logo.svgz), rather than always writing cached_logo.jpg.
Preserves Content-Encoding: gzip when serving .svgz (so browsers can decode it correctly).
Adds tests for the new behavior
In tests/test_litellm/proxy/test_proxy_server.py, adds mocked tests that verify:
Local Unit Test Passing:
Full file run:
Specific unit test added passing:
Evidence of the Update:
Before SVG ui Handling (overriding UI_LOGO param with a link to a local .svg):

After Svg Handling: (the purple circular "LLM" image).

A NOTE TO REVIEWER:
Locally, linting failed with
I also witnessed this happen in your automation pipeline, as well as running linting in a direct clone from main. I do not believe this failure is related to my change, but, rather, something else in the codebase.
also, locally running format updated around 673 files. I did not change those 673 files. i witnessed the same behavior when comparing in main. running make format in main resulted in the same (673) files reformatted. Again, i dont believe this is related to my change.
Additionally, i am noticing the custom prompt management unit tests are failing.
Primary commit to review:
8bbe112