tamarind-cli 0.5.1__tar.gz → 0.6.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/.github/workflows/ci.yml +1 -0
  2. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/PKG-INFO +6 -1
  3. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/README.md +5 -0
  4. tamarind_cli-0.6.0/docs/finetune.md +179 -0
  5. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/pyproject.toml +1 -1
  6. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/__init__.py +38 -0
  7. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/cli/commands/custom_tools.py +2 -0
  8. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/cli/commands/jobs.py +60 -13
  9. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/cli/inputs.py +22 -3
  10. tamarind_cli-0.6.0/src/tamarind/finetune/__init__.py +58 -0
  11. tamarind_cli-0.6.0/src/tamarind/finetune/__main__.py +10 -0
  12. tamarind_cli-0.6.0/src/tamarind/finetune/decorators.py +186 -0
  13. tamarind_cli-0.6.0/src/tamarind/finetune/predict.py +331 -0
  14. tamarind_cli-0.6.0/src/tamarind/finetune/runtime.py +254 -0
  15. tamarind_cli-0.6.0/src/tamarind/finetune/spec.py +282 -0
  16. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/jobs.py +89 -4
  17. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/resources.py +34 -11
  18. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/rest.py +24 -12
  19. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/tests/test_agent_contract.py +48 -0
  20. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/tests/test_custom_tools_cli.py +46 -0
  21. tamarind_cli-0.6.0/tests/test_finetune_integration.py +53 -0
  22. tamarind_cli-0.6.0/tests/test_finetune_predict.py +295 -0
  23. tamarind_cli-0.6.0/tests/test_finetune_runtime.py +277 -0
  24. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/tests/test_inputs.py +53 -0
  25. tamarind_cli-0.6.0/tests/test_low_priority_cli.py +146 -0
  26. tamarind_cli-0.6.0/tests/test_org_job_lookup.py +252 -0
  27. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/tests/test_rest.py +18 -0
  28. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/.github/workflows/publish.yml +0 -0
  29. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/.gitignore +0 -0
  30. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/LICENSE +0 -0
  31. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/docs/architecture.md +0 -0
  32. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/docs/custom-tools.md +0 -0
  33. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/install.sh +0 -0
  34. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/openapi/openapi-python-client.json +0 -0
  35. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/openapi/pipelines-openapi-python-client.json +0 -0
  36. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/openapi/pipelines-v1.json +0 -0
  37. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/openapi/pipelines-v1.lock.json +0 -0
  38. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/openapi/public-v1.json +0 -0
  39. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/openapi/public-v1.lock.json +0 -0
  40. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/scripts/check_custom_tools_provenance.py +0 -0
  41. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/scripts/sync_custom_tools_contract.py +0 -0
  42. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/scripts/sync_pipelines_contract.py +0 -0
  43. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/attribution.py +0 -0
  44. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/catalog.py +0 -0
  45. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/cli/__init__.py +0 -0
  46. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/cli/commands/__init__.py +0 -0
  47. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/cli/commands/auth.py +0 -0
  48. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/cli/commands/catalog.py +0 -0
  49. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/cli/commands/files.py +0 -0
  50. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/cli/guidance.py +0 -0
  51. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/cli/main.py +0 -0
  52. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/cli/output.py +0 -0
  53. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/config.py +0 -0
  54. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/custom_tools/__init__.py +0 -0
  55. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/custom_tools/_contract.py +0 -0
  56. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/custom_tools/_generated/__init__.py +0 -0
  57. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/custom_tools/_generated/api/__init__.py +0 -0
  58. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/custom_tools/_generated/api/custom_tools/__init__.py +0 -0
  59. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/custom_tools/_generated/api/custom_tools/build_custom_tool.py +0 -0
  60. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/custom_tools/_generated/api/custom_tools/cancel_custom_tool_build.py +0 -0
  61. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/custom_tools/_generated/api/custom_tools/create_custom_tool.py +0 -0
  62. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/custom_tools/_generated/api/custom_tools/create_custom_tool_upload.py +0 -0
  63. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/custom_tools/_generated/api/custom_tools/delete_custom_tool.py +0 -0
  64. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/custom_tools/_generated/api/custom_tools/get_custom_tool.py +0 -0
  65. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/custom_tools/_generated/api/custom_tools/list_custom_tool_build_logs.py +0 -0
  66. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/custom_tools/_generated/api/custom_tools/list_custom_tool_versions.py +0 -0
  67. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/custom_tools/_generated/api/custom_tools/list_custom_tools.py +0 -0
  68. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/custom_tools/_generated/api/custom_tools/publish_custom_tool.py +0 -0
  69. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/custom_tools/_generated/api/custom_tools/update_custom_tool.py +0 -0
  70. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/custom_tools/_generated/client.py +0 -0
  71. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/custom_tools/_generated/errors.py +0 -0
  72. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/custom_tools/_generated/models/__init__.py +0 -0
  73. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/custom_tools/_generated/models/public_build_error.py +0 -0
  74. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/custom_tools/_generated/models/public_build_event.py +0 -0
  75. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/custom_tools/_generated/models/public_build_log_page.py +0 -0
  76. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/custom_tools/_generated/models/public_build_result.py +0 -0
  77. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/custom_tools/_generated/models/public_build_result_action.py +0 -0
  78. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/custom_tools/_generated/models/public_create_custom_tool_request.py +0 -0
  79. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/custom_tools/_generated/models/public_create_custom_tool_request_gputype.py +0 -0
  80. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/custom_tools/_generated/models/public_create_custom_tool_request_memory.py +0 -0
  81. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/custom_tools/_generated/models/public_create_version_request.py +0 -0
  82. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/custom_tools/_generated/models/public_custom_tool.py +0 -0
  83. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/custom_tools/_generated/models/public_custom_tool_detail.py +0 -0
  84. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/custom_tools/_generated/models/public_custom_tool_detail_gputype.py +0 -0
  85. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/custom_tools/_generated/models/public_custom_tool_detail_memory.py +0 -0
  86. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/custom_tools/_generated/models/public_custom_tool_gputype.py +0 -0
  87. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/custom_tools/_generated/models/public_custom_tool_memory.py +0 -0
  88. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/custom_tools/_generated/models/public_custom_tool_page.py +0 -0
  89. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/custom_tools/_generated/models/public_custom_tool_status.py +0 -0
  90. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/custom_tools/_generated/models/public_problem.py +0 -0
  91. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/custom_tools/_generated/models/public_problem_errors_type_0_item.py +0 -0
  92. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/custom_tools/_generated/models/public_update_custom_tool_request.py +0 -0
  93. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/custom_tools/_generated/models/public_update_custom_tool_request_gpu_type_type_0.py +0 -0
  94. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/custom_tools/_generated/models/public_update_custom_tool_request_memory_type_0.py +0 -0
  95. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/custom_tools/_generated/models/public_upload_session.py +0 -0
  96. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/custom_tools/_generated/models/public_upload_session_uploadheaders.py +0 -0
  97. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/custom_tools/_generated/models/public_version.py +0 -0
  98. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/custom_tools/_generated/models/public_version_page.py +0 -0
  99. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/custom_tools/_generated/models/public_version_status.py +0 -0
  100. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/custom_tools/_generated/types.py +0 -0
  101. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/custom_tools/client.py +0 -0
  102. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/custom_tools/packaging.py +0 -0
  103. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/custom_tools/resources.py +0 -0
  104. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/custom_tools/transport.py +0 -0
  105. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/custom_tools/validation.py +0 -0
  106. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/errors.py +0 -0
  107. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/http.py +0 -0
  108. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/pipelines/__init__.py +0 -0
  109. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/pipelines/_generated/__init__.py +0 -0
  110. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/pipelines/_generated/api/__init__.py +0 -0
  111. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/pipelines/_generated/api/pipelines_public/__init__.py +0 -0
  112. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/pipelines/_generated/api/pipelines_public/get_run.py +0 -0
  113. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/pipelines/_generated/api/pipelines_public/list_node_run_molecules.py +0 -0
  114. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/pipelines/_generated/client.py +0 -0
  115. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/pipelines/_generated/errors.py +0 -0
  116. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/pipelines/_generated/models/__init__.py +0 -0
  117. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/pipelines/_generated/models/node_run_status.py +0 -0
  118. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/pipelines/_generated/models/public_node_run.py +0 -0
  119. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/pipelines/_generated/models/public_node_run_molecule.py +0 -0
  120. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/pipelines/_generated/models/public_node_run_molecule_page.py +0 -0
  121. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/pipelines/_generated/models/public_node_run_molecule_scores.py +0 -0
  122. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/pipelines/_generated/models/public_problem.py +0 -0
  123. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/pipelines/_generated/models/public_problem_errors_type_0_item.py +0 -0
  124. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/pipelines/_generated/models/public_run.py +0 -0
  125. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/pipelines/_generated/models/public_run_inputs.py +0 -0
  126. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/pipelines/_generated/models/run_status.py +0 -0
  127. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/pipelines/_generated/models/source.py +0 -0
  128. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/pipelines/_generated/types.py +0 -0
  129. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/pipelines/resources.py +0 -0
  130. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/pipelines/transport.py +0 -0
  131. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/py.typed +0 -0
  132. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/src/tamarind/uploads.py +0 -0
  133. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/tests/test_attribution.py +0 -0
  134. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/tests/test_batch_prevalidate.py +0 -0
  135. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/tests/test_bugbash.py +0 -0
  136. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/tests/test_catalog_examples.py +0 -0
  137. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/tests/test_cli_commands.py +0 -0
  138. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/tests/test_config.py +0 -0
  139. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/tests/test_custom_tools_generation.py +0 -0
  140. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/tests/test_custom_tools_packaging.py +0 -0
  141. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/tests/test_custom_tools_sdk.py +0 -0
  142. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/tests/test_errors.py +0 -0
  143. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/tests/test_file_filters.py +0 -0
  144. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/tests/test_jobs.py +0 -0
  145. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/tests/test_output.py +0 -0
  146. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/tests/test_pep561.py +0 -0
  147. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/tests/test_pipelines_sdk.py +0 -0
  148. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/tests/test_sdk_resources.py +0 -0
  149. {tamarind_cli-0.5.1 → tamarind_cli-0.6.0}/uv.lock +0 -0
