Skip to content

fix(multimodal): enforce media download limits - #15005

Merged
rmccorm4 merged 6 commits into
ai-dynamo:mainfrom
host452b:fix/15004-media-download-limit
Sep 22, 2026
Merged

rmccorm4 merged 6 commits into
ai-dynamo:mainfrom
host452b:fix/15004-media-download-limit

Conversation

@host452b

@host452b host452b commented Sep 17, 2026 •

Copy link
Copy Markdown

Summary

  • apply DYN_MM_MAX_FILE_SIZE_MB to remote image, audio, and video loader downloads
  • cap direct SGLang and TensorRT-LLM remote-video downloads
  • enforce the same cap in SGLang when NVDEC is disabled, unavailable, or model-gated
  • preserve TensorRT-LLM --max-file-size-mb by passing its configured byte limit to ImageLoader
  • resolve generic environment overrides at call time and document the setting
  • add focused regression coverage for shared loaders and backend adapters

Closes #15004

Validation

  • 106 passed across image/audio/video loader tests and related HTTP/media-reference tests
  • isolated execution of the actual SGLang _build_encode_inputs method: remote capped fetch, data: passthrough, non-video passthrough, and missing-decoder fail-fast all passed
  • Python syntax compilation for all modified source and test modules
  • pre-commit run --files for all modified files
  • python3 docs/fern/scripts/docs_lint.py --scan docs (0 errors)
  • TDD verification: the explicit ImageLoader override test and non-NVDEC SGLang capped-fetch reproduction both failed before their implementations, then passed after the fixes

Compatibility

Remote media larger than the default 64 MiB generic limit is now rejected consistently, including SGLang software-decoder deployments. Deployments that intentionally accept larger media can raise DYN_MM_MAX_FILE_SIZE_MB. TensorRT-LLM continues to use its existing --max-file-size-mb / DYN_TRTLLM_MAX_FILE_SIZE_MB setting instead.

Signed-off-by: host452b <32806348+host452b@users.noreply.github.com>
@host452b
host452b requested review from a team as code owners September 17, 2026 14:47
@copy-pr-bot

copy-pr-bot Bot commented Sep 17, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@host452b
host452b deployed to external_collaborator September 17, 2026 14:47 — with GitHub Actions Active
@host452b
host452b deployed to external_collaborator September 17, 2026 14:47 — with GitHub Actions Active
@github-actions

github-actions Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot added fix external-contribution Pull request is from an external contributor multimodal labels Sep 17, 2026
@coderabbitai

coderabbitai Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: aebb1225-ae19-4f79-b3a8-fa8e3ca95043

📥 Commits

Reviewing files that changed from the base of the PR and between 7831037 and 6deddef.

📒 Files selected for processing (6)
  • components/src/dynamo/common/multimodal/audio_loader.py
  • components/src/dynamo/common/multimodal/image_loader.py
  • components/src/dynamo/common/multimodal/video_loader.py
  • components/src/dynamo/common/tests/multimodal/test_audio_loader.py
  • components/src/dynamo/common/tests/multimodal/test_image_loader.py
  • components/src/dynamo/common/tests/multimodal/test_video_loader.py

Included review availability: Your plan provides up to 12 included reviews per hour; 11 remain after this review.


Walkthrough

The multimodal audio, image, and video loaders now pass max_media_bytes() to HTTP fetches. Tests verify that a configured 1 MB limit reaches fetch_bytes as 1024 * 1024.

Changes

Multimodal media-size enforcement

