Folder (Files)
Upload and manage experiment artifacts - models, plots, configs, and results. Files are automatically checksummed and organized with metadata.
Fluent Interface Overview
The folder API uses a fluent interface that supports multiple styles:
Basic Upload
Upload Existing File
Uploads are buffered by default, so upload() and the
save*() methods return {"id": "pending", "status": "queued"} and write the
file in the background. The file can't be listed or downloaded until the buffer
flushes (at the latest when the with block exits). To get the stored record
(filename, sizeBytes, checksum, id, ...) back from the call itself,
set ML_DASH_BUFFER_ENABLED=false before creating the experiment, or read it
later with exp.files("models").list().
Save Objects as Files
Save Python objects directly without creating intermediate files:
Direct Method Style
You can also use the direct method style without specifying a prefix:
Organizing Files
Use paths to organize files logically:
Listing Files
List All Files
List by Prefix
List with Glob Pattern
Downloading Files
Download Single File
Download with Glob Pattern
Download by File ID (Legacy)
Checksum Verification
Downloads automatically verify checksums to ensure file integrity. Download from a later run, after the upload has been flushed:
Deleting Files
Delete Single File
Delete with Glob Pattern
File Metadata
Add description, tags, and custom metadata:
Saving Specific File Types
Save Text
Save JSON
Save Binary Data
Training with Checkpoints
Save models during training:
Saving Visualizations
Upload matplotlib plots using the convenient save_fig() method:
Note: save_fig() automatically closes the figure after saving to prevent memory leaks.
Saving Videos
Upload video frame stacks using the save_video() method. This is useful for saving training visualizations, agent rollouts, or any sequence of images.
save_video() needs the video extra, which installs imageio and ffmpeg:
Practical Example: Agent Rollout
Record an agent's trajectory or any animated visualization:
Video Encoding Options
Control video quality and encoding with additional parameters:
Additional keyword arguments are passed to imageio's writer (e.g., quality, codec, bitrate).
Frame Format Support
save_video() automatically handles various frame formats:
Frame value ranges:
- Float values (0.0 to 1.0) - automatically scaled to 0-255
- Uint8 values (0 to 255) - used directly
- Float32 values - automatically converted
Note: An empty frame list raises ValueError: frame_stack is empty.
Storage Format
Local mode - Files stored with prefix-based organization:
Each file is stored as: files/{prefix}/{snowflake_id}/{filename}
- prefix: Logical organization path (e.g., "models", "configs", "visualizations")
- snowflake_id: Unique identifier generated for each file
- filename: Original filename
Remote mode - Files uploaded to S3, metadata in MongoDB:
- Files stored:
s3://bucket/files/{namespace}/{project}/{experiment}/{prefix}/{file_id}/filename - Metadata: path, size, SHA256 checksum, tags, description
File size limit: the ML-Dash server accepts up to 256MB per file and
rejects larger uploads with 413 Payload Too Large. The SDK itself refuses
files over 100GB, which is the only limit in local mode.
That's it! You've completed all the core ML-Dash tutorials. Check out the API Reference for detailed method documentation.