@@ -44,6 +44,7 @@ jobs:
44
44
  run: >-
45
45
  uv run --extra dev mypy
46
46
  src/tamarind/custom_tools
47
+ src/tamarind/finetune
47
48
  src/tamarind/pipelines
48
49
  src/tamarind/http.py
49
50
  src/tamarind/errors.py
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: tamarind-cli
3
- Version: 0.5.1
3
+ Version: 0.6.0
4
4
  Summary: Command-line interface AND Python SDK for the Tamarind Bio platform — submit, monitor, and download protein/molecule jobs from your terminal, scripts, or an AI agent.
5
5
  Project-URL: Homepage, https://tamarind.bio
6
6
  Project-URL: Documentation, https://app.tamarind.bio/api-docs
@@ -95,6 +95,11 @@ tamarind submit boltz --input job.yaml --name my-run \
95
95
  tamarind jobs
96
96
  tamarind status my-run
97
97
  tamarind results my-run --download ./out
98
+
99
+ # A job run by another member of your organization
100
+ tamarind jobs --organization
101
+ tamarind status their-run --organization # or --email teammate@example.com
102
+ tamarind results their-run --organization --download ./out
98
103
  ```
99
104
 
100
105
  Set individual fields inline instead of a file:
@@ -69,6 +69,11 @@ tamarind submit boltz --input job.yaml --name my-run \
69
69
  tamarind jobs
70
70
  tamarind status my-run
71
71
  tamarind results my-run --download ./out
72
+
73
+ # A job run by another member of your organization
74
+ tamarind jobs --organization
75
+ tamarind status their-run --organization # or --email teammate@example.com
76
+ tamarind results their-run --organization --download ./out
72
77
  ```
