withruntime 0.7.1__tar.gz → 0.8.1__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 (182) hide show
  1. {withruntime-0.7.1 → withruntime-0.8.1}/PKG-INFO +82 -1
  2. {withruntime-0.7.1 → withruntime-0.8.1}/README.md +81 -0
  3. {withruntime-0.7.1 → withruntime-0.8.1}/pyproject.toml +1 -1
  4. withruntime-0.8.1/tests/test_blaxel.py +1181 -0
  5. {withruntime-0.7.1 → withruntime-0.8.1}/tests/test_client.py +1 -0
  6. withruntime-0.8.1/tests/test_http_tls_close.py +118 -0
  7. withruntime-0.8.1/tests/test_stream_exit_close.py +55 -0
  8. withruntime-0.8.1/tests/test_unpack.py +79 -0
  9. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/_async_client.py +21 -17
  10. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/_eval_sandbox.py +2 -1
  11. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/_http.py +7 -3
  12. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/_sync_client.py +21 -17
  13. withruntime-0.8.1/withruntime/_unpack.py +99 -0
  14. withruntime-0.8.1/withruntime/_version.py +1 -0
  15. withruntime-0.8.1/withruntime/blaxel/__init__.py +121 -0
  16. withruntime-0.8.1/withruntime/blaxel/_async_io.py +50 -0
  17. withruntime-0.8.1/withruntime/blaxel/_async_sandbox.py +1651 -0
  18. withruntime-0.8.1/withruntime/blaxel/_core.py +1586 -0
  19. withruntime-0.8.1/withruntime/blaxel/_sync_io.py +61 -0
  20. withruntime-0.8.1/withruntime/blaxel/_sync_sandbox.py +1649 -0
  21. withruntime-0.8.1/withruntime/blaxel/core/__init__.py +4 -0
  22. withruntime-0.8.1/withruntime/blaxel/core/agents.py +3 -0
  23. withruntime-0.8.1/withruntime/blaxel/core/client/__init__.py +3 -0
  24. withruntime-0.8.1/withruntime/blaxel/core/client/api/__init__.py +2 -0
  25. withruntime-0.8.1/withruntime/blaxel/core/client/api/applications/__init__.py +2 -0
  26. withruntime-0.8.1/withruntime/blaxel/core/client/api/applications/list_application_revisions.py +5 -0
  27. withruntime-0.8.1/withruntime/blaxel/core/client/api/compute/__init__.py +2 -0
  28. withruntime-0.8.1/withruntime/blaxel/core/client/api/compute/get_sandbox.py +5 -0
  29. withruntime-0.8.1/withruntime/blaxel/core/client/api/compute/update_sandbox.py +5 -0
  30. withruntime-0.8.1/withruntime/blaxel/core/client/api/functions/__init__.py +2 -0
  31. withruntime-0.8.1/withruntime/blaxel/core/client/api/functions/create_function.py +5 -0
  32. withruntime-0.8.1/withruntime/blaxel/core/client/api/images.py +6 -0
  33. withruntime-0.8.1/withruntime/blaxel/core/client/api/workspaces.py +6 -0
  34. withruntime-0.8.1/withruntime/blaxel/core/client/client.py +3 -0
  35. withruntime-0.8.1/withruntime/blaxel/core/client/models/__init__.py +17 -0
  36. withruntime-0.8.1/withruntime/blaxel/core/client/models/create_job_execution_request.py +3 -0
  37. withruntime-0.8.1/withruntime/blaxel/core/client/models/create_job_execution_request_env.py +3 -0
  38. withruntime-0.8.1/withruntime/blaxel/core/client/models/env.py +3 -0
  39. withruntime-0.8.1/withruntime/blaxel/core/client/models/function.py +3 -0
  40. withruntime-0.8.1/withruntime/blaxel/core/client/models/function_runtime.py +3 -0
  41. withruntime-0.8.1/withruntime/blaxel/core/client/models/function_spec.py +3 -0
  42. withruntime-0.8.1/withruntime/blaxel/core/client/models/metadata.py +3 -0
  43. withruntime-0.8.1/withruntime/blaxel/core/client/models/workspace.py +3 -0
  44. withruntime-0.8.1/withruntime/blaxel/core/client/types.py +3 -0
  45. withruntime-0.8.1/withruntime/blaxel/core/common.py +3 -0
  46. withruntime-0.8.1/withruntime/blaxel/core/drive.py +3 -0
  47. withruntime-0.8.1/withruntime/blaxel/core/jobs.py +6 -0
  48. withruntime-0.8.1/withruntime/blaxel/core/sandbox/__init__.py +9 -0
  49. withruntime-0.8.1/withruntime/blaxel/core/sandbox/types.py +6 -0
  50. withruntime-0.8.1/withruntime/blaxel/crewai.py +3 -0
  51. withruntime-0.8.1/withruntime/blaxel/googleadk.py +3 -0
  52. withruntime-0.8.1/withruntime/blaxel/langgraph.py +3 -0
  53. withruntime-0.8.1/withruntime/blaxel/livekit.py +3 -0
  54. withruntime-0.8.1/withruntime/blaxel/llamaindex.py +3 -0
  55. withruntime-0.8.1/withruntime/blaxel/openai.py +3 -0
  56. withruntime-0.8.1/withruntime/blaxel/pydantic.py +3 -0
  57. withruntime-0.8.1/withruntime/blaxel/telemetry.py +2 -0
  58. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/harbor.py +2 -2
  59. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime.egg-info/PKG-INFO +82 -1
  60. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime.egg-info/SOURCES.txt +48 -0
  61. withruntime-0.7.1/withruntime/_version.py +0 -1
  62. {withruntime-0.7.1 → withruntime-0.8.1}/LICENSE +0 -0
  63. {withruntime-0.7.1 → withruntime-0.8.1}/setup.cfg +0 -0
  64. {withruntime-0.7.1 → withruntime-0.8.1}/tests/test_account_errors.py +0 -0
  65. {withruntime-0.7.1 → withruntime-0.8.1}/tests/test_async_stream_cleanup.py +0 -0
  66. {withruntime-0.7.1 → withruntime-0.8.1}/tests/test_audit.py +0 -0
  67. {withruntime-0.7.1 → withruntime-0.8.1}/tests/test_billing.py +0 -0
  68. {withruntime-0.7.1 → withruntime-0.8.1}/tests/test_capacity_wait.py +0 -0
  69. {withruntime-0.7.1 → withruntime-0.8.1}/tests/test_daytona.py +0 -0
  70. {withruntime-0.7.1 → withruntime-0.8.1}/tests/test_deepagents.py +0 -0
  71. {withruntime-0.7.1 → withruntime-0.8.1}/tests/test_e2b_code_interpreter.py +0 -0
  72. {withruntime-0.7.1 → withruntime-0.8.1}/tests/test_e2b_sandbox.py +0 -0
  73. {withruntime-0.7.1 → withruntime-0.8.1}/tests/test_eval_sandbox.py +0 -0
  74. {withruntime-0.7.1 → withruntime-0.8.1}/tests/test_exec_stream.py +0 -0
  75. {withruntime-0.7.1 → withruntime-0.8.1}/tests/test_files_download.py +0 -0
  76. {withruntime-0.7.1 → withruntime-0.8.1}/tests/test_files_mode.py +0 -0
  77. {withruntime-0.7.1 → withruntime-0.8.1}/tests/test_harbor.py +0 -0
  78. {withruntime-0.7.1 → withruntime-0.8.1}/tests/test_identity_token.py +0 -0
  79. {withruntime-0.7.1 → withruntime-0.8.1}/tests/test_images_v2.py +0 -0
  80. {withruntime-0.7.1 → withruntime-0.8.1}/tests/test_images_volumes_interpreter.py +0 -0
  81. {withruntime-0.7.1 → withruntime-0.8.1}/tests/test_inspect_ai.py +0 -0
  82. {withruntime-0.7.1 → withruntime-0.8.1}/tests/test_late_answer.py +0 -0
  83. {withruntime-0.7.1 → withruntime-0.8.1}/tests/test_lifecycle_settings.py +0 -0
  84. {withruntime-0.7.1 → withruntime-0.8.1}/tests/test_limits.py +0 -0
  85. {withruntime-0.7.1 → withruntime-0.8.1}/tests/test_mounts.py +0 -0
  86. {withruntime-0.7.1 → withruntime-0.8.1}/tests/test_network_funding.py +0 -0
  87. {withruntime-0.7.1 → withruntime-0.8.1}/tests/test_network_products.py +0 -0
  88. {withruntime-0.7.1 → withruntime-0.8.1}/tests/test_observability.py +0 -0
  89. {withruntime-0.7.1 → withruntime-0.8.1}/tests/test_openai_agents.py +0 -0
  90. {withruntime-0.7.1 → withruntime-0.8.1}/tests/test_previews_network_desktop.py +0 -0
  91. {withruntime-0.7.1 → withruntime-0.8.1}/tests/test_proxy.py +0 -0
  92. {withruntime-0.7.1 → withruntime-0.8.1}/tests/test_referrals.py +0 -0
  93. {withruntime-0.7.1 → withruntime-0.8.1}/tests/test_secrets.py +0 -0
  94. {withruntime-0.7.1 → withruntime-0.8.1}/tests/test_snapshot_after_fork.py +0 -0
  95. {withruntime-0.7.1 → withruntime-0.8.1}/tests/test_sso.py +0 -0
  96. {withruntime-0.7.1 → withruntime-0.8.1}/tests/test_switching.py +0 -0
  97. {withruntime-0.7.1 → withruntime-0.8.1}/tests/test_tools.py +0 -0
  98. {withruntime-0.7.1 → withruntime-0.8.1}/tests/test_vercel.py +0 -0
  99. {withruntime-0.7.1 → withruntime-0.8.1}/tests/test_volume_backups.py +0 -0
  100. {withruntime-0.7.1 → withruntime-0.8.1}/tests/test_wake_awake.py +0 -0
  101. {withruntime-0.7.1 → withruntime-0.8.1}/tests/test_wallet.py +0 -0
  102. {withruntime-0.7.1 → withruntime-0.8.1}/tests/test_watch.py +0 -0
  103. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/__init__.py +0 -0
  104. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/_async_products/__init__.py +0 -0
  105. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/_async_products/audit.py +0 -0
  106. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/_async_products/billing.py +0 -0
  107. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/_async_products/desktop.py +0 -0
  108. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/_async_products/images.py +0 -0
  109. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/_async_products/interpreter.py +0 -0
  110. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/_async_products/limits.py +0 -0
  111. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/_async_products/mcp.py +0 -0
  112. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/_async_products/mounts.py +0 -0
  113. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/_async_products/network.py +0 -0
  114. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/_async_products/network_products.py +0 -0
  115. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/_async_products/observability.py +0 -0
  116. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/_async_products/previews.py +0 -0
  117. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/_async_products/referrals.py +0 -0
  118. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/_async_products/secrets.py +0 -0
  119. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/_async_products/sso.py +0 -0
  120. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/_async_products/switching.py +0 -0
  121. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/_async_products/volumes.py +0 -0
  122. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/_async_products/watch.py +0 -0
  123. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/_clock.py +0 -0
  124. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/_connection.py +0 -0
  125. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/_errors.py +0 -0
  126. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/_proxy.py +0 -0
  127. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/_sync_products/__init__.py +0 -0
  128. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/_sync_products/audit.py +0 -0
  129. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/_sync_products/billing.py +0 -0
  130. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/_sync_products/desktop.py +0 -0
  131. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/_sync_products/images.py +0 -0
  132. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/_sync_products/interpreter.py +0 -0
  133. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/_sync_products/limits.py +0 -0
  134. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/_sync_products/mcp.py +0 -0
  135. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/_sync_products/mounts.py +0 -0
  136. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/_sync_products/network.py +0 -0
  137. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/_sync_products/network_products.py +0 -0
  138. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/_sync_products/observability.py +0 -0
  139. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/_sync_products/previews.py +0 -0
  140. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/_sync_products/referrals.py +0 -0
  141. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/_sync_products/secrets.py +0 -0
  142. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/_sync_products/sso.py +0 -0
  143. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/_sync_products/switching.py +0 -0
  144. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/_sync_products/volumes.py +0 -0
  145. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/_sync_products/watch.py +0 -0
  146. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/_tunnel.py +0 -0
  147. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/_ws.py +0 -0
  148. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/daytona/__init__.py +0 -0
  149. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/daytona/_async_daytona.py +0 -0
  150. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/daytona/_async_io.py +0 -0
  151. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/daytona/_core.py +0 -0
  152. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/daytona/_sync_daytona.py +0 -0
  153. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/daytona/_sync_io.py +0 -0
  154. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/deepagents.py +0 -0
  155. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/e2b/__init__.py +0 -0
  156. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/e2b/_async_io.py +0 -0
  157. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/e2b/_async_sandbox.py +0 -0
  158. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/e2b/_core.py +0 -0
  159. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/e2b/_sync_io.py +0 -0
  160. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/e2b/_sync_sandbox.py +0 -0
  161. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/e2b/code_interpreter/__init__.py +0 -0
  162. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/e2b/code_interpreter/_async_ci.py +0 -0
  163. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/e2b/code_interpreter/_models.py +0 -0
  164. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/e2b/code_interpreter/_sync_ci.py +0 -0
  165. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/inspect_ai.py +0 -0
  166. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/openai_agents.py +0 -0
  167. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/tools.py +0 -0
  168. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/vercel/__init__.py +0 -0
  169. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/vercel/_async_io.py +0 -0
  170. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/vercel/_async_sandbox.py +0 -0
  171. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/vercel/_core.py +0 -0
  172. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/vercel/_sync_io.py +0 -0
  173. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/vercel/_sync_sandbox.py +0 -0
  174. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/vercel/api.py +0 -0
  175. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/vercel/sandbox/__init__.py +0 -0
  176. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/vercel/sandbox/sync.py +0 -0
  177. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/wallet.py +0 -0
  178. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime/webhooks.py +0 -0
  179. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime.egg-info/dependency_links.txt +0 -0
  180. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime.egg-info/entry_points.txt +0 -0
  181. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime.egg-info/requires.txt +0 -0
  182. {withruntime-0.7.1 → withruntime-0.8.1}/withruntime.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: withruntime
