Mixedbread
Ingest

Multipart Upload

Both upload and uploadAndPoll / upload_and_poll automatically use multipart upload for large files. The file is split into chunks and uploaded in parallel, improving reliability and speed. No extra configuration is needed — it just works.

Default BehaviorLink to section

Files over 100MB automatically use multipart upload. The existing upload calls work without any changes:

Multipart Upload Default Behavior
file = mxbai.stores.files.upload(
  store_identifier="my-knowledge-base",
  file=Path("./large-document.pdf"),
)

Custom ThresholdLink to section

Lower the threshold to trigger multipart upload for smaller files:

Multipart Upload with Custom Threshold
from mixedbread.lib.multipart_upload import MultipartUploadOptions

file = mxbai.stores.files.upload(
  store_identifier="my-knowledge-base",
  file=Path("./document.pdf"),
  multipart_upload=MultipartUploadOptions(
      threshold=50 * 1024 * 1024,  # 50MB instead of default 100MB
  ),
)

Custom ConcurrencyLink to section

Control how many parts upload in parallel. The default is 5 concurrent uploads:

Multipart Upload with Custom Concurrency
from mixedbread.lib.multipart_upload import MultipartUploadOptions

file = mxbai.stores.files.upload(
  store_identifier="my-knowledge-base",
  file=Path("./large-document.pdf"),
  multipart_upload=MultipartUploadOptions(
      concurrency=10,
  ),
)

Custom Part SizeLink to section

Control the size of each chunk. The default part size is 100MB:

Multipart Upload with Custom Part Size
from mixedbread.lib.multipart_upload import MultipartUploadOptions

file = mxbai.stores.files.upload(
  store_identifier="my-knowledge-base",
  file=Path("./large-document.pdf"),
  multipart_upload=MultipartUploadOptions(
      part_size=50 * 1024 * 1024,  # 50MB parts
  ),
)

Progress TrackingLink to section

Get notified after each part finishes uploading. Works with both upload and uploadAndPoll / upload_and_poll:

Progress Tracking with uploadAndPoll
from pathlib import Path
from mixedbread import Mixedbread
from mixedbread.lib.multipart_upload import MultipartUploadOptions

mxbai = Mixedbread(api_key="YOUR_API_KEY")


def on_part_upload(event):
    pct = round((event.uploaded_bytes / event.total_bytes) * 100)
    print(f"Part {event.part_number}/{event.total_parts} done — {pct}%")


file = mxbai.stores.files.upload_and_poll(
    store_identifier="my-knowledge-base",
    file=Path("./large-document.pdf"),
    multipart_upload=MultipartUploadOptions(
        on_part_upload=on_part_upload,
    ),
)

print(file)

The callback receives a PartUploadEvent with the following fields:

FieldDescription
partNumber / part_number1-based part number that completed
totalParts / total_partsTotal number of parts in this upload
partSize / part_sizeSize of this part in bytes
uploadedBytes / uploaded_bytesCumulative bytes uploaded so far
totalBytes / total_bytesTotal file size in bytes

All Options TogetherLink to section

Combine threshold, part size, concurrency, and progress tracking:

All Multipart Upload Options
from pathlib import Path
from mixedbread import Mixedbread
from mixedbread.lib.multipart_upload import MultipartUploadOptions

mxbai = Mixedbread(api_key="YOUR_API_KEY")


def on_part_upload(event):
    pct = round((event.uploaded_bytes / event.total_bytes) * 100)
    print(f"Part {event.part_number}/{event.total_parts}{pct}%")


file = mxbai.stores.files.upload(
    store_identifier="my-knowledge-base",
    file=Path("./large-document.pdf"),
    multipart_upload=MultipartUploadOptions(
        threshold=50 * 1024 * 1024,  # 50MB threshold
        part_size=25 * 1024 * 1024,  # 25MB parts
        concurrency=10,
        on_part_upload=on_part_upload,
    ),
)

print(file)

Options ReferenceLink to section

OptionDefaultDescription
threshold100MBMinimum file size to trigger multipart upload
partSize / part_size100MBSize of each upload chunk
concurrency5Number of parts uploaded in parallel
onPartUpload / on_part_uploadCallback invoked after each part completes
Last updated: April 7, 2026