73
78
 
74
79
  Set individual fields inline instead of a file:
@@ -0,0 +1,179 @@
1
+ # Train your own model on Tamarind
2
+
3
+ A training script becomes a Tamarind tool by adding a few decorators and deploying the folder
4
+ as a custom tool. The platform runs the script on the GPU you ask for, injects the
5
+ hyperparameters you declare, records what you log, and keeps the trained model as a versioned
6
+ tool you can run, put in a pipeline, or benchmark against Tamarind's own models.
7
+
8
+ You keep the training loop. Nothing here owns your data loader, your loss, or your framework.
9
+
10
+ ## The script
11
+
12
+ ```python
13
+ import tamarind as tm
14
+
15
+ @tm.training_run(
16
+ gpu="A100",
17
+ timeout_hours=12,
18
+ hyperparameters={
19
+ "lr": tm.Float(1e-4, 1e-6, 1e-2),
20
+ "epochs": tm.Int(10),
21
+ "rank": tm.Choice(8, [4, 8, 16, 32]),
22
+ },
23
+ objective=("val/spearman", "max"),
24
+ artifact="checkpoints/best",
25
+ )
26
+ def main():
27
+ hp = tm.hyperparameters() # {"lr": ..., "epochs": ..., "rank": ...}
28
+ model = build(rank=hp["rank"])
29
+ for step, batch in enumerate(loader):
30
+ loss = train_step(model, batch, lr=hp["lr"])
31
+ tm.log({"train/loss": loss}, step=step)
32
+ if step % 500 == 0:
33
+ metrics = tm.evaluate(model.predict(val_x), val_y)
34
+ tm.log(metrics, step=step)
35
+ save(model, tm.checkpoint(step=step, metrics=metrics))
36
+
37
+ @tm.predictor(gpu="L4", inputs={"sequence": "sequence"}, outputs={"affinity": "number"})
38
+ class BindingModel:
39
+ def load(self, artifact_dir): ...
40
+ def predict(self, inputs): ...
41
+ def embed(self, inputs): ... # optional: powers feature extraction
42
+
43
+ @tm.evaluator(metrics={"spearman": "max", "mae": "min"})
44
+ def score(predictions, truths):
45
+ return {"spearman": ..., "mae": ...}
46
+
47
+ if __name__ == "__main__":
48
+ main()
49
+ ```
50
+
51
+ | Decorator | On | What the platform does with it |
52
+ |---|---|---|
53
+ | `@tm.training_run` | the function to invoke | Schedules the run with `gpu`/`memory`/`cpu`, caps it at `timeout_hours`, offers each hyperparameter as a submit setting and a sweep axis, ranks runs by `objective`, registers `artifact` as the model |
54
+ | `@tm.predictor` | a class with `load()` and `predict()` | Serves the artifact as a tool with the declared `inputs` and `outputs`; `embed()` is optional |
55
+ | `@tm.evaluator` | `score(predictions, truths)` | The same scoring for validation during training and for benchmarks |
56
+ | `@tm.splitter` | `split(dataset)` | A custom train/validation split |
57
+
58
+ `memory` must be one of the platform's sizes: 8Gi, 12Gi, 24Gi, 32Gi, 48Gi, 64Gi, 90Gi, 96Gi or 180Gi.
59
+ Every decorator argument must be a literal: a number, string, bool, list, tuple or dict of
60
+ those, or `tm.Float` / `tm.Int` / `tm.Str` / `tm.Bool` / `tm.Choice` with literal arguments.
61
+ The platform's build reads the folder without importing it (the block is needed before the
62
+ image that holds your dependencies exists), so `gpu=os.environ["GPU"]` fails the build with the
63
+ file and line.
64
+
65
+ ## At run time
66
+
67
+ | Call | Does |
68
+ |---|---|
69
+ | `tm.hyperparameters()` | The chosen values, typed. On the platform, from the run's file; locally, the declared defaults with environment-variable overrides (`epochs=3 python train.py`) |
70
+ | `tm.log({...}, step=n)` | Appends a JSON line to the run's metrics file. Never raises; non-finite numbers become null |
71
+ | `tm.checkpoint(path=None, step=, metrics=)` | Returns the directory to save into (the artifact dir by default) and records the step and metrics, so the platform can pick the best checkpoint |
72
+ | `tm.evaluate(predictions, truths)` | Calls your `@tm.evaluator` |
73
+ | `tm.artifact_dir()` / `tm.run_dir()` | Where the model and the run's outputs go (`/app/out/...` on the platform, `./tamarind_run/...` locally) |
74
+ | `tm.is_platform()` | True inside a Tamarind run |
75
+ | `tm.is_predicting()` | True when the run serves a trained model instead of training one (see Prediction mode) |
76
+
77
+ The platform sets `TAMARIND_RUN_DIR`, `TAMARIND_HYPERPARAMETERS` (a JSON file),
78
+ `TAMARIND_METRICS_FILE` and `TAMARIND_ARTIFACT_DIR` (the directory the run's `artifact` names,
79
+ which `tm.artifact_dir()` returns, so a hand-written block works without decorators). Off the platform the SDK only writes local files, so the same script
80
+ runs on a laptop unchanged.
81
+
82
+ ## Prediction mode
83
+
84
+ A trained model is served by the `@tm.predictor` class, in the same image and through the same
85
+ `run.sh` as training. When a job is submitted with a model attached, the platform stages that
86
+ model's weights into the container and starts the script in prediction mode:
87
+
88
+ | The platform sets | Meaning |
89
+ |---|---|
90
+ | `TAMARIND_MODE=predict` | this run serves a model; `tm.is_predicting()` is true |
91
+ | `TAMARIND_WEIGHTS_DIR` | the directory holding the trained artifact, exactly as `tm.artifact_dir()` left it |
92
+ | `TAMARIND_PREDICTOR` | the `<file>.py:<Class>` of your predictor, from the tool's `finetune` block |
93
+ | `TAMARIND_INPUTS_FILE` | the job's inputs as a JSON object, each declared input by name (a file input as its path) |
94
+ | `TAMARIND_PREDICTIONS_FILE` | where the predictions CSV goes (`/app/out/predictions.csv`) |
95
+
96
+ In that mode, calling your `@tm.training_run` function does not train: the SDK imports the
97
+ predictor class, calls `load(weights_dir)`, then `predict(inputs)` once with the job's inputs, and
98
+ writes what it returns to the predictions CSV. `predict` returns a dict of column name to value
99
+ (`{"affinity": 0.42}`), or a list of such dicts for several rows. The declared `outputs` must all
100
+ be present; extra keys become extra columns. A `load` or `predict` that raises fails the job with
101
+ the exception.
102
+
103
+ Nothing in your script changes. If you would rather see the switch in `run.sh`, the explicit
104
+ entry does the same thing:
105
+
106
+ ```
107
+ python -m tamarind.finetune predict
108
+ ```
109
+
110
+ The same command tests a predictor on a laptop against a local artifact:
111
+
112
+ ```
113
+ python -m tamarind.finetune predict --predictor model.py:BindingModel \
114
+ --weights ./tamarind_run/model --input sequence=ACDEFGH --out preds.csv
115
+ ```
116
+
117
+ `task` names what the predictions are, `"score"` for a property predictor. With `outputs` it
118
+ gives `predictions.csv` a result contract: the declared columns are ingested as molecule
119
+ properties, so pipelines and benchmarks read them. Without `task` the file is still written and
120
+ downloadable, as for any tool without a task type.
121
+
122
+ A predictor can also live in its own tool with its own image, for example a slim CPU image for
123
+ inference. Deploy that folder as a separate custom tool and say whose models it serves:
124
+
125
+ ```python
126
+ @tm.predictor(inputs={"sequence": "sequence"}, outputs={"affinity": "number"},
127
+ serves_models_from=["binder-train"])
128
+ class BindingModel: ...
129
+ ```
130
+
131
+ A model trained by `binder-train` can then be attached to a job on this tool. Without
132
+ `serves_models_from`, a predictor serves the models of the tool it is deployed in.
133
+
134
+ ## Deploy
135
+
136
+ A training tool is a custom tool: a folder with a `Dockerfile`, a `run.sh` that starts your
137
+ script, and a `config.json`. The image needs the SDK, so the Dockerfile installs it:
138
+
139
+ ```dockerfile
140
+ RUN pip install --no-cache-dir tamarind-cli
141
+ ```
142
+
143
+ (`python:*-slim` images have no `git`, so install from PyPI or a tarball URL, not `git+https://`.)
144
+ Deploy it like any other custom tool:
145
+
146
+ ```
147
+ tamarind custom-tools build my-trainer ./my-trainer
148
+ ```
149
+
150
+ At build, the platform reads the decorators out of your `.py` files and stores the `finetune`
151
+ block they describe on the version it builds. Your files are never rewritten: `config.json` needs
152
+ no `finetune` block, and the block lives on the version and on every run submitted against it.
153
+ An agent deploying through `deployCustomTool`, the SDK's `CustomTool.build()` and the web editor
154
+ all go through that same build, so there is one reading of the decorators and it is the
155
+ platform's. A decorator the build cannot read (a non-literal argument, say) fails the build with
156
+ the file and line.
157
+
158
+ You can also write the block by hand in `config.json`, in any language, and skip the decorators
159
+ entirely. If a folder has both, they must agree; a block that contradicts the decorators fails
160
+ the build naming both, rather than one silently winning:
161
+
162
+ ```json
163
+ "finetune": {
164
+ "entrypoint": "train.py:main",
165
+ "timeoutHours": 12,
166
+ "hyperparameters": {
167
+ "lr": {"type": "float", "default": 1e-4, "min": 1e-6, "max": 1e-2},
168
+ "epochs": {"type": "int", "default": 10},
169
+ "rank": {"type": "int", "default": 8, "options": [4, 8, 16, 32]}
170
+ },
171
+ "objective": {"metric": "val/spearman", "mode": "max"},
172
+ "artifact": "checkpoints/best",
173
+ "predictor": {"class": "model.py:BindingModel", "gpuType": "L4", ...},
174
+ "evaluator": "train.py:score"
175
+ }
176
+ ```
177
+
178
+ The Dockerfile stays yours. Base model weights go into the image at build time; the runtime
179
+ has no network. The trained artifact goes out through `tm.artifact_dir()`, never into the image.
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "tamarind-cli"
3
- version = "0.5.1"
3
+ version = "0.6.0"
4
4
  description = "Command-line interface AND Python SDK for the Tamarind Bio platform — submit, monitor, and download protein/molecule jobs from your terminal, scripts, or an AI agent."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.10"
