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,346 @@
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
+ "SecretRef": {
184
+ "additionalProperties": false,
185
+ "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.",
186
+ "properties": {
187
+ "name": {
188
+ "title": "Name",
189
+ "type": "string"
190
+ }
191
+ },
192
+ "required": [
193
+ "name"
194
+ ],
195
+ "title": "SecretRef",
196
+ "type": "object"
197
+ },
198
+ "VolumeRef": {
199
+ "additionalProperties": false,
200
+ "description": "PolicySpec.volumes value — at least a `uri`; a `mount` may pin the container path.",
201
+ "properties": {
202
+ "mount": {
203
+ "anyOf": [
204
+ {
205
+ "type": "string"
206
+ },
207
+ {
208
+ "type": "null"
209
+ }
210
+ ],
211
+ "default": null,
212
+ "title": "Mount"
213
+ },
214
+ "uri": {
215
+ "title": "Uri",
216
+ "type": "string"
217
+ }
218
+ },
219
+ "required": [
220
+ "uri"
221
+ ],
222
+ "title": "VolumeRef",
223
+ "type": "object"
224
+ }
225
+ },
226
+ "additionalProperties": false,
227
+ "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.",
228
+ "properties": {
229
+ "action": {
230
+ "$ref": "#/$defs/ActionContract"
231
+ },
232
+ "buffer_containers": {
233
+ "anyOf": [
234
+ {
235
+ "type": "integer"
236
+ },
237
+ {
238
+ "type": "null"
239
+ }
240
+ ],
241
+ "default": null,
242
+ "title": "Buffer Containers"
243
+ },
244
+ "concurrency": {
245
+ "anyOf": [
246
+ {
247
+ "$ref": "#/$defs/Concurrency"
248
+ },
249
+ {
250
+ "type": "null"
251
+ }
252
+ ],
253
+ "default": null
254
+ },
255
+ "frames_per_chunk": {
256
+ "anyOf": [
257
+ {
258
+ "type": "integer"
259
+ },
260
+ {
261
+ "type": "null"
262
+ }
263
+ ],
264
+ "default": null,
265
+ "title": "Frames Per Chunk"
266
+ },
267
+ "gpu": {
268
+ "anyOf": [
269
+ {
270
+ "type": "string"
271
+ },
272
+ {
273
+ "items": {
274
+ "type": "string"
275
+ },
276
+ "type": "array"
277
+ }
278
+ ],
279
+ "description": "A GPU type, or a list = cross-provider fallback",
280
+ "title": "Gpu"
281
+ },
282
+ "image": {
283
+ "$ref": "#/$defs/ImageSpec"
284
+ },
285
+ "max_containers": {
286
+ "anyOf": [
287
+ {
288
+ "type": "integer"
289
+ },
290
+ {
291
+ "type": "null"
292
+ }
293
+ ],
294
+ "default": null,
295
+ "title": "Max Containers"
296
+ },
297
+ "min_containers": {
298
+ "default": 0,
299
+ "title": "Min Containers",
300
+ "type": "integer"
301
+ },
302
+ "name": {
303
+ "title": "Name",
304
+ "type": "string"
305
+ },
306
+ "scaledown_window": {
307
+ "default": 600,
308
+ "title": "Scaledown Window",
309
+ "type": "integer"
310
+ },
311
+ "secrets": {
312
+ "items": {
313
+ "$ref": "#/$defs/SecretRef"
314
+ },
315
+ "title": "Secrets",
316
+ "type": "array"
317
+ },
318
+ "streaming": {
319
+ "default": false,
320
+ "title": "Streaming",
321
+ "type": "boolean"
322
+ },
323
+ "volumes": {
324
+ "additionalProperties": {
325
+ "$ref": "#/$defs/VolumeRef"
326
+ },
327
+ "title": "Volumes",
328
+ "type": "object"
329
+ },
330
+ "weights": {
331
+ "description": "Weights URI; scheme restricted to gs:// or hf://",
332
+ "title": "Weights",
333
+ "type": "string"
334
+ }
335
+ },
336
+ "required": [
337
+ "name",
338
+ "gpu",
339
+ "image",
340
+ "weights",
341
+ "action"
342
+ ],
343
+ "title": "PolicySpec",
344
+ "type": "object",
345
+ "x-contract-version": "0.4.1"
346
+ }
@@ -0,0 +1,67 @@
1
+ {
2
+ "additionalProperties": false,
3
+ "description": "Proprioceptive state. Only joint_positions is required; the rest is zero-padded per model.",
4
+ "properties": {
5
+ "end_effector_pose": {
6
+ "anyOf": [
7
+ {
8
+ "items": {
9
+ "type": "number"
10
+ },
11
+ "maxItems": 7,
12
+ "minItems": 7,
13
+ "type": "array"
14
+ },
15
+ {
16
+ "type": "null"
17
+ }
18
+ ],
19
+ "default": null,
20
+ "title": "End Effector Pose"
21
+ },
22
+ "gripper": {
23
+ "anyOf": [
24
+ {
25
+ "items": {
26
+ "type": "number"
27
+ },
28
+ "type": "array"
29
+ },
30
+ {
31
+ "type": "null"
32
+ }
33
+ ],
34
+ "default": null,
35
+ "title": "Gripper"
36
+ },
37
+ "joint_positions": {
38
+ "description": "Joint angles, in radians",
39
+ "items": {
40
+ "type": "number"
41
+ },
42
+ "title": "Joint Positions",
43
+ "type": "array"
44
+ },
45
+ "joint_velocities": {
46
+ "anyOf": [
47
+ {
48
+ "items": {
49
+ "type": "number"
50
+ },
51
+ "type": "array"
52
+ },
53
+ {
54
+ "type": "null"
55
+ }
56
+ ],
57
+ "default": null,
58
+ "title": "Joint Velocities"
59
+ }
60
+ },
61
+ "required": [
62
+ "joint_positions"
63
+ ],
64
+ "title": "Proprioception",
65
+ "type": "object",
66
+ "x-contract-version": "0.4.1"
67
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "additionalProperties": false,
3
+ "description": "a.k.a. `seq.Record` — declares the mp4 the platform records (money-shot is a platform tool, not user\nglue). `camera` picks which camera stream to pull frames from; `fps` is the output frame rate. Used two\nways: as `BenchmarkSpec.render` (record the whole eval) and as `Step.record` (a per-frame hint).",
4
+ "properties": {
5
+ "camera": {
6
+ "description": "Which camera to pull frames from, e.g. 'wrist' / 'agentview'",
7
+ "title": "Camera",
8
+ "type": "string"
9
+ },
10
+ "fps": {
11
+ "default": 30,
12
+ "title": "Fps",
13
+ "type": "integer"
14
+ }
15
+ },
16
+ "required": [
17
+ "camera"
18
+ ],
19
+ "title": "RenderSpec",
20
+ "type": "object",
21
+ "x-contract-version": "0.4.1"
22
+ }
@@ -0,0 +1,29 @@
1
+ {
2
+ "additionalProperties": false,
3
+ "description": "= Modal Resources + GPUConfig. `gpu` is list[str] (the PolicySpec `str | list[str]` normalized).",
4
+ "properties": {
5
+ "cpu": {
6
+ "title": "Cpu",
7
+ "type": "integer"
8
+ },
9
+ "gpu": {
10
+ "items": {
11
+ "type": "string"
12
+ },
13
+ "title": "Gpu",
14
+ "type": "array"
15
+ },
16
+ "memory_gb": {
17
+ "title": "Memory Gb",
18
+ "type": "integer"
19
+ }
20
+ },
21
+ "required": [
22
+ "gpu",
23
+ "cpu",
24
+ "memory_gb"
25
+ ],
26
+ "title": "Resources",
27
+ "type": "object",
28
+ "x-contract-version": "0.4.1"
29
+ }
@@ -0,0 +1,59 @@
1
+ {
2
+ "additionalProperties": false,
3
+ "description": "One episode's result, ASSEMBLED BY THE PLATFORM from the per-step `@seq.check` returns — the user\nnever returns a success flag. `metrics` is the episode's closed-out user metrics (passthrough; the\nplatform does not know the field names). `video_uri` points at the mp4 the platform tool produced.\n\nScope: W0.1 delivers this wire shape only; the runtime that settles per-step `check.done` per-env and\nassembles it lives in the container / gateway, not in this pure-types unit.",
4
+ "properties": {
5
+ "metrics": {
6
+ "additionalProperties": {
7
+ "type": "number"
8
+ },
9
+ "description": "Episode's user-named metrics (passthrough; platform does not name them)",
10
+ "title": "Metrics",
11
+ "type": "object"
12
+ },
13
+ "steps": {
14
+ "title": "Steps",
15
+ "type": "integer"
16
+ },
17
+ "terminated": {
18
+ "title": "Terminated",
19
+ "type": "boolean"
20
+ },
21
+ "trajectory_uri": {
22
+ "anyOf": [
23
+ {
24
+ "type": "string"
25
+ },
26
+ {
27
+ "type": "null"
28
+ }
29
+ ],
30
+ "default": null,
31
+ "title": "Trajectory Uri"
32
+ },
33
+ "truncated": {
34
+ "title": "Truncated",
35
+ "type": "boolean"
36
+ },
37
+ "video_uri": {
38
+ "anyOf": [
39
+ {
40
+ "type": "string"
41
+ },
42
+ {
43
+ "type": "null"
44
+ }
45
+ ],
46
+ "default": null,
47
+ "title": "Video Uri"
48
+ }
49
+ },
50
+ "required": [
51
+ "metrics",
52
+ "steps",
53
+ "terminated",
54
+ "truncated"
55
+ ],
56
+ "title": "RolloutResult",
57
+ "type": "object",
58
+ "x-contract-version": "0.4.1"
59
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "additionalProperties": false,
3
+ "description": "POST /v1/secrets — one name = one group of env values (e.g. openrouter = {OPENROUTER_API_KEY}).\n`env` carries plaintext values; this is the WRITE-direction allow-list field (goal 15).",
4
+ "properties": {
5
+ "env": {
6
+ "additionalProperties": {
7
+ "type": "string"
8
+ },
9
+ "description": "ENV_KEY → value; write-only, never echoed back",
10
+ "title": "Env",
11
+ "type": "object"
12
+ },
13
+ "name": {
14
+ "title": "Name",
15
+ "type": "string"
16
+ }
17
+ },
18
+ "required": [
19
+ "name",
20
+ "env"
21
+ ],
22
+ "title": "SecretCreateRequest",
23
+ "type": "object",
24
+ "x-contract-version": "0.4.1"
25
+ }
@@ -0,0 +1,44 @@
1
+ {
2
+ "additionalProperties": false,
3
+ "description": "GET /v1/secrets element — metadata only, NO values. Exposes `env_keys`, not `env`.",
4
+ "properties": {
5
+ "created_at": {
6
+ "format": "date-time",
7
+ "title": "Created At",
8
+ "type": "string"
9
+ },
10
+ "env_keys": {
11
+ "description": "The env var names in this secret — values withheld",
12
+ "items": {
13
+ "type": "string"
14
+ },
15
+ "title": "Env Keys",
16
+ "type": "array"
17
+ },
18
+ "last_used_at": {
19
+ "anyOf": [
20
+ {
21
+ "format": "date-time",
22
+ "type": "string"
23
+ },
24
+ {
25
+ "type": "null"
26
+ }
27
+ ],
28
+ "default": null,
29
+ "title": "Last Used At"
30
+ },
31
+ "name": {
32
+ "title": "Name",
33
+ "type": "string"
34
+ }
35
+ },
36
+ "required": [
37
+ "name",
38
+ "env_keys",
39
+ "created_at"
40
+ ],
41
+ "title": "SecretInfo",
42
+ "type": "object",
43
+ "x-contract-version": "0.4.1"
44
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "additionalProperties": false,
3
+ "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.",
4
+ "properties": {
5
+ "name": {
6
+ "title": "Name",
7
+ "type": "string"
8
+ }
9
+ },
10
+ "required": [
11
+ "name"
12
+ ],
13
+ "title": "SecretRef",
14
+ "type": "object",
15
+ "x-contract-version": "0.4.1"
16
+ }
@@ -0,0 +1,33 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "description": "Lifecycle bitmask (IntFlag). One bit per lifecycle entrypoint.",
4
+ "enum": [
5
+ 1,
6
+ 2,
7
+ 4,
8
+ 8,
9
+ 16,
10
+ 1024,
11
+ 4096,
12
+ 8192,
13
+ 16384,
14
+ 32768,
15
+ 65536
16
+ ],
17
+ "title": "SeqFlags",
18
+ "type": "integer",
19
+ "x-contract-version": "0.4.1",
20
+ "x-flag-names": {
21
+ "CHECK": 65536,
22
+ "INFER": 16,
23
+ "LOAD": 2,
24
+ "ON_EPISODE": 1024,
25
+ "PLAN": 4,
26
+ "RESET": 32768,
27
+ "ROLLOUT": 8192,
28
+ "SCORE": 16384,
29
+ "SETUP": 4096,
30
+ "SHUTDOWN": 8,
31
+ "WARMUP": 1
32
+ }
33
+ }