sequence-base 0.3.0__py3-none-any.whl

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 (84) hide show
  1. sequence_base/__init__.py +134 -0
  2. sequence_base/auth.py +35 -0
  3. sequence_base/codec/__init__.py +25 -0
  4. sequence_base/codec/image.py +136 -0
  5. sequence_base/codec/resize.py +147 -0
  6. sequence_base/constants/__init__.py +0 -0
  7. sequence_base/constants/env.py +14 -0
  8. sequence_base/constants/headers.py +5 -0
  9. sequence_base/constants/version.py +9 -0
  10. sequence_base/contract/__init__.py +111 -0
  11. sequence_base/contract/accounts.py +93 -0
  12. sequence_base/contract/act.py +89 -0
  13. sequence_base/contract/benchmarks.py +130 -0
  14. sequence_base/contract/connect.py +53 -0
  15. sequence_base/contract/deployments.py +197 -0
  16. sequence_base/contract/errors.py +45 -0
  17. sequence_base/contract/eval.py +201 -0
  18. sequence_base/contract/flags.py +92 -0
  19. sequence_base/contract/policy.py +172 -0
  20. sequence_base/errors/__init__.py +0 -0
  21. sequence_base/errors/transport.py +36 -0
  22. sequence_base/obs/__init__.py +0 -0
  23. sequence_base/obs/log.py +57 -0
  24. sequence_base/obs/rid.py +31 -0
  25. sequence_base/schema_export.py +238 -0
  26. sequence_base/schemas/ActionChunk.json +102 -0
  27. sequence_base/schemas/ActionContract.json +43 -0
  28. sequence_base/schemas/ActionStep.json +23 -0
  29. sequence_base/schemas/AdapterTransform.json +42 -0
  30. sequence_base/schemas/Autoscaler.json +43 -0
  31. sequence_base/schemas/BenchmarkRegisterRequest.json +302 -0
  32. sequence_base/schemas/BenchmarkSpec.json +401 -0
  33. sequence_base/schemas/BootstrapResponse.json +76 -0
  34. sequence_base/schemas/ClampInfo.json +27 -0
  35. sequence_base/schemas/CodeBundle.json +27 -0
  36. sequence_base/schemas/Concurrency.json +21 -0
  37. sequence_base/schemas/Conditions.json +59 -0
  38. sequence_base/schemas/ConnectRequest.json +16 -0
  39. sequence_base/schemas/ConnectResponse.json +81 -0
  40. sequence_base/schemas/DeploymentAccepted.json +22 -0
  41. sequence_base/schemas/DeploymentPolicy.json +101 -0
  42. sequence_base/schemas/DeploymentRequest.json +467 -0
  43. sequence_base/schemas/DeploymentStatusResponse.json +45 -0
  44. sequence_base/schemas/ErrorBody.json +32 -0
  45. sequence_base/schemas/Estimate.json +25 -0
  46. sequence_base/schemas/EvalDryRunResponse.json +41 -0
  47. sequence_base/schemas/EvalReport.json +179 -0
  48. sequence_base/schemas/EvalRequest.json +111 -0
  49. sequence_base/schemas/EvalResponse.json +88 -0
  50. sequence_base/schemas/ImageFrame.json +36 -0
  51. sequence_base/schemas/ImageSpec.json +123 -0
  52. sequence_base/schemas/ImageStepApt.json +18 -0
  53. sequence_base/schemas/ImageStepEnv.json +18 -0
  54. sequence_base/schemas/ImageStepRun.json +18 -0
  55. sequence_base/schemas/ImageStepUvPip.json +18 -0
  56. sequence_base/schemas/Lease.json +28 -0
  57. sequence_base/schemas/LossyTransform.json +21 -0
  58. sequence_base/schemas/MetricAgg.json +87 -0
  59. sequence_base/schemas/Observation.json +133 -0
  60. sequence_base/schemas/PolicyRegistration.json +438 -0
  61. sequence_base/schemas/PolicySpec.json +346 -0
  62. sequence_base/schemas/Proprioception.json +67 -0
  63. sequence_base/schemas/RenderSpec.json +22 -0
  64. sequence_base/schemas/Resources.json +29 -0
  65. sequence_base/schemas/RolloutResult.json +59 -0
  66. sequence_base/schemas/SecretCreateRequest.json +25 -0
  67. sequence_base/schemas/SecretInfo.json +44 -0
  68. sequence_base/schemas/SecretRef.json +16 -0
  69. sequence_base/schemas/SeqFlags.json +33 -0
  70. sequence_base/schemas/Step.json +68 -0
  71. sequence_base/schemas/SuiteAgg.json +26 -0
  72. sequence_base/schemas/TaskAgg.json +26 -0
  73. sequence_base/schemas/Timeouts.json +20 -0
  74. sequence_base/schemas/UsageReport.json +38 -0
  75. sequence_base/schemas/Variant.json +24 -0
  76. sequence_base/schemas/VolumeAttach.json +26 -0
  77. sequence_base/schemas/VolumeMount.json +21 -0
  78. sequence_base/schemas/VolumeRef.json +28 -0
  79. sequence_base/schemas/WarmingError.json +50 -0
  80. sequence_base/telemetry/__init__.py +13 -0
  81. sequence_base/telemetry/events.py +101 -0
  82. sequence_base-0.3.0.dist-info/METADATA +12 -0
  83. sequence_base-0.3.0.dist-info/RECORD +84 -0
  84. sequence_base-0.3.0.dist-info/WHEEL +4 -0
@@ -0,0 +1,87 @@
1
+ {
2
+ "$defs": {
3
+ "SuiteAgg": {
4
+ "additionalProperties": false,
5
+ "description": "Per-suite aggregate of ONE user-named metric — structured detail, not a bare dict. `value` is the\nmetric aggregated over that suite; the platform does not name or interpret the metric.",
6
+ "properties": {
7
+ "n": {
8
+ "title": "N",
9
+ "type": "integer"
10
+ },
11
+ "suite": {
12
+ "title": "Suite",
13
+ "type": "string"
14
+ },
15
+ "value": {
16
+ "title": "Value",
17
+ "type": "number"
18
+ }
19
+ },
20
+ "required": [
21
+ "suite",
22
+ "value",
23
+ "n"
24
+ ],
25
+ "title": "SuiteAgg",
26
+ "type": "object"
27
+ },
28
+ "TaskAgg": {
29
+ "additionalProperties": false,
30
+ "description": "Per-task aggregate of ONE user-named metric — structured detail, not a bare dict.",
31
+ "properties": {
32
+ "n": {
33
+ "title": "N",
34
+ "type": "integer"
35
+ },
36
+ "task": {
37
+ "title": "Task",
38
+ "type": "string"
39
+ },
40
+ "value": {
41
+ "title": "Value",
42
+ "type": "number"
43
+ }
44
+ },
45
+ "required": [
46
+ "task",
47
+ "value",
48
+ "n"
49
+ ],
50
+ "title": "TaskAgg",
51
+ "type": "object"
52
+ }
53
+ },
54
+ "additionalProperties": false,
55
+ "description": "The aggregate of one user-named metric key across the eval — overall plus per-suite / per-task\nbreakdowns and the sample count. The platform aggregates whatever the user returned in `Step.metrics`;\nit neither defines nor injects `success_rate` (success is just one key the user may or may not name).",
56
+ "properties": {
57
+ "n": {
58
+ "title": "N",
59
+ "type": "integer"
60
+ },
61
+ "overall": {
62
+ "title": "Overall",
63
+ "type": "number"
64
+ },
65
+ "per_suite": {
66
+ "items": {
67
+ "$ref": "#/$defs/SuiteAgg"
68
+ },
69
+ "title": "Per Suite",
70
+ "type": "array"
71
+ },
72
+ "per_task": {
73
+ "items": {
74
+ "$ref": "#/$defs/TaskAgg"
75
+ },
76
+ "title": "Per Task",
77
+ "type": "array"
78
+ }
79
+ },
80
+ "required": [
81
+ "overall",
82
+ "n"
83
+ ],
84
+ "title": "MetricAgg",
85
+ "type": "object",
86
+ "x-contract-version": "0.4.1"
87
+ }
@@ -0,0 +1,133 @@
1
+ {
2
+ "$defs": {
3
+ "ImageFrame": {
4
+ "additionalProperties": false,
5
+ "description": "One camera frame at one instant. Repeat a `view` (ordered by timestamp_ms) for a series.",
6
+ "properties": {
7
+ "data": {
8
+ "description": "Base64-encoded image (PNG or JPEG). URLs are not fetched.",
9
+ "title": "Data",
10
+ "type": "string"
11
+ },
12
+ "timestamp_ms": {
13
+ "anyOf": [
14
+ {
15
+ "type": "integer"
16
+ },
17
+ {
18
+ "type": "null"
19
+ }
20
+ ],
21
+ "default": null,
22
+ "description": "Orders multiple frames of a view; array order used when omitted",
23
+ "title": "Timestamp Ms"
24
+ },
25
+ "view": {
26
+ "description": "Logical view name, e.g. top / wrist_left / exterior_1. May appear more than once to express a time series",
27
+ "title": "View",
28
+ "type": "string"
29
+ }
30
+ },
31
+ "required": [
32
+ "view",
33
+ "data"
34
+ ],
35
+ "title": "ImageFrame",
36
+ "type": "object"
37
+ },
38
+ "Proprioception": {
39
+ "additionalProperties": false,
40
+ "description": "Proprioceptive state. Only joint_positions is required; the rest is zero-padded per model.",
41
+ "properties": {
42
+ "end_effector_pose": {
43
+ "anyOf": [
44
+ {
45
+ "items": {
46
+ "type": "number"
47
+ },
48
+ "maxItems": 7,
49
+ "minItems": 7,
50
+ "type": "array"
51
+ },
52
+ {
53
+ "type": "null"
54
+ }
55
+ ],
56
+ "default": null,
57
+ "title": "End Effector Pose"
58
+ },
59
+ "gripper": {
60
+ "anyOf": [
61
+ {
62
+ "items": {
63
+ "type": "number"
64
+ },
65
+ "type": "array"
66
+ },
67
+ {
68
+ "type": "null"
69
+ }
70
+ ],
71
+ "default": null,
72
+ "title": "Gripper"
73
+ },
74
+ "joint_positions": {
75
+ "description": "Joint angles, in radians",
76
+ "items": {
77
+ "type": "number"
78
+ },
79
+ "title": "Joint Positions",
80
+ "type": "array"
81
+ },
82
+ "joint_velocities": {
83
+ "anyOf": [
84
+ {
85
+ "items": {
86
+ "type": "number"
87
+ },
88
+ "type": "array"
89
+ },
90
+ {
91
+ "type": "null"
92
+ }
93
+ ],
94
+ "default": null,
95
+ "title": "Joint Velocities"
96
+ }
97
+ },
98
+ "required": [
99
+ "joint_positions"
100
+ ],
101
+ "title": "Proprioception",
102
+ "type": "object"
103
+ }
104
+ },
105
+ "additionalProperties": false,
106
+ "description": "The robot's world at one instant: camera frames + proprioception + a language instruction.",
107
+ "properties": {
108
+ "images": {
109
+ "items": {
110
+ "$ref": "#/$defs/ImageFrame"
111
+ },
112
+ "maxItems": 256,
113
+ "minItems": 1,
114
+ "title": "Images",
115
+ "type": "array"
116
+ },
117
+ "instruction": {
118
+ "title": "Instruction",
119
+ "type": "string"
120
+ },
121
+ "proprioception": {
122
+ "$ref": "#/$defs/Proprioception"
123
+ }
124
+ },
125
+ "required": [
126
+ "images",
127
+ "proprioception",
128
+ "instruction"
129
+ ],
130
+ "title": "Observation",
131
+ "type": "object",
132
+ "x-contract-version": "0.4.1"
133
+ }
@@ -0,0 +1,438 @@
1
+ {
2
+ "$defs": {
3
+ "ActionContract": {
4
+ "additionalProperties": false,
5
+ "description": "The fixed obs→ActionChunk contract a policy promises. Every field required; `action_space` reuses\ncontract 4's enum (not a free string). Each ActionChunk echoes exactly these invariants back.",
6
+ "properties": {
7
+ "action_dim": {
8
+ "title": "Action Dim",
9
+ "type": "integer"
10
+ },
11
+ "action_space": {
12
+ "$ref": "#/$defs/ActionSpace"
13
+ },
14
+ "control_frequency_hz": {
15
+ "title": "Control Frequency Hz",
16
+ "type": "number"
17
+ },
18
+ "robot": {
19
+ "title": "Robot",
20
+ "type": "string"
21
+ }
22
+ },
23
+ "required": [
24
+ "robot",
25
+ "action_space",
26
+ "action_dim",
27
+ "control_frequency_hz"
28
+ ],
29
+ "title": "ActionContract",
30
+ "type": "object"
31
+ },
32
+ "ActionSpace": {
33
+ "description": "Must be explicit: the same floats mean opposite things across spaces — executing an absolute\njoint position as a delta flings the arm into its limit stops. {schema.py:124}",
34
+ "enum": [
35
+ "joint_absolute",
36
+ "joint_delta",
37
+ "ee_absolute",
38
+ "ee_delta"
39
+ ],
40
+ "title": "ActionSpace",
41
+ "type": "string"
42
+ },
43
+ "Concurrency": {
44
+ "additionalProperties": false,
45
+ "description": "= Modal max/target_concurrent_inputs. Both required.",
46
+ "properties": {
47
+ "max_inputs": {
48
+ "title": "Max Inputs",
49
+ "type": "integer"
50
+ },
51
+ "target_inputs": {
52
+ "title": "Target Inputs",
53
+ "type": "integer"
54
+ }
55
+ },
56
+ "required": [
57
+ "max_inputs",
58
+ "target_inputs"
59
+ ],
60
+ "title": "Concurrency",
61
+ "type": "object"
62
+ },
63
+ "ImageSpec": {
64
+ "additionalProperties": false,
65
+ "description": "Declarative image (gateway builds it via Cloud Build) — = Modal `Image` message. Exactly one of\n`base` (a pullable registry ref) or `dockerfile` (inline Dockerfile source) is set — the Dockerfile\nis its OWN component, never smuggled into the `base` string (S2 goal 4), so the gateway can tell a\nregistry build from a Dockerfile build. `steps` is an ordered list of the four-variant union above\n(a bare list[dict] is refused), extending whichever base was chosen.",
66
+ "properties": {
67
+ "base": {
68
+ "anyOf": [
69
+ {
70
+ "type": "string"
71
+ },
72
+ {
73
+ "type": "null"
74
+ }
75
+ ],
76
+ "default": null,
77
+ "title": "Base"
78
+ },
79
+ "dockerfile": {
80
+ "anyOf": [
81
+ {
82
+ "type": "string"
83
+ },
84
+ {
85
+ "type": "null"
86
+ }
87
+ ],
88
+ "default": null,
89
+ "title": "Dockerfile"
90
+ },
91
+ "steps": {
92
+ "items": {
93
+ "anyOf": [
94
+ {
95
+ "$ref": "#/$defs/ImageStepUvPip"
96
+ },
97
+ {
98
+ "$ref": "#/$defs/ImageStepApt"
99
+ },
100
+ {
101
+ "$ref": "#/$defs/ImageStepEnv"
102
+ },
103
+ {
104
+ "$ref": "#/$defs/ImageStepRun"
105
+ }
106
+ ]
107
+ },
108
+ "title": "Steps",
109
+ "type": "array"
110
+ }
111
+ },
112
+ "title": "ImageSpec",
113
+ "type": "object"
114
+ },
115
+ "ImageStepApt": {
116
+ "additionalProperties": false,
117
+ "properties": {
118
+ "apt_install": {
119
+ "items": {
120
+ "type": "string"
121
+ },
122
+ "title": "Apt Install",
123
+ "type": "array"
124
+ }
125
+ },
126
+ "required": [
127
+ "apt_install"
128
+ ],
129
+ "title": "ImageStepApt",
130
+ "type": "object"
131
+ },
132
+ "ImageStepEnv": {
133
+ "additionalProperties": false,
134
+ "properties": {
135
+ "env": {
136
+ "additionalProperties": {
137
+ "type": "string"
138
+ },
139
+ "title": "Env",
140
+ "type": "object"
141
+ }
142
+ },
143
+ "required": [
144
+ "env"
145
+ ],
146
+ "title": "ImageStepEnv",
147
+ "type": "object"
148
+ },
149
+ "ImageStepRun": {
150
+ "additionalProperties": false,
151
+ "properties": {
152
+ "run_commands": {
153
+ "items": {
154
+ "type": "string"
155
+ },
156
+ "title": "Run Commands",
157
+ "type": "array"
158
+ }
159
+ },
160
+ "required": [
161
+ "run_commands"
162
+ ],
163
+ "title": "ImageStepRun",
164
+ "type": "object"
165
+ },
166
+ "ImageStepUvPip": {
167
+ "additionalProperties": false,
168
+ "properties": {
169
+ "uv_pip_install": {
170
+ "items": {
171
+ "type": "string"
172
+ },
173
+ "title": "Uv Pip Install",
174
+ "type": "array"
175
+ }
176
+ },
177
+ "required": [
178
+ "uv_pip_install"
179
+ ],
180
+ "title": "ImageStepUvPip",
181
+ "type": "object"
182
+ },
183
+ "PolicySpec": {
184
+ "additionalProperties": false,
185
+ "description": "What `@seq.policy(...)` accrues — a policy's complete infra declaration, losslessly. `action` is\nrequired (no default): a policy without an obs→ActionChunk contract is not deployable.",
186
+ "properties": {
187
+ "action": {
188
+ "$ref": "#/$defs/ActionContract"
189
+ },
190
+ "buffer_containers": {
191
+ "anyOf": [
192
+ {
193
+ "type": "integer"
194
+ },
195
+ {
196
+ "type": "null"
197
+ }
198
+ ],
199
+ "default": null,
200
+ "title": "Buffer Containers"
201
+ },
202
+ "concurrency": {
203
+ "anyOf": [
204
+ {
205
+ "$ref": "#/$defs/Concurrency"
206
+ },
207
+ {
208
+ "type": "null"
209
+ }
210
+ ],
211
+ "default": null
212
+ },
213
+ "frames_per_chunk": {
214
+ "anyOf": [
215
+ {
216
+ "type": "integer"
217
+ },
218
+ {
219
+ "type": "null"
220
+ }
221
+ ],
222
+ "default": null,
223
+ "title": "Frames Per Chunk"
224
+ },
225
+ "gpu": {
226
+ "anyOf": [
227
+ {
228
+ "type": "string"
229
+ },
230
+ {
231
+ "items": {
232
+ "type": "string"
233
+ },
234
+ "type": "array"
235
+ }
236
+ ],
237
+ "description": "A GPU type, or a list = cross-provider fallback",
238
+ "title": "Gpu"
239
+ },
240
+ "image": {
241
+ "$ref": "#/$defs/ImageSpec"
242
+ },
243
+ "max_containers": {
244
+ "anyOf": [
245
+ {
246
+ "type": "integer"
247
+ },
248
+ {
249
+ "type": "null"
250
+ }
251
+ ],
252
+ "default": null,
253
+ "title": "Max Containers"
254
+ },
255
+ "min_containers": {
256
+ "default": 0,
257
+ "title": "Min Containers",
258
+ "type": "integer"
259
+ },
260
+ "name": {
261
+ "title": "Name",
262
+ "type": "string"
263
+ },
264
+ "scaledown_window": {
265
+ "default": 600,
266
+ "title": "Scaledown Window",
267
+ "type": "integer"
268
+ },
269
+ "secrets": {
270
+ "items": {
271
+ "$ref": "#/$defs/SecretRef"
272
+ },
273
+ "title": "Secrets",
274
+ "type": "array"
275
+ },
276
+ "streaming": {
277
+ "default": false,
278
+ "title": "Streaming",
279
+ "type": "boolean"
280
+ },
281
+ "volumes": {
282
+ "additionalProperties": {
283
+ "$ref": "#/$defs/VolumeRef"
284
+ },
285
+ "title": "Volumes",
286
+ "type": "object"
287
+ },
288
+ "weights": {
289
+ "description": "Weights URI; scheme restricted to gs:// or hf://",
290
+ "title": "Weights",
291
+ "type": "string"
292
+ }
293
+ },
294
+ "required": [
295
+ "name",
296
+ "gpu",
297
+ "image",
298
+ "weights",
299
+ "action"
300
+ ],
301
+ "title": "PolicySpec",
302
+ "type": "object"
303
+ },
304
+ "SecretRef": {
305
+ "additionalProperties": false,
306
+ "description": "A by-name reference to a secret (PolicySpec.secrets / BenchmarkSpec.secrets). Name only — the\nvalue lives in Secret Manager and is injected at worker bootstrap. Never carries a value.",
307
+ "properties": {
308
+ "name": {
309
+ "title": "Name",
310
+ "type": "string"
311
+ }
312
+ },
313
+ "required": [
314
+ "name"
315
+ ],
316
+ "title": "SecretRef",
317
+ "type": "object"
318
+ },
319
+ "SeqFlags": {
320
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
321
+ "description": "Lifecycle bitmask (IntFlag). One bit per lifecycle entrypoint.",
322
+ "enum": [
323
+ 1,
324
+ 2,
325
+ 4,
326
+ 8,
327
+ 16,
328
+ 1024,
329
+ 4096,
330
+ 8192,
331
+ 16384,
332
+ 32768,
333
+ 65536
334
+ ],
335
+ "title": "SeqFlags",
336
+ "type": "integer",
337
+ "x-contract-version": "0.4.1",
338
+ "x-flag-names": {
339
+ "CHECK": 65536,
340
+ "INFER": 16,
341
+ "LOAD": 2,
342
+ "ON_EPISODE": 1024,
343
+ "PLAN": 4,
344
+ "RESET": 32768,
345
+ "ROLLOUT": 8192,
346
+ "SCORE": 16384,
347
+ "SETUP": 4096,
348
+ "SHUTDOWN": 8,
349
+ "WARMUP": 1
350
+ }
351
+ },
352
+ "VolumeRef": {
353
+ "additionalProperties": false,
354
+ "description": "PolicySpec.volumes value — at least a `uri`; a `mount` may pin the container path.",
355
+ "properties": {
356
+ "mount": {
357
+ "anyOf": [
358
+ {
359
+ "type": "string"
360
+ },
361
+ {
362
+ "type": "null"
363
+ }
364
+ ],
365
+ "default": null,
366
+ "title": "Mount"
367
+ },
368
+ "uri": {
369
+ "title": "Uri",
370
+ "type": "string"
371
+ }
372
+ },
373
+ "required": [
374
+ "uri"
375
+ ],
376
+ "title": "VolumeRef",
377
+ "type": "object"
378
+ }
379
+ },
380
+ "additionalProperties": false,
381
+ "description": "What the harness loader introspects: the spec, the SeqFlags→method-name bindings, and the\n`handler_ref` it importlib-loads the policy class from. From one of these the loader recovers which\nmethod is which lifecycle entrypoint (load / infer / on_episode / plan …).",
382
+ "properties": {
383
+ "bindings": {
384
+ "additionalProperties": {
385
+ "type": "string"
386
+ },
387
+ "description": "lifecycle flag → method name on the handler",
388
+ "propertyNames": {
389
+ "enum": [
390
+ "1",
391
+ "2",
392
+ "4",
393
+ "8",
394
+ "16",
395
+ "1024",
396
+ "4096",
397
+ "8192",
398
+ "16384",
399
+ "32768",
400
+ "65536"
401
+ ],
402
+ "type": "string"
403
+ },
404
+ "title": "Bindings",
405
+ "type": "object"
406
+ },
407
+ "handler_ref": {
408
+ "description": "\"module.path:ClassName\" for importlib load",
409
+ "title": "Handler Ref",
410
+ "type": "string"
411
+ },
412
+ "plan_every_s": {
413
+ "anyOf": [
414
+ {
415
+ "exclusiveMinimum": 0,
416
+ "type": "number"
417
+ },
418
+ {
419
+ "type": "null"
420
+ }
421
+ ],
422
+ "default": null,
423
+ "description": "Seconds between @seq.plan calls; set iff a PLAN binding exists",
424
+ "title": "Plan Every S"
425
+ },
426
+ "spec": {
427
+ "$ref": "#/$defs/PolicySpec"
428
+ }
429
+ },
430
+ "required": [
431
+ "spec",
432
+ "bindings",
433
+ "handler_ref"
434
+ ],
435
+ "title": "PolicyRegistration",
436
+ "type": "object",
437
+ "x-contract-version": "0.4.1"
438
+ }