Feature request: expose disk cache safety margin
Author: Swish78Created Sep 8, 2026Updated Sep 9, 2026
Labelsenhancementtriage
Search before asking
- I have searched the Ultralytics issues and found no similar feature requests.
Description
Could check_cache_disk()'s safety margin be exposed as a training parameter?
For example:
model.train(..., cache="disk", cache_safety_margin=0.0)
This would avoid needing to monkey-patch/modify Ultralytics for users who have enough disk space but don't need the default safety margin.
Use case
For large datasets, the disk cache check can reject cache="disk" even when there is enough actual free disk space available. Exposing the safety margin would let users adjust it based on their available storage without modifying or monkey-patching the source code.
Additional
No response
Are you willing to submit a PR?
- Yes I'd like to help by submitting a PR!
Source: ultralytics/ultralytics