@@ -24,6 +24,44 @@ from tamarind.custom_tools.client import Tamarind
24
24
 
25
25
  __all__ = ["Tamarind", "__version__"]
26
26
 
27
+ # `import tamarind as tm` is how a training script uses the finetune decorators and runtime
28
+ # helpers (tm.training_run, tm.hyperparameters, tm.log, ...). They are resolved on first access
29
+ # so importing the client never pays for them and the finetune package never imports the client.
30
+ _FINETUNE_EXPORTS = frozenset(
31
+ {
32
+ "training_run",
33
+ "predictor",
34
+ "evaluator",
35
+ "splitter",
36
+ "hyperparameters",
37
+ "log",
38
+ "checkpoint",
39
+ "evaluate",
40
+ "artifact_dir",
41
+ "run_dir",
42
+ "is_platform",
43
+ "is_predicting",
44
+ "Float",
45
+ "Int",
46
+ "Str",
47
+ "Bool",
48
+ "Choice",
49
+ }
50
+ )
51
+
52
+
53
+ def __getattr__(name: str): # type: ignore[no-untyped-def]
54
+ if name in _FINETUNE_EXPORTS:
55
+ from tamarind import finetune
56
+
57
+ return getattr(finetune, name)
58
+ raise AttributeError(f"module 'tamarind' has no attribute {name!r}")
59
+
60
+
61
+ def __dir__() -> list[str]:
62
+ return sorted(set(globals()) | _FINETUNE_EXPORTS)
63
+
64
+
27
65
  try:
28
66
  # Single source of truth: the installed package version (pyproject.toml),
29
67
  # so `tamarind --version` can never drift from the released version.
@@ -210,6 +210,8 @@ def test_tool(
210
210
  """
211
211
  state = ctx.obj
212
212
  job_input = resolve_job_input(input, set_)
213
+ if job_input.low_priority:
214
+ raise ValidationError("Custom tools can't run at low priority. Remove lowPriority from the input file.")
213
215
  tool_name = effective_job_type(tool_name, job_input.job_type)
214
216
  job_name = effective_job_name(name, job_input.job_name)
215
217
  with state.sdk_client() as client:
@@ -20,6 +20,19 @@ from .. import output
20
20
  from ..guidance import rewrite_validation_guidance
21
21
  from ..inputs import effective_job_name, effective_job_type, resolve_job_input
22
22
 
23
+ _ORG_LOOKUP_HELP = (
24
+ "Find the job across your org's members (a name several members share, "
25
+ "and batch subjobs, need --email)."
26
+ )
27
+ _EMAIL_LOOKUP_HELP = "The job belongs to this org member."
28
+
29
+
30
+ _LOW_PRIORITY_HELP = (
31
+ "Run at low priority: 20% off, no completion guarantee, and a job not started "
32
+ "within 7 days stops with no charge. Refused if unavailable for this job."
33
+ )
34
+ _LOW_PRIORITY_NOTE = " at low priority (20% off, no completion guarantee, stops with no charge if not started within 7 days)"
35
+
23
36
 
24
37
  def _gen_name(tool: str) -> str:
25
38
  return f"{tool}-{uuid.uuid4().hex[:8]}"
@@ -409,10 +422,12 @@ def register(app: typer.Typer) -> None:
409
422
  poll_interval: float = typer.Option(10.0, "--poll-interval", help="Seconds between polls when --wait."),
410
423
  timeout: Optional[float] = typer.Option(None, "--timeout", help="With --wait, give up after N seconds."),
411
424
  download: Optional[Path] = typer.Option(None, "--download", help="With --wait, download results to this directory."),
425
+ low_priority: bool = typer.Option(False, "--low-priority", help=_LOW_PRIORITY_HELP),
412
426
  ) -> None:
413
427
  """Submit a single job. Validates first unless --skip-validate."""
414
428
  state = ctx.obj
415
429
  job = resolve_job_input(input, set_)
430
+ low_priority = low_priority or job.low_priority
416
431
  job_type = effective_job_type(tool, job.job_type)
417
432
  job_name = effective_job_name(name, job.job_name) or _gen_name(tool)
418
433
  if wait:
@@ -441,7 +456,11 @@ def register(app: typer.Typer) -> None:
441
456
  output.info(f"Submitting {job_type} job '{job_name}'…", state.output)
442
457
  try:
443
458
  submit_resp = rest.submit_job(
444
- client, job_name=job_name, job_type=job_type, settings=job.settings
459
+ client,
460
+ job_name=job_name,
461
+ job_type=job_type,
462
+ settings=job.settings,
463
+ low_priority=low_priority,
445
464
  )
446
465
  except TamarindError as exc:
447
466
  status_code = getattr(exc, "status_code", None)
@@ -463,6 +482,8 @@ def register(app: typer.Typer) -> None:
463
482
  )
464
483
 
465
484
  result = {"jobName": job_name, "type": job_type, "submit": submit_resp}
485
+ if low_priority:
486
+ result["lowPriority"] = True
466
487
 
467
488
  if wait:
468
489
  try:
@@ -473,7 +494,7 @@ def register(app: typer.Typer) -> None:
473
494
  poll_interval=poll_interval,
474
495
  timeout=timeout,
475
496
  on_poll=lambda j: output.info(
476
- f" status: {jobs_helpers.job_status(j)}", state.output
497
+ f" status: {jobs_helpers.job_status(j)}{jobs_helpers.low_priority_note(j)}", state.output
477
498
  ),
478
499
  )
479
500
  result["final"] = final
@@ -494,7 +515,7 @@ def register(app: typer.Typer) -> None:
494
515
  recoveryCommand=f"tamarind --json status {job_name}",
495
516
  )
496
517
 
497
- human = f"submitted: {job_name}" + (
518
+ human = f"submitted: {job_name}" + (_LOW_PRIORITY_NOTE if low_priority else "") + (
498
519
  f" ({jobs_helpers.job_status(result['final'])})" if "final" in result else ""
499
520
  )
500
521
  output.emit(_sanitize_job_output(result), state.output, human=human)
@@ -505,7 +526,7 @@ def register(app: typer.Typer) -> None:
505
526
  def batch(
506
527
  ctx: typer.Context,
507
528
  tool: str = typer.Argument(..., help="Tool name applied to every job in the batch."),
508
- input: str = typer.Option(..., "--input", "-i", help="YAML/JSON list of per-job settings, or a {batchName,type,settings[],jobNames} object."),
529
+ input: str = typer.Option(..., "--input", "-i", help="YAML/JSON list of per-job settings, or a {batchName,type,settings[],jobNames,lowPriority} object."),
509
530
  name: Optional[str] = typer.Option(None, "--name", "-n", help="Batch name (default: auto)."),
510
531
  max_runtime: Optional[int] = typer.Option(None, "--max-runtime", help="Max runtime seconds per job."),
511
532
  prevalidate: bool = typer.Option(
@@ -513,10 +534,11 @@ def register(app: typer.Typer) -> None:
513
534
  "--prevalidate",
514
535
  help="Validate every item before submitting.",
515
536
  ),
537
+ low_priority: bool = typer.Option(False, "--low-priority", help=_LOW_PRIORITY_HELP),
516
538
  ) -> None:
517
539
  """Submit many jobs as one batch (preferred over looping submit)."""
518
540
  state = ctx.obj
519
- from ..inputs import _load_text, _parse_document # internal reuse
541
+ from ..inputs import _load_text, _parse_document, parse_low_priority # internal reuse
520
542
 
521
543
  doc = _parse_document(_load_text(input))
522
544
  batch_name = effective_job_name(name, None) or _gen_name(tool)
@@ -529,6 +551,7 @@ def register(app: typer.Typer) -> None:
529
551
  batch_name = effective_job_name(name, doc.get("batchName")) or batch_name
530
552
  job_type = effective_job_type(tool, doc.get("type"))
531
553
  job_names = doc.get("jobNames")
554
+ low_priority = parse_low_priority(doc.get("lowPriority", False)) or low_priority
532
555
  else:
533
556
  raise TamarindError("Batch --input must be a list of settings or a {settings:[...]} object.")
534
557
  if not isinstance(batch_name, str) or not batch_name.strip():
@@ -577,6 +600,7 @@ def register(app: typer.Typer) -> None:
577
600
  settings=settings_list,
578
601
  job_names=job_names,
579
602
  max_runtime_seconds=max_runtime,
603
+ low_priority=low_priority,
580
604
  )
581
605
  except TamarindError as exc:
582
606
  status_code = getattr(exc, "status_code", None)
@@ -597,10 +621,12 @@ def register(app: typer.Typer) -> None:
597
621
  recoveryCommand=f"tamarind --json status {batch_name}",
598
622
  )
599
623
  result = {"batchName": batch_name, "type": job_type, "count": len(settings_list), "submit": resp}
624
+ if low_priority:
625
+ result["lowPriority"] = True
600
626
  output.emit(
601
627
  _sanitize_job_output(result),
602
628
  state.output,
603
- human=f"submitted batch '{batch_name}' ({len(settings_list)} jobs)",
629
+ human=f"submitted batch '{batch_name}' ({len(settings_list)} jobs)" + (_LOW_PRIORITY_NOTE if low_priority else ""),
604
630
  )
605
631
 
606
632
  @app.command()
@@ -653,7 +679,9 @@ def register(app: typer.Typer) -> None:
653
679
  {
654
680
  "JobName": jobs_helpers.job_name(j),
655
681
  "Type": j.get("Type"),
656
- "JobStatus": jobs_helpers.job_status(j),
682
+ "JobStatus": f"{jobs_helpers.job_status(j)} (low priority)"
683
+ if j.get("LowPriority") is True
684
+ else jobs_helpers.job_status(j),
657
685
  "Created": j.get("Created"),
658
686
  }
659
687
  for j in job_list
@@ -677,15 +705,19 @@ def register(app: typer.Typer) -> None:
677
705
  def status(
678
706
  ctx: typer.Context,
679
707
  job_name: str = typer.Argument(..., help="Job name."),
708
+ organization: bool = typer.Option(False, "--organization", help=_ORG_LOOKUP_HELP),
709
+ email: Optional[str] = typer.Option(None, "--email", help=_EMAIL_LOOKUP_HELP),
680
710
  ) -> None:
681
711
  """Show one job's current status and metadata."""
682
712
  state = ctx.obj
683
713
  with state.rest_client() as client:
684
- job = jobs_helpers.fetch_job(client, job_name)
714
+ job = jobs_helpers.fetch_job(
715
+ client, job_name, organization=organization, job_email=email
716
+ )
685
717
  output.emit(
686
718
  _sanitize_job_output(job),
687
719
  state.output,
688
- human=f"{job_name}: {jobs_helpers.job_status(job)}",
720
+ human=f"{job_name}: {jobs_helpers.job_status(job)}{jobs_helpers.low_priority_note(job)}",
689
721
  )
690
722
 
691
723
  @app.command()
@@ -694,6 +726,8 @@ def register(app: typer.Typer) -> None:
694
726
  job_name: str = typer.Argument(..., help="Job name."),
695
727
  poll_interval: float = typer.Option(10.0, "--poll-interval", help="Seconds between polls."),
696
728
  timeout: Optional[float] = typer.Option(None, "--timeout", help="Give up after N seconds."),
729
+ organization: bool = typer.Option(False, "--organization", help=_ORG_LOOKUP_HELP),
730
+ email: Optional[str] = typer.Option(None, "--email", help=_EMAIL_LOOKUP_HELP),
697
731
  ) -> None:
