Skip to content

Conversation

@EugeneJinXin
Copy link
Contributor

@EugeneJinXin EugeneJinXin commented Oct 2, 2025

LS-4410

Problem: Enhance upload examples performance, devX and reduce chances of hitting the current 25MB max payload limit on our backend.

Solution: size-based batching with conservative concurrency allowed (max concurrency <= 4); use _estimate_example_size helper to estimate size, and depending on the concurrency we trigger sequential upload or multi-threading concurrency upload.

Tests:

  • Integration test covering concurrent upload, sequential upload, large attachments upload to simulate >100MB payload
  • manual testing using script to tests bulk upload of 10,000 simple examples without attachments
  • manual testing using 1~6 GBs of load testing. Concurrent upload could speed up 2X - 3X until I hit network upload bandwidth

"aliveStatusCodes": [429, 200],
"ignorePatterns": [
{
"pattern": "^https://www\\.npmjs\\.com/"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

just to fix ci/cd failure that complains langsmith npm link returns 403, not our fault

response = client.create_examples(dataset_name="agent-qa", examples=examples)
# -> {"example_ids": [...
""" # noqa: E501
if not 1 <= max_concurrency <= 3:
Copy link
Contributor Author

@EugeneJinXin EugeneJinXin Oct 9, 2025

Choose a reason for hiding this comment

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

think @validate_call pydantic runtime is ugly, so i prefer this since it works as simple and effective runtime check

@EugeneJinXin EugeneJinXin merged commit f71b116 into main Oct 16, 2025
18 of 20 checks passed
@EugeneJinXin EugeneJinXin deleted the batch-upload-examples branch October 16, 2025 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants