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,76 @@
1
+ {
2
+ "$defs": {
3
+ "Lease": {
4
+ "additionalProperties": false,
5
+ "description": "A time-boxed grant of the direct coordinates. Renewed before `expires_at`; `epoch` is the\nworker/secret generation — a client holding a stale epoch against a new worker gets 401 and must\nre-connect.",
6
+ "properties": {
7
+ "epoch": {
8
+ "description": "Worker/secret generation counter; rolls on worker change",
9
+ "title": "Epoch",
10
+ "type": "integer"
11
+ },
12
+ "expires_at": {
13
+ "format": "date-time",
14
+ "title": "Expires At",
15
+ "type": "string"
16
+ },
17
+ "ttl_s": {
18
+ "title": "Ttl S",
19
+ "type": "integer"
20
+ }
21
+ },
22
+ "required": [
23
+ "ttl_s",
24
+ "expires_at",
25
+ "epoch"
26
+ ],
27
+ "title": "Lease",
28
+ "type": "object"
29
+ }
30
+ },
31
+ "additionalProperties": false,
32
+ "description": "POST /v1/internal/bootstrap (worker instance-identity JWT) — everything a worker needs to serve\ndirect TLS `/act`. `direct_secret` + `tls_key` are DOWN-direction platform secrets; `env` is the\nWRITE-direction injection of the policy's declared user secrets into its subprocess (goal 15).",
33
+ "properties": {
34
+ "direct_secret": {
35
+ "description": "Platform-minted bearer the worker's guard checks",
36
+ "title": "Direct Secret",
37
+ "type": "string"
38
+ },
39
+ "env": {
40
+ "additionalProperties": {
41
+ "type": "string"
42
+ },
43
+ "description": "Policy's user secrets, expanded ENV_KEY → value",
44
+ "title": "Env",
45
+ "type": "object"
46
+ },
47
+ "lease": {
48
+ "$ref": "#/$defs/Lease"
49
+ },
50
+ "tls_cert": {
51
+ "description": "Self-signed TLS certificate (public)",
52
+ "title": "Tls Cert",
53
+ "type": "string"
54
+ },
55
+ "tls_key": {
56
+ "description": "Self-signed TLS private key (down-direction platform secret)",
57
+ "title": "Tls Key",
58
+ "type": "string"
59
+ },
60
+ "weights_uri": {
61
+ "title": "Weights Uri",
62
+ "type": "string"
63
+ }
64
+ },
65
+ "required": [
66
+ "direct_secret",
67
+ "tls_key",
68
+ "tls_cert",
69
+ "env",
70
+ "weights_uri",
71
+ "lease"
72
+ ],
73
+ "title": "BootstrapResponse",
74
+ "type": "object",
75
+ "x-contract-version": "0.4.1"
76
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+ "additionalProperties": false,
3
+ "description": "Why the granted GPU count was clamped below the request — structured, not a bare value.",
4
+ "properties": {
5
+ "granted": {
6
+ "title": "Granted",
7
+ "type": "integer"
8
+ },
9
+ "limit": {
10
+ "description": "Which limit bound it, e.g. 'account_quota'",
11
+ "title": "Limit",
12
+ "type": "string"
13
+ },
14
+ "requested": {
15
+ "title": "Requested",
16
+ "type": "integer"
17
+ }
18
+ },
19
+ "required": [
20
+ "limit",
21
+ "requested",
22
+ "granted"
23
+ ],
24
+ "title": "ClampInfo",
25
+ "type": "object",
26
+ "x-contract-version": "0.4.1"
27
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+ "additionalProperties": false,
3
+ "description": "The policy's own source, shipped with the deploy so the worker can import `policy.handler_ref`\n(what Modal's automount does for the entrypoint module). A gzip'd tar of the handler's top-level module\nor package, base64 on the wire, with the sha256 of the decoded bytes so a truncated or altered upload\nis refused at the edge instead of failing as an ImportError on a GPU.",
4
+ "properties": {
5
+ "data": {
6
+ "title": "Data",
7
+ "type": "string"
8
+ },
9
+ "format": {
10
+ "const": "tar.gz",
11
+ "default": "tar.gz",
12
+ "title": "Format",
13
+ "type": "string"
14
+ },
15
+ "sha256": {
16
+ "title": "Sha256",
17
+ "type": "string"
18
+ }
19
+ },
20
+ "required": [
21
+ "data",
22
+ "sha256"
23
+ ],
24
+ "title": "CodeBundle",
25
+ "type": "object",
26
+ "x-contract-version": "0.4.1"
27
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "additionalProperties": false,
3
+ "description": "= Modal max/target_concurrent_inputs. Both required.",
4
+ "properties": {
5
+ "max_inputs": {
6
+ "title": "Max Inputs",
7
+ "type": "integer"
8
+ },
9
+ "target_inputs": {
10
+ "title": "Target Inputs",
11
+ "type": "integer"
12
+ }
13
+ },
14
+ "required": [
15
+ "max_inputs",
16
+ "target_inputs"
17
+ ],
18
+ "title": "Concurrency",
19
+ "type": "object",
20
+ "x-contract-version": "0.4.1"
21
+ }
@@ -0,0 +1,59 @@
1
+ {
2
+ "$defs": {
3
+ "Variant": {
4
+ "additionalProperties": false,
5
+ "description": "One structured variant axis of the eval matrix (e.g. axis=\"lighting\", values=[\"day\",\"night\"]).",
6
+ "properties": {
7
+ "axis": {
8
+ "title": "Axis",
9
+ "type": "string"
10
+ },
11
+ "values": {
12
+ "items": {
13
+ "type": "string"
14
+ },
15
+ "title": "Values",
16
+ "type": "array"
17
+ }
18
+ },
19
+ "required": [
20
+ "axis",
21
+ "values"
22
+ ],
23
+ "title": "Variant",
24
+ "type": "object"
25
+ }
26
+ },
27
+ "additionalProperties": false,
28
+ "description": "The eval matrix — structured, not a bare dict. `tasks` and `seeds` required; `variants` optional.",
29
+ "properties": {
30
+ "seeds": {
31
+ "items": {
32
+ "type": "integer"
33
+ },
34
+ "title": "Seeds",
35
+ "type": "array"
36
+ },
37
+ "tasks": {
38
+ "items": {
39
+ "type": "string"
40
+ },
41
+ "title": "Tasks",
42
+ "type": "array"
43
+ },
44
+ "variants": {
45
+ "items": {
46
+ "$ref": "#/$defs/Variant"
47
+ },
48
+ "title": "Variants",
49
+ "type": "array"
50
+ }
51
+ },
52
+ "required": [
53
+ "tasks",
54
+ "seeds"
55
+ ],
56
+ "title": "Conditions",
57
+ "type": "object",
58
+ "x-contract-version": "0.4.1"
59
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "additionalProperties": false,
3
+ "properties": {
4
+ "model": {
5
+ "description": "Deployment name to connect to",
6
+ "title": "Model",
7
+ "type": "string"
8
+ }
9
+ },
10
+ "required": [
11
+ "model"
12
+ ],
13
+ "title": "ConnectRequest",
14
+ "type": "object",
15
+ "x-contract-version": "0.4.1"
16
+ }
@@ -0,0 +1,81 @@
1
+ {
2
+ "$defs": {
3
+ "Lease": {
4
+ "additionalProperties": false,
5
+ "description": "A time-boxed grant of the direct coordinates. Renewed before `expires_at`; `epoch` is the\nworker/secret generation — a client holding a stale epoch against a new worker gets 401 and must\nre-connect.",
6
+ "properties": {
7
+ "epoch": {
8
+ "description": "Worker/secret generation counter; rolls on worker change",
9
+ "title": "Epoch",
10
+ "type": "integer"
11
+ },
12
+ "expires_at": {
13
+ "format": "date-time",
14
+ "title": "Expires At",
15
+ "type": "string"
16
+ },
17
+ "ttl_s": {
18
+ "title": "Ttl S",
19
+ "type": "integer"
20
+ }
21
+ },
22
+ "required": [
23
+ "ttl_s",
24
+ "expires_at",
25
+ "epoch"
26
+ ],
27
+ "title": "Lease",
28
+ "type": "object"
29
+ }
30
+ },
31
+ "additionalProperties": false,
32
+ "description": "200 — the full set of coordinates for a direct worker connection.\n\n`direct_secret` is a plaintext platform-minted bearer for the worker's `/act`; it is on the\nallow-list of fields permitted to carry a secret value in the down direction (契约 6 / goal 15).",
33
+ "properties": {
34
+ "cert_fingerprint": {
35
+ "description": "Self-signed cert fingerprint the SDK pins",
36
+ "title": "Cert Fingerprint",
37
+ "type": "string"
38
+ },
39
+ "direct_secret": {
40
+ "description": "Bearer for the worker /act; valid within the lease",
41
+ "title": "Direct Secret",
42
+ "type": "string"
43
+ },
44
+ "lease": {
45
+ "$ref": "#/$defs/Lease"
46
+ },
47
+ "warming": {
48
+ "default": false,
49
+ "description": "True → worker still warming; see warming_eta_s",
50
+ "title": "Warming",
51
+ "type": "boolean"
52
+ },
53
+ "warming_eta_s": {
54
+ "anyOf": [
55
+ {
56
+ "type": "integer"
57
+ },
58
+ {
59
+ "type": "null"
60
+ }
61
+ ],
62
+ "default": null,
63
+ "description": "Seconds until warm, when warming",
64
+ "title": "Warming Eta S"
65
+ },
66
+ "worker_url": {
67
+ "description": "Worker static-IP direct URL, e.g. https://<ip>:8080",
68
+ "title": "Worker Url",
69
+ "type": "string"
70
+ }
71
+ },
72
+ "required": [
73
+ "worker_url",
74
+ "cert_fingerprint",
75
+ "direct_secret",
76
+ "lease"
77
+ ],
78
+ "title": "ConnectResponse",
79
+ "type": "object",
80
+ "x-contract-version": "0.4.1"
81
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "additionalProperties": false,
3
+ "description": "202 — the build is async; the id comes back first, status pinned to `building`.",
4
+ "properties": {
5
+ "deployment_id": {
6
+ "title": "Deployment Id",
7
+ "type": "string"
8
+ },
9
+ "status": {
10
+ "const": "building",
11
+ "default": "building",
12
+ "title": "Status",
13
+ "type": "string"
14
+ }
15
+ },
16
+ "required": [
17
+ "deployment_id"
18
+ ],
19
+ "title": "DeploymentAccepted",
20
+ "type": "object",
21
+ "x-contract-version": "0.4.1"
22
+ }
@@ -0,0 +1,101 @@
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
+ "SecretRef": {
44
+ "additionalProperties": false,
45
+ "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.",
46
+ "properties": {
47
+ "name": {
48
+ "title": "Name",
49
+ "type": "string"
50
+ }
51
+ },
52
+ "required": [
53
+ "name"
54
+ ],
55
+ "title": "SecretRef",
56
+ "type": "object"
57
+ }
58
+ },
59
+ "additionalProperties": false,
60
+ "description": "The policy block of the deployments body. `handler_ref` and `action` are required; `action` is the\nfixed obs→ActionChunk contract, not a bare dict.\n\n`secrets` carries the policy's declared secret BUNDLES BY NAME ONLY (list[SecretRef]) — the gateway\nvalidates each name exists and belongs to the deployer at submit time (accounts ⑦ / S3 goal 14), and the\nworker bootstrap fetches the matching env group by name. A secret VALUE never travels here: SecretRef is\nname-only, so this field cannot carry one (S3 goal 15). Defaults to `[]` so a policy with no secrets is\nunaffected.",
61
+ "properties": {
62
+ "action": {
63
+ "$ref": "#/$defs/ActionContract"
64
+ },
65
+ "frames_per_chunk": {
66
+ "anyOf": [
67
+ {
68
+ "type": "integer"
69
+ },
70
+ {
71
+ "type": "null"
72
+ }
73
+ ],
74
+ "default": null,
75
+ "title": "Frames Per Chunk"
76
+ },
77
+ "handler_ref": {
78
+ "title": "Handler Ref",
79
+ "type": "string"
80
+ },
81
+ "secrets": {
82
+ "items": {
83
+ "$ref": "#/$defs/SecretRef"
84
+ },
85
+ "title": "Secrets",
86
+ "type": "array"
87
+ },
88
+ "streaming": {
89
+ "default": false,
90
+ "title": "Streaming",
91
+ "type": "boolean"
92
+ }
93
+ },
94
+ "required": [
95
+ "handler_ref",
96
+ "action"
97
+ ],
98
+ "title": "DeploymentPolicy",
99
+ "type": "object",
100
+ "x-contract-version": "0.4.1"
101
+ }