698
732
  """Block until a job reaches a terminal state."""
699
733
  state = ctx.obj
@@ -703,12 +737,14 @@ def register(app: typer.Typer) -> None:
703
737
  job_name,
704
738
  poll_interval=poll_interval,
705
739
  timeout=timeout,
706
- on_poll=lambda j: output.info(f" status: {jobs_helpers.job_status(j)}", state.output),
740
+ on_poll=lambda j: output.info(f" status: {jobs_helpers.job_status(j)}{jobs_helpers.low_priority_note(j)}", state.output),
741
+ organization=organization,
742
+ job_email=email,
707
743
  )
708
744
  output.emit(
709
745
  _sanitize_job_output(final),
710
746
  state.output,
711
- human=f"{job_name}: {jobs_helpers.job_status(final)}",
747
+ human=f"{job_name}: {jobs_helpers.job_status(final)}{jobs_helpers.low_priority_note(final)}",
712
748
  )
713
749
  if _failed_terminal(final):
714
750
  raise typer.Exit(ExitCode.JOB_FAILED)
@@ -728,6 +764,8 @@ def register(app: typer.Typer) -> None:
728
764
  wait: bool = typer.Option(False, "--wait", help="Wait for the job to finish first."),
729
765
  poll_interval: float = typer.Option(10.0, "--poll-interval", help="Seconds between polls when --wait."),