Layer / File(s) Summary
Apply media-size limits to HTTP loaders
components/src/dynamo/common/multimodal/*_loader.py
The audio, image, and video HTTP paths pass max_media_bytes() to fetch_bytes. Existing timeout and URL-policy handling remains unchanged.
Validate propagated byte limits
components/src/dynamo/common/tests/multimodal/test_*_loader.py
Tests verify propagation of a configured 1 MB limit. The image fetch mock accepts the new max_bytes argument.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 6dedd

The requested media-size propagation is covered across all three loaders, and no actionable issue remains.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 26.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 15 functions across 6 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Issue #15004 requires image, audio, and video remote loaders to apply DYN_MM_MAX_FILE_SIZE_MB, defaulting to 64 MiB, and forward the resolved byte limit to fetch_bytes. The PR passes max_media_bytes()…
Out of Scope Changes check ✅ Passed The changed source files implement the requirement in issue #15004. The changed test files provide regression coverage for the three affected loader paths. No unrelated changes are identified in the P…
Title check ✅ Passed The title clearly and concisely summarizes the main change: enforcing media download limits for multimodal loaders.
Description check ✅ Passed The description explains the implementation, validation, compatibility impact, and linked issue. It is mostly complete, although it does not include the template's explicit "Where should the reviewer …
  • Fix all pre-merge checks with AI

Comment @coderabbitai help to get the list of available commands.

Comment thread components/src/dynamo/common/multimodal/video_loader.py
Comment thread components/src/dynamo/common/multimodal/image_loader.py Outdated
Comment thread components/src/dynamo/common/multimodal/video_loader.py
Comment thread components/src/dynamo/common/tests/multimodal/test_audio_loader.py Outdated
Comment thread components/src/dynamo/common/multimodal/audio_loader.py
@KrishnanPrash

Copy link
Copy Markdown
Contributor

/ok to test 6deddef

Signed-off-by: host452b <32806348+host452b@users.noreply.github.com>
@host452b
host452b requested review from a team as code owners September 18, 2026 02:12
@host452b
host452b deployed to external_collaborator September 18, 2026 02:12 — with GitHub Actions Active
@github-actions github-actions Bot added documentation Improvements or additions to documentation backend::sglang Relates to the sglang backend backend::trtllm Relates to the trtllm backend labels Sep 18, 2026

@dynamo-review-agent dynamo-review-agent Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously reported defects still present:

  • Original discussion: The SGLang limit still does not cover supported deployments where NVDEC is disabled or unavailable. _build_encode_inputs returns validated URL strings in that branch, so SGLang fetches them with its own client and never receives max_bytes=max_media_bytes(). With DYN_MM_MAX_FILE_SIZE_MB set below SGLang's own limit, a remote video above the Dynamo limit is still downloaded and buffered.

Signed-off-by: host452b <32806348+host452b@users.noreply.github.com>
@host452b
host452b deployed to external_collaborator September 18, 2026 02:34 — with GitHub Actions Active
@host452b
host452b deployed to external_collaborator September 18, 2026 02:50 — with GitHub Actions Active
@KrishnanPrash

Copy link
Copy Markdown
Contributor

/ok to test 14a3915

@KrishnanPrash

Copy link
Copy Markdown
Contributor

Hey @host452b,

Could you resolve the merge conflicts on this PR and any remaining failing CI tests? Should be good to merge after that 🙂

@host452b

Copy link
Copy Markdown
Author

Hey @host452b,

Could you resolve the merge conflicts on this PR and any remaining failing CI tests? Should be good to merge after that 🙂

OK will do

Signed-off-by: host452b <32806348+host452b@users.noreply.github.com>
@host452b
host452b deployed to external_collaborator September 21, 2026 07:02 — with GitHub Actions Active
@host452b
host452b deployed to external_collaborator September 21, 2026 07:52 — with GitHub Actions Active
@host452b

Copy link
Copy Markdown
Author

Hey @host452b,

Could you resolve the merge conflicts on this PR and any remaining failing CI tests? Should be good to merge after that 🙂

Already done, please check.thanks.

@KrishnanPrash

Copy link
Copy Markdown
Contributor

/ok to test 55d72a8

@rmccorm4
rmccorm4 enabled auto-merge (squash) September 22, 2026 19:54

@rmccorm4 rmccorm4 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving docs change, 1 nit comment for future follow-up: https://github.com/ai-dynamo/dynamo/pull/15005/changes#r4076663272

@rmccorm4
rmccorm4 merged commit 4176e3d into ai-dynamo:main Sep 22, 2026
115 checks passed
furionw added a commit to ywang96/dynamo that referenced this pull request Sep 23, 2026
Main now bounds every remote media download by DYN_MM_MAX_FILE_SIZE_MB
(ai-dynamo#15005), so the shared-cache-only wording in the environment table no
longer matches ImageLoader after the rebase.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: furionw <qiwa@nvidia.com>

This branch was successfully deployed

1 active deployment
external_collaborator — 55d72a83 Deployed Sep 21, 2026 by host452b via ok-to-test #21023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend::sglang Relates to the sglang backend backend::trtllm Relates to the trtllm backend documentation Improvements or additions to documentation external-contribution Pull request is from an external contributor fix multimodal size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: Multimodal loaders ignore the configured media file size limit

3 participants