3
- Version: 0.7.1
3
+ Version: 0.8.1
4
4
  Summary: Runtime Cloud: one client (sync and async) for every Runtime product. Sandboxes first.
5
5
  License: Apache-2.0
6
6
  Project-URL: Homepage, https://withruntime.com
@@ -133,6 +133,87 @@ use instead. The sync modules are generated from the async ones by
133
133
  `scripts/generate_dropin_sync.py`. `DAYTONA.md` and `VERCEL.md` in the
134
134
  JavaScript package list every mapping and gap.
135
135
 
136
+ ## Code written for Blaxel
137
+
138
+ `withruntime.blaxel` runs code written for Blaxel's Python SDK (`blaxel`
139
+ 0.4.11) on Runtime. Change the import and set `RUNTIME_API_KEY`, or run
140
+ `npx withruntime login` once:
141
+
142
+ ```python no-run
143
+ from withruntime.blaxel import SandboxInstance # was: from blaxel.core import SandboxInstance
144
+ from withruntime.blaxel import SyncSandboxInstance # was: from blaxel.core import SyncSandboxInstance
145
+ ```
146
+
147
+ `withruntime.blaxel.core` holds the same names, so replacing `blaxel.` with
148
+ `withruntime.blaxel.` works too. A Runtime key in `BL_API_KEY` is used; a
149
+ Blaxel key is never sent anywhere.
150
+
151
+ How it maps:
152
+
153
+ - **Sandboxes.** `create`, `create_if_not_exists` (one sandbox when two calls
154
+ race), `get`, `get_by_external_id`, `list`, `delete`, `fork`, `snapshots` and
155
+ the `update_*` calls work. `memory` is kept, with one vCPU for every 2048 MB.
156
+ Blaxel's general templates (`blaxel/base-image`, `py-app`, `ts-app`, `node`,
157
+ `jupyter-server`, `docker-in-sandbox`) run on Runtime's image. Any other
158
+ image `ns/name:tag` starts from the ready Runtime image `ns-name:tag`
159
+ (every `/` becomes `-`; the tag is `latest` when none is given), so the
160
+ code keeps Blaxel's image string. A missing one raises `NotSupportedError`
161
+ with the build command, for example `npx withruntime image build
162
+ --dockerfile Dockerfile --name my-company-agent-image -t
163
+ my-company-agent-image:latest`. Volumes mount Runtime volumes of the same
164
+ name. On the free trial a sandbox has at most 4096 MB of memory (2 vCPUs).
165
+ - **Standby.** A sandbox pauses after a minute with no call (Blaxel: about 15
166
+ seconds). It keeps its memory and processes, and wakes on the next command,
167
+ file call or preview visit. `archive` pauses it and keeps its memory too.
168
+ A lease in use is renewed, so a long command is not paused at the hour.
169
+ `keep_alive` raises the idle pause to the process's time limit, or turns it
170
+ off for a process with none. The first call from any client that finds no
171
+ `keep_alive` process running gives the old idle pause back.
172
+ - **How long it is kept.** A paused sandbox with no `ttl` or `lifecycle` is
173
+ kept 365 days. Blaxel keeps it until you delete it. A limit is rounded up to
174
+ whole days of pause. A limit of an hour or less that counts from creation
175
+ also ends the sandbox at that time. On the free trial a paused sandbox is kept
176
+ seven days, the most Blaxel's first tier keeps one.
177
+ - **Envs** reach every process, from any client: they are kept on the
178
+ sandbox, and a process's own `env` wins.
179
+ - **Paths.** `/blaxel`, Blaxel's working directory and `HOME`, is
180
+ `/workspace`. Relative paths and `~` start there.
181
+ - **Processes.** You can find a process by name from any client, as long as
182
+ Runtime still has its record. Runtime keeps the running processes and the
183
+ last 16 that ended.
184
+ - **Previews** are Runtime previews of each port. A private preview's
185
+ `tokens.create(expires_at)` gives a token, which works as Blaxel's
186
+ `X-Blaxel-Preview-Token` header or `bl_preview_token` address parameter.
187
+ `fetch(port)` uses a private preview for you.
188
+ - **Code interpreter.** `CodeInterpreter.run_code` and `create_code_context`
189
+ run on Runtime's interpreter and return Blaxel's result classes.
190
+ - **Errors.** Errors keep Blaxel's classes: `SandboxAPIError`,
191
+ `ResponseError` and `SnapshotAPIError`. Each also carries Runtime's `code`,
192
+ `hint` and `request_id`.
193
+ - **Runtime fields.** `runtime_create={...}` passes Runtime's own create
194
+ fields, for example `{"funding": "trial"}`. `sandbox.withruntime` is the
195
+ Runtime sandbox underneath.
196
+
197
+ Differences you can hit:
198
+
199
+ - Commands run as root, as on Blaxel, with the sandbox's `PATH` and `HOME`
200
+ (`/workspace`). File calls act as the sandbox user and fall back to `sudo`
201
+ where only root may: they reach files a root process made, including private
202
+ ones, and a file they write is the sandbox user's.
203
+ - A sandbox is visible only to the key that created it: another key of the
204
+ same account gets 404 for it
205
+ ([teams](https://withruntime.com/docs/teams#keys-in-a-team)).
206
+ - Public previews need a paid sandbox.
207
+ - A process's `pid` is Runtime's process id, not an operating-system number.
208
+
209
+ These raise `NotSupportedError` before anything happens, naming what to use:
210
+ regions outside the US, read-only and ephemeral volumes, drives, `extra_args`
211
+ other than `iptables`, egress and subnet settings, preview headers, custom
212
+ domains and preview expiry, restoring a snapshot in place (fork from it
213
+ instead), sessions, codegen, `system`, schedules, and Blaxel's agents, models,
214
+ tools, jobs and applications. The sync module is generated from the async one
215
+ by `scripts/generate_dropin_sync.py`.
216
+
136
217
  ## Agent frameworks
137
218
 
138
219
  `withruntime.openai_agents` is a sandbox client for the OpenAI Agents SDK's
@@ -110,6 +110,87 @@ use instead. The sync modules are generated from the async ones by
110
110
  `scripts/generate_dropin_sync.py`. `DAYTONA.md` and `VERCEL.md` in the
111
111
  JavaScript package list every mapping and gap.
112
112
 
113
+ ## Code written for Blaxel
114
+
115
+ `withruntime.blaxel` runs code written for Blaxel's Python SDK (`blaxel`
116
+ 0.4.11) on Runtime. Change the import and set `RUNTIME_API_KEY`, or run
117
+ `npx withruntime login` once:
118
+
119
+ ```python no-run
120
+ from withruntime.blaxel import SandboxInstance # was: from blaxel.core import SandboxInstance
121
+ from withruntime.blaxel import SyncSandboxInstance # was: from blaxel.core import SyncSandboxInstance
122
+ ```
123
+
124
+ `withruntime.blaxel.core` holds the same names, so replacing `blaxel.` with
125
+ `withruntime.blaxel.` works too. A Runtime key in `BL_API_KEY` is used; a
126
+ Blaxel key is never sent anywhere.
127
+
128
+ How it maps:
129
+
130
+ - **Sandboxes.** `create`, `create_if_not_exists` (one sandbox when two calls
131
+ race), `get`, `get_by_external_id`, `list`, `delete`, `fork`, `snapshots` and
132
+ the `update_*` calls work. `memory` is kept, with one vCPU for every 2048 MB.
133
+ Blaxel's general templates (`blaxel/base-image`, `py-app`, `ts-app`, `node`,
134
+ `jupyter-server`, `docker-in-sandbox`) run on Runtime's image. Any other
135
+ image `ns/name:tag` starts from the ready Runtime image `ns-name:tag`
136
+ (every `/` becomes `-`; the tag is `latest` when none is given), so the
137
+ code keeps Blaxel's image string. A missing one raises `NotSupportedError`
138
+ with the build command, for example `npx withruntime image build
139
+ --dockerfile Dockerfile --name my-company-agent-image -t
140
+ my-company-agent-image:latest`. Volumes mount Runtime volumes of the same
141
+ name. On the free trial a sandbox has at most 4096 MB of memory (2 vCPUs).
142
+ - **Standby.** A sandbox pauses after a minute with no call (Blaxel: about 15
143
+ seconds). It keeps its memory and processes, and wakes on the next command,
144
+ file call or preview visit. `archive` pauses it and keeps its memory too.
145
+ A lease in use is renewed, so a long command is not paused at the hour.
146
+ `keep_alive` raises the idle pause to the process's time limit, or turns it
147
+ off for a process with none. The first call from any client that finds no
148
+ `keep_alive` process running gives the old idle pause back.
149
+ - **How long it is kept.** A paused sandbox with no `ttl` or `lifecycle` is
150
+ kept 365 days. Blaxel keeps it until you delete it. A limit is rounded up to
151
+ whole days of pause. A limit of an hour or less that counts from creation
152
+ also ends the sandbox at that time. On the free trial a paused sandbox is kept
153
+ seven days, the most Blaxel's first tier keeps one.
154
+ - **Envs** reach every process, from any client: they are kept on the
155
+ sandbox, and a process's own `env` wins.
156
+ - **Paths.** `/blaxel`, Blaxel's working directory and `HOME`, is
157
+ `/workspace`. Relative paths and `~` start there.
158
+ - **Processes.** You can find a process by name from any client, as long as
159
+ Runtime still has its record. Runtime keeps the running processes and the
160
+ last 16 that ended.
161
+ - **Previews** are Runtime previews of each port. A private preview's
162
+ `tokens.create(expires_at)` gives a token, which works as Blaxel's
163
+ `X-Blaxel-Preview-Token` header or `bl_preview_token` address parameter.
164
+ `fetch(port)` uses a private preview for you.
165
+ - **Code interpreter.** `CodeInterpreter.run_code` and `create_code_context`
166
+ run on Runtime's interpreter and return Blaxel's result classes.
167
+ - **Errors.** Errors keep Blaxel's classes: `SandboxAPIError`,
168
+ `ResponseError` and `SnapshotAPIError`. Each also carries Runtime's `code`,
169
+ `hint` and `request_id`.
170
+ - **Runtime fields.** `runtime_create={...}` passes Runtime's own create
171
+ fields, for example `{"funding": "trial"}`. `sandbox.withruntime` is the
172
+ Runtime sandbox underneath.
173
+
174
+ Differences you can hit:
175
+
176
+ - Commands run as root, as on Blaxel, with the sandbox's `PATH` and `HOME`
177
+ (`/workspace`). File calls act as the sandbox user and fall back to `sudo`
178
+ where only root may: they reach files a root process made, including private
179
+ ones, and a file they write is the sandbox user's.
180
+ - A sandbox is visible only to the key that created it: another key of the
181
+ same account gets 404 for it
182
+ ([teams](https://withruntime.com/docs/teams#keys-in-a-team)).
183
+ - Public previews need a paid sandbox.
184
+ - A process's `pid` is Runtime's process id, not an operating-system number.
185
+
186
+ These raise `NotSupportedError` before anything happens, naming what to use:
187
+ regions outside the US, read-only and ephemeral volumes, drives, `extra_args`
188
+ other than `iptables`, egress and subnet settings, preview headers, custom
189
+ domains and preview expiry, restoring a snapshot in place (fork from it
190
+ instead), sessions, codegen, `system`, schedules, and Blaxel's agents, models,
191
+ tools, jobs and applications. The sync module is generated from the async one
192
+ by `scripts/generate_dropin_sync.py`.
193
+
113
194
  ## Agent frameworks
114
195
 
115
196
  `withruntime.openai_agents` is a sandbox client for the OpenAI Agents SDK's
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "withruntime"
7
- version = "0.7.1"
7
+ version = "0.8.1"
8
8
  description = "Runtime Cloud: one client (sync and async) for every Runtime product. Sandboxes first."
9
9
  readme = "README.md"
10
10
  license = { text = "Apache-2.0" }