730
766
  timeout: Optional[float] = typer.Option(None, "--timeout", help="With --wait, give up after N seconds."),
767
+ organization: bool = typer.Option(False, "--organization", help=_ORG_LOOKUP_HELP),
768
+ email: Optional[str] = typer.Option(None, "--email", help=_EMAIL_LOOKUP_HELP),
731
769
  ) -> None:
732
770
  """Download results, or explicitly request a credential-bearing URL."""
733
771
  state = ctx.obj
@@ -748,8 +786,10 @@ def register(app: typer.Typer) -> None:
748
786
  poll_interval=poll_interval,
749
787
  timeout=timeout,
750
788
  on_poll=lambda j: output.info(
751
- f" status: {jobs_helpers.job_status(j)}", state.output
789
+ f" status: {jobs_helpers.job_status(j)}{jobs_helpers.low_priority_note(j)}", state.output
752
790
  ),
791
+ organization=organization,
792
+ job_email=email,
753
793
  )
754
794
  if _failed_terminal(final):
755
795
  result = {
@@ -762,9 +802,16 @@ def register(app: typer.Typer) -> None:
762
802
  human=f"{job_name}: {jobs_helpers.job_status(final)}",
763
803
  )
764
804
  raise typer.Exit(ExitCode.JOB_FAILED)
805
+ owner = jobs_helpers.resolve_owner(
806
+ client, job_name, organization=organization, job_email=email, job=final
807
+ )
765
808
  url = _result_url(
766
809
  rest.get_result(
767
- client, job_name=job_name, file_name=file, pdbs_only=pdbs_only or None
810
+ client,
811
+ job_name=job_name,
812
+ job_email=owner,
813
+ file_name=file,
814
+ pdbs_only=pdbs_only or None,
768
815
  )
769
816
  )
770
817
  result = {"jobName": job_name}
@@ -30,6 +30,7 @@ class JobInput:
30
30
  settings: dict[str, Any]
31
31
  job_type: str | None = None
32
32
  job_name: str | None = None
33
+ low_priority: bool = False
33
34
 
34
35
 
35
36
  def _load_text(source: str) -> str:
@@ -77,7 +78,7 @@ def _apply_sets(settings: dict[str, Any], pairs: list[str]) -> None:
77
78
 
78
79
 
79
80
  def _looks_like_envelope(doc: dict[str, Any]) -> bool:
80
- return "settings" in doc and ("type" in doc or "jobName" in doc)
81
+ return "settings" in doc and ("type" in doc or "jobName" in doc or "lowPriority" in doc)
81
82
 
82
83
 
83
84
  def effective_job_type(cli_tool: str, file_type: object | None) -> str:
@@ -113,14 +114,26 @@ def effective_job_name(cli_name: str | None, file_name: object | None) -> str |
113
114
  return name
114
115
 
115
116
 
117
+ def parse_low_priority(value: object) -> bool:
118
+ """Read a ``lowPriority`` from an input file. Anything but a boolean is refused, not guessed."""
119
+ if not isinstance(value, bool):
120
+ raise ValidationError("lowPriority must be true or false.")
121
+ return value
122
+
123
+
116
124
  def resolve_job_input(
117
125
  input_source: str | None,
118
126
  set_pairs: list[str] | None,
119
127
  ) -> JobInput:
120
- """Build a :class:`JobInput` from ``--input`` and ``--set`` options."""
128
+ """Build a :class:`JobInput` from ``--input`` and ``--set`` options.
129
+
130
+ ``lowPriority`` is a request field only beside an envelope's ``settings``. Among the settings
131
+ it stays a setting: a custom tool may declare one, and the API refuses it on any other tool.
132
+ """
121
133
  settings: dict[str, Any] = {}
122
134
  job_type: str | None = None
123
135
  job_name: str | None = None
136
+ low_priority: object = False
124
137
 
125
138
  if input_source:
126
139
  doc = _parse_document(_load_text(input_source))
@@ -134,6 +147,7 @@ def resolve_job_input(
134
147
  if _looks_like_envelope(doc):
135
148
  job_type = doc.get("type")
136
149
  job_name = doc.get("jobName")
150
+ low_priority = doc.get("lowPriority", False)
137
151
  doc = doc["settings"]
138
152
  if not isinstance(doc, dict):
139
153
  raise ValidationError("Job settings must be a mapping (an object).")
@@ -142,7 +156,12 @@ def resolve_job_input(
142
156
  if set_pairs:
143
157
  _apply_sets(settings, set_pairs)
144
158
 
145
- return JobInput(settings=settings, job_type=job_type, job_name=job_name)
159
+ return JobInput(
160
+ settings=settings,
161
+ job_type=job_type,
162
+ job_name=job_name,
163
+ low_priority=parse_low_priority(low_priority),
164
+ )
146
165
 
147
166
 
148
167
  def dump_settings(settings: dict[str, Any]) -> str:
@@ -0,0 +1,58 @@
1
+ """Train your own model on Tamarind: ``import tamarind as tm``.
2
+
3
+ Decorate the parts of a training script the platform needs to find, keep the rest however you
4
+ like, and deploy the folder as a custom tool. See ``docs/finetune.md``.
5
+
6
+ import tamarind as tm
7
+
8
+ @tm.training_run(gpu="A100", timeout_hours=12,
9
+ hyperparameters={"lr": tm.Float(1e-4, 1e-6, 1e-2), "epochs": tm.Int(10)},
10
+ objective=("val/spearman", "max"))
11
+ def main():
12
+ cfg = tm.hyperparameters()
13
+ for step, loss in train(lr=cfg["lr"], epochs=cfg["epochs"]):
14
+ tm.log({"train/loss": loss}, step=step)
15
+ tm.checkpoint(metrics=tm.evaluate(preds, truths))
16
+
17
+ @tm.predictor(gpu="L4", inputs={"sequence": "sequence"}, outputs={"affinity": "number"})
18
+ class Model:
19
+ def load(self, artifact_dir): ...
20
+ def predict(self, inputs): ...
21
+
22
+ @tm.evaluator(metrics={"spearman": "max"})
23
+ def score(predictions, truths): ...
24
+ """
25
+
26
+ from tamarind.finetune.decorators import evaluator, predictor, splitter, training_run
27
+ from tamarind.finetune.predict import is_predicting
28
+ from tamarind.finetune.runtime import (
29
+ artifact_dir,
30
+ checkpoint,
31
+ evaluate,
32
+ hyperparameters,
33
+ is_platform,
34
+ log,
35
+ run_dir,
36
+ )
37
+ from tamarind.finetune.spec import Bool, Choice, FinetuneSpecError, Float, Int, Str
38
+
39
+ __all__ = [
40
+ "Bool",
41
+ "Choice",
42
+ "FinetuneSpecError",
43
+ "Float",
44
+ "Int",
45
+ "Str",
46
+ "artifact_dir",
47
+ "checkpoint",
48
+ "evaluate",
49
+ "evaluator",
50
+ "hyperparameters",
51
+ "is_platform",
52
+ "is_predicting",
53
+ "log",
54
+ "predictor",
55
+ "run_dir",
56
+ "splitter",
57
+ "training_run",
58
+ ]
@@ -0,0 +1,10 @@
1
+ """``python -m tamarind.finetune predict``: serve a trained artifact once. See ``predict.py``."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import sys
6
+
7
+ from tamarind.finetune.predict import main
8
+
9
+ if __name__ == "__main__":
10
+ sys.exit(main())