@yaks/model 0.0.0-stage → 0.2.36

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 (126) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +868 -2
  3. package/_dist/afford.d.ts +69 -0
  4. package/_dist/afford.d.ts.map +1 -0
  5. package/_dist/attribute.d.ts +52 -0
  6. package/_dist/attribute.d.ts.map +1 -0
  7. package/_dist/batch.d.ts +28 -0
  8. package/_dist/batch.d.ts.map +1 -0
  9. package/_dist/cache.d.ts +15 -0
  10. package/_dist/cache.d.ts.map +1 -0
  11. package/_dist/deferred.d.ts +9 -0
  12. package/_dist/deferred.d.ts.map +1 -0
  13. package/_dist/graph.d.ts +3 -0
  14. package/_dist/graph.d.ts.map +1 -0
  15. package/_dist/image.d.ts +46 -0
  16. package/_dist/image.d.ts.map +1 -0
  17. package/_dist/inference.d.ts +58 -0
  18. package/_dist/inference.d.ts.map +1 -0
  19. package/_dist/limits.d.ts +142 -0
  20. package/_dist/limits.d.ts.map +1 -0
  21. package/_dist/media.d.ts +28 -0
  22. package/_dist/media.d.ts.map +1 -0
  23. package/_dist/message.d.ts +5 -0
  24. package/_dist/message.d.ts.map +1 -0
  25. package/_dist/mod.d.ts +298 -0
  26. package/_dist/mod.d.ts.map +1 -0
  27. package/_dist/offers.d.ts +19 -0
  28. package/_dist/offers.d.ts.map +1 -0
  29. package/_dist/onward.d.ts +77 -0
  30. package/_dist/onward.d.ts.map +1 -0
  31. package/_dist/prices.d.ts +27 -0
  32. package/_dist/prices.d.ts.map +1 -0
  33. package/_dist/provider.d.ts +49 -0
  34. package/_dist/provider.d.ts.map +1 -0
  35. package/_dist/results.d.ts +21 -0
  36. package/_dist/results.d.ts.map +1 -0
  37. package/_dist/route.d.ts +189 -0
  38. package/_dist/route.d.ts.map +1 -0
  39. package/_dist/sse.d.ts +4 -0
  40. package/_dist/sse.d.ts.map +1 -0
  41. package/_dist/stall.d.ts +47 -0
  42. package/_dist/stall.d.ts.map +1 -0
  43. package/_dist/step.d.ts +71 -0
  44. package/_dist/step.d.ts.map +1 -0
  45. package/_dist/submission.d.ts +7 -0
  46. package/_dist/submission.d.ts.map +1 -0
  47. package/_dist/vocab.d.ts +82 -0
  48. package/_dist/vocab.d.ts.map +1 -0
  49. package/_dist/windows.d.ts +6 -0
  50. package/_dist/windows.d.ts.map +1 -0
  51. package/afford.js +135 -0
  52. package/afford.js.map +1 -0
  53. package/afford.ts +208 -0
  54. package/attribute.js +109 -0
  55. package/attribute.js.map +1 -0
  56. package/attribute.ts +120 -0
  57. package/batch.js +8 -0
  58. package/batch.js.map +1 -0
  59. package/batch.ts +37 -0
  60. package/cache.js +28 -0
  61. package/cache.js.map +1 -0
  62. package/cache.ts +53 -0
  63. package/deferred.js +29 -0
  64. package/deferred.js.map +1 -0
  65. package/deferred.ts +54 -0
  66. package/deno.json +1 -0
  67. package/graph.js +8 -0
  68. package/graph.js.map +1 -0
  69. package/graph.ts +9 -0
  70. package/image.js +118 -0
  71. package/image.js.map +1 -0
  72. package/image.ts +108 -0
  73. package/inference.js +119 -0
  74. package/inference.js.map +1 -0
  75. package/inference.ts +223 -0
  76. package/limits.js +204 -0
  77. package/limits.js.map +1 -0
  78. package/limits.ts +230 -0
  79. package/media.js +76 -0
  80. package/media.js.map +1 -0
  81. package/media.ts +139 -0
  82. package/message.js +21 -0
  83. package/message.js.map +1 -0
  84. package/message.ts +17 -0
  85. package/mod.js +396 -0
  86. package/mod.js.map +1 -0
  87. package/mod.ts +695 -0
  88. package/offers.js +53 -0
  89. package/offers.js.map +1 -0
  90. package/offers.ts +84 -0
  91. package/onward.js +110 -0
  92. package/onward.js.map +1 -0
  93. package/onward.ts +123 -0
  94. package/package.json +53 -4
  95. package/prices.js +61 -0
  96. package/prices.js.map +1 -0
  97. package/prices.json +643 -0
  98. package/prices.ts +60 -0
  99. package/provider.js +6 -0
  100. package/provider.js.map +1 -0
  101. package/provider.ts +89 -0
  102. package/results.js +51 -0
  103. package/results.js.map +1 -0
  104. package/results.ts +47 -0
  105. package/route.js +263 -0
  106. package/route.js.map +1 -0
  107. package/route.ts +359 -0
  108. package/sse.js +71 -0
  109. package/sse.js.map +1 -0
  110. package/sse.ts +82 -0
  111. package/stall.js +166 -0
  112. package/stall.js.map +1 -0
  113. package/stall.ts +201 -0
  114. package/step.js +226 -0
  115. package/step.js.map +1 -0
  116. package/step.ts +265 -0
  117. package/submission.js +38 -0
  118. package/submission.js.map +1 -0
  119. package/submission.ts +38 -0
  120. package/vocab.js +83 -0
  121. package/vocab.js.map +1 -0
  122. package/vocab.json +613 -0
  123. package/vocab.ts +139 -0
  124. package/windows.js +35 -0
  125. package/windows.js.map +1 -0
  126. package/windows.ts +28 -0
package/vocab.json ADDED
@@ -0,0 +1,613 @@
1
+ {
2
+ "$id": "urn:uuid:86a85e39-cea0-4863-8507-938931b53026",
3
+ "$vocabulary": {
4
+ "https://yak.sh/vocab/core": true,
5
+ "https://yak.sh/vocab/id": true,
6
+ "https://yak.sh/vocab/names": true,
7
+ "https://yak.sh/vocab/edge": true
8
+ },
9
+ "title": "model",
10
+ "$defs": {
11
+ "submitted": {
12
+ "$id": "urn:uuid:2e72be08-b402-4615-a013-25564210edda",
13
+ "component": true,
14
+ "type": "object",
15
+ "wire": false,
16
+ "journal": false,
17
+ "description": "the original model ask was submitted for a paid generation; an uncertain acknowledgement still counts as submitted",
18
+ "properties": {
19
+ "at": {
20
+ "$id": "urn:uuid:8117e9d2-b101-4129-bb61-5173fb5319f9",
21
+ "type": "string",
22
+ "format": "date-time",
23
+ "stamped": true,
24
+ "description": "recorded before the paid request, guarded against any prior submission"
25
+ }
26
+ }
27
+ },
28
+ "provider": {
29
+ "$id": "urn:uuid:17523bb7-2863-41b5-aeca-e0c975e991f2",
30
+ "component": true,
31
+ "type": "object",
32
+ "by_name": true,
33
+ "description": "a service that runs models",
34
+ "properties": {
35
+ "name": {
36
+ "$id": "urn:uuid:e8d22917-739b-43e2-9b1f-caeff3f710bb",
37
+ "type": "string",
38
+ "identity": true,
39
+ "description": "what the provider is called; the entity id is derived from it"
40
+ },
41
+ "transport": {
42
+ "$id": "urn:uuid:352edde2-7537-4c67-b057-516fd48c0e47",
43
+ "type": "string",
44
+ "enum": [
45
+ "process",
46
+ "http",
47
+ "machine"
48
+ ],
49
+ "description": "how its models are reached: `process` is a command line this host runs, `http` an API it calls, `machine` another machine's own providers, asked one step at a time"
50
+ },
51
+ "machine": {
52
+ "$id": "urn:uuid:2daf8c8e-e100-40ed-b1c4-1e25f52f70e6",
53
+ "type": "string",
54
+ "ref": "machine",
55
+ "death": "keep",
56
+ "description": "the machine whose providers answer, where `transport` is `machine`, and a row naming none is served by nobody; where it is `process`, the developer's machine that runs its command line, whose runner takes each session asked of it (@yaks/spawn/machines)"
57
+ },
58
+ "credential": {
59
+ "$id": "urn:uuid:8e78d506-1902-4d6a-98d2-07cd16448d29",
60
+ "type": "string"
61
+ },
62
+ "base": {
63
+ "$id": "urn:uuid:ab38364a-a8dd-4b3c-a7f7-9f889d034c73",
64
+ "type": "string",
65
+ "format": "uri",
66
+ "description": "where a provider reached over HTTP answers: its root URL, without a path"
67
+ },
68
+ "api": {
69
+ "$id": "urn:uuid:3a4ceb72-e417-4f6c-b2f1-e9f57a104dfe",
70
+ "type": "string",
71
+ "description": "the API it speaks, which names the code that reaches it: over HTTP, `ollama`, or `openai` for an OpenAI-compatible one; for a `process`, the CLI whose command line it takes and whose stream it prints (`claude`, `codex`), its own name where it names none"
72
+ },
73
+ "command": {
74
+ "$id": "urn:uuid:2fcf200d-f797-4fc6-9c45-1f429f49a022",
75
+ "type": "string",
76
+ "description": "the program a `process` provider is run as, in place of its CLI's own: a name on the PATH or a path. It is given the command line of the CLI named in `api` and prints that CLI's stream"
77
+ },
78
+ "recorded": {
79
+ "$id": "urn:uuid:24a992db-24fd-44ad-8416-b8bc5eb1df04",
80
+ "type": "boolean",
81
+ "description": "its runs play recordings (packages/spawn/standin.ts), so how one ends is chosen: an ending that is not clean is written on the session, and no failure is reported of it"
82
+ },
83
+ "fallback": {
84
+ "$id": "urn:uuid:6ff4319e-b1ef-40a8-a18a-3750b0c4d245",
85
+ "type": "boolean"
86
+ },
87
+ "context": {
88
+ "$id": "urn:uuid:0eac0b1a-db28-4679-83e0-8873c2f1f91a",
89
+ "type": "integer",
90
+ "minimum": 1,
91
+ "description": "the context window, in tokens, assumed for a model it serves whose own row names none"
92
+ },
93
+ "offered": {
94
+ "$id": "urn:uuid:930b1054-e9b1-4866-83a2-911863908da1",
95
+ "type": "boolean"
96
+ },
97
+ "cache_retention": {
98
+ "$id": "urn:uuid:fe691054-fc11-486c-b717-e51b47a97494",
99
+ "type": "integer",
100
+ "minimum": 1,
101
+ "description": "documented cached-prefix retention in seconds for this provider\u2019s configured endpoint and models; used from request start only when the answer has no explicit expiry. Missing means unknown"
102
+ },
103
+ "stall_timeout": {
104
+ "$id": "urn:uuid:1a5b2997-e0b3-43b5-bf0b-a89534b16c5b",
105
+ "type": "integer",
106
+ "minimum": 0,
107
+ "description": "how long, in seconds, a stream from this provider may go without progress before its request fails as stalled; 0 for no limit. Missing means the default, five minutes"
108
+ },
109
+ "plan": {
110
+ "$id": "urn:uuid:91b724cc-9552-4a09-9208-6236a875ab9c",
111
+ "type": "string",
112
+ "ref": "provider",
113
+ "death": "keep",
114
+ "description": "the provider whose plan limits (`rate_limit`) its requests spend, where they are not its own: `openai` signed in with a ChatGPT grant spends the plan `codex` reports"
115
+ }
116
+ }
117
+ },
118
+ "cache": {
119
+ "$id": "urn:uuid:2afc4c61-0ad3-42cb-baac-e2bf8fe5eec1",
120
+ "component": true,
121
+ "type": "object",
122
+ "properties": {
123
+ "retention": {
124
+ "$id": "urn:uuid:20756fef-cfed-4b3c-b93d-ae45fa7267ec",
125
+ "type": "integer",
126
+ "minimum": 1,
127
+ "description": "seconds its sessions' model requests ask the provider to keep their cached prefix (`Request.cacheRetention`)"
128
+ }
129
+ },
130
+ "description": "how long a persona's conversations ask their model's provider to keep a cached prefix, in place of the provider's own"
131
+ },
132
+ "model": {
133
+ "$id": "urn:uuid:a36bc876-472c-4126-a604-c3769951eb8a",
134
+ "component": true,
135
+ "type": "object",
136
+ "by_name": true,
137
+ "description": "a model, whoever serves it",
138
+ "properties": {
139
+ "name": {
140
+ "$id": "urn:uuid:dcf23619-71ba-4372-8456-ffcdf062e404",
141
+ "type": "string",
142
+ "identity": true,
143
+ "description": "the model's own name; the entity id is derived from it"
144
+ },
145
+ "vendor": {
146
+ "$id": "urn:uuid:61a97bee-de1c-4b0d-86a1-62e85286d8f9",
147
+ "type": "string"
148
+ },
149
+ "grade": {
150
+ "$id": "urn:uuid:21d22f8d-9fdb-4110-85f0-70513f79273f",
151
+ "type": "string",
152
+ "enum": [
153
+ "frontier",
154
+ "mid",
155
+ "small"
156
+ ]
157
+ },
158
+ "label": {
159
+ "$id": "urn:uuid:67947c53-9be2-4bb6-9ec3-2964a045201c",
160
+ "type": "string",
161
+ "description": "what a person sees the model called (\"Sonnet 5.5\", \"GPT-6.2 Sol\"), read by @yaks/model `labelOf`; its name is an id, for tools and logs"
162
+ },
163
+ "modalities": {
164
+ "$id": "urn:uuid:2337fb5e-7b1c-493a-b88a-9a102c7a737a",
165
+ "type": "array",
166
+ "items": {
167
+ "type": "string",
168
+ "enum": [
169
+ "text",
170
+ "image",
171
+ "audio"
172
+ ]
173
+ },
174
+ "uniqueItems": true,
175
+ "description": "the outputs requested when this model is asked"
176
+ },
177
+ "efforts": {
178
+ "$id": "urn:uuid:6c75b697-ffd1-43b6-8492-d57bd620b74c",
179
+ "type": "string"
180
+ },
181
+ "effort": {
182
+ "$id": "urn:uuid:8437a53e-815f-4213-a2bc-4bc73b6fcc34",
183
+ "type": "string",
184
+ "description": "the reasoning effort requested, unless a session overrides it"
185
+ },
186
+ "context": {
187
+ "$id": "urn:uuid:5e16c540-576f-4c92-b8f8-6c2168e5df95",
188
+ "type": "integer",
189
+ "minimum": 1,
190
+ "description": "the model's context window, in tokens: the most one request holds, its input and reply together; read from its provider's catalog, or set by hand. A transcript is compacted at a share of it"
191
+ },
192
+ "offered": {
193
+ "$id": "urn:uuid:ae398525-8505-4c8a-a42f-879b55352865",
194
+ "type": "boolean"
195
+ },
196
+ "output": {
197
+ "$id": "urn:uuid:445e23ac-9c98-4417-9fd7-4f357a1a126c",
198
+ "type": "integer",
199
+ "minimum": 1,
200
+ "description": "the model's maximum reply length in tokens, including reasoning, as its provider's catalogue lists it"
201
+ },
202
+ "enforced": {
203
+ "$id": "urn:uuid:4bda7681-b793-4a61-b48f-2380ba9dbceb",
204
+ "type": "integer",
205
+ "minimum": 1,
206
+ "stamped": true,
207
+ "description": "the token ceiling explicitly enforced by a provider refusal, separate from the configured context window; compaction uses the smaller of them"
208
+ }
209
+ }
210
+ },
211
+ "serves": {
212
+ "$id": "urn:uuid:2cfb78ac-71a3-4e7e-bcfb-e821d6089421",
213
+ "component": true,
214
+ "type": "object",
215
+ "edge": "serves",
216
+ "reversed": "served by",
217
+ "description": "an edge relation: this provider serves that model",
218
+ "properties": {
219
+ "name": {
220
+ "$id": "urn:uuid:8d033c44-314b-43b4-9a8a-eeeae8025d1d",
221
+ "type": "string",
222
+ "description": "what the provider calls the model, sent as the model of every request it serves"
223
+ }
224
+ }
225
+ },
226
+ "routes": {
227
+ "$id": "urn:uuid:e9025af4-bf59-4b96-b091-2fe8287b78eb",
228
+ "component": true,
229
+ "type": "object",
230
+ "edge": "routes",
231
+ "reversed": "routed by",
232
+ "description": "an edge relation, from a row whose `using` is a default to an offering (a `serves` edge): the default is chosen among the offerings it routes, the pinned one, else the one whose plan has the most usage left, and its own `using` answers only where none is pinned and no plan has a reading",
233
+ "properties": {
234
+ "pinned": {
235
+ "$id": "urn:uuid:81c26234-ee32-46f3-81a7-95824002977f",
236
+ "type": "string",
237
+ "format": "date-time",
238
+ "description": "when this offering was pinned: while the mark is set the default is this offering whatever the plans read, and removing it resumes routing"
239
+ }
240
+ }
241
+ },
242
+ "usage": {
243
+ "$id": "urn:uuid:5fbb9aaf-9b32-4609-9d5e-add9525277be",
244
+ "component": true,
245
+ "journal": false,
246
+ "type": "object",
247
+ "description": "provider-reported token counts for one completed model request, stored on the entry for that request; not cumulative, and not an estimate of current context size",
248
+ "properties": {
249
+ "input_tokens": {
250
+ "$id": "urn:uuid:11c8aa4c-e270-4584-9cd8-c2ec572bef64",
251
+ "type": "integer",
252
+ "description": "input context tokens, including cached tokens"
253
+ },
254
+ "output_tokens": {
255
+ "$id": "urn:uuid:91866db8-3bbe-4e91-9356-4eb3372f91da",
256
+ "type": "integer",
257
+ "description": "generated tokens, including reasoning tokens"
258
+ },
259
+ "total_tokens": {
260
+ "$id": "urn:uuid:006b4695-a231-40b0-863b-d7375e4bbe62",
261
+ "type": "integer",
262
+ "description": "total input and output tokens reported by the provider"
263
+ },
264
+ "cached_tokens": {
265
+ "$id": "urn:uuid:ed675c3c-f227-47f3-9e6a-ffdf65969021",
266
+ "type": "integer",
267
+ "description": "input tokens read from the provider cache; not a guarantee of future cache availability"
268
+ },
269
+ "cache_write_tokens": {
270
+ "$id": "urn:uuid:b4b0f32d-3871-4bd7-ba0c-4226ce6cd8ce",
271
+ "type": "integer",
272
+ "description": "input tokens written to the provider cache by this request, within input_tokens"
273
+ },
274
+ "cache_write_1h_tokens": {
275
+ "$id": "urn:uuid:69db044c-77b2-4787-ae6a-a7c7d17f3ddc",
276
+ "type": "integer",
277
+ "description": "of the cache writes, those kept an hour rather than minutes, which a provider can price higher"
278
+ },
279
+ "cache_write_12h_tokens": {
280
+ "$id": "urn:uuid:e0277c9e-de55-4120-af31-3e9103c6f02c",
281
+ "type": "integer",
282
+ "description": "of the cache writes, those billed at a 12-hour lifetime"
283
+ },
284
+ "reasoning_tokens": {
285
+ "$id": "urn:uuid:7a3dce8b-c868-454e-b5d1-c64db37c8de7",
286
+ "type": "integer",
287
+ "description": "reasoning tokens within output tokens"
288
+ },
289
+ "web_searches": {
290
+ "$id": "urn:uuid:3f247ef3-4916-4ce1-a2ba-6b64eeba66f3",
291
+ "type": "integer",
292
+ "description": "web searches the provider ran for the request, each billed at the model's web_search price"
293
+ }
294
+ }
295
+ },
296
+ "price": {
297
+ "$id": "urn:uuid:7a123476-b227-4f09-8276-ebcb9aad494d",
298
+ "component": true,
299
+ "type": "object",
300
+ "description": "what a model costs, in dollars per million tokens and per web search, on the model's own row; a request its provider reports no dollars for is weighed at it",
301
+ "properties": {
302
+ "input": {
303
+ "$id": "urn:uuid:e6616db0-c509-473b-855a-b8bda15dc8cd",
304
+ "type": "number",
305
+ "description": "dollars per million input tokens"
306
+ },
307
+ "output": {
308
+ "$id": "urn:uuid:79201017-3670-4c64-8b41-d2d193933437",
309
+ "type": "number",
310
+ "description": "dollars per million output tokens, reasoning included"
311
+ },
312
+ "cached": {
313
+ "$id": "urn:uuid:d4021148-ecdb-4676-a1b3-9bcb51b8f48d",
314
+ "type": "number",
315
+ "description": "dollars per million input tokens read from the provider cache; the input price where absent"
316
+ },
317
+ "cache_write": {
318
+ "$id": "urn:uuid:13189979-b590-452b-8cc3-ea274eabf1fc",
319
+ "type": "number",
320
+ "description": "dollars per million input tokens written to the provider cache; the input price where absent"
321
+ },
322
+ "cache_write_1h": {
323
+ "$id": "urn:uuid:8b71af73-a377-4459-ab0f-7936f2cf941e",
324
+ "type": "number",
325
+ "description": "dollars per million input tokens written to the cache for an hour; the cache_write price where absent"
326
+ },
327
+ "cache_write_12h": {
328
+ "$id": "urn:uuid:b7763148-559b-4d40-b617-e37ca484135e",
329
+ "type": "number",
330
+ "description": "dollars per million input tokens written to the cache for 12 hours; the cache_write price where absent"
331
+ },
332
+ "web_search": {
333
+ "$id": "urn:uuid:90dff11c-e90e-4bf3-987e-d6539ac85161",
334
+ "type": "number",
335
+ "description": "dollars per web search the provider runs for a request"
336
+ }
337
+ }
338
+ },
339
+ "cost": {
340
+ "$id": "urn:uuid:ebd7b339-8456-4194-9ce6-cb59bfe12cef",
341
+ "component": true,
342
+ "journal": false,
343
+ "type": "object",
344
+ "description": "what one model request or tool call cost, in dollars, on the entity that spent it: a request's entry beside its `usage`, or a call",
345
+ "properties": {
346
+ "dollars": {
347
+ "$id": "urn:uuid:f3714d76-6f62-4da3-a286-7d9e9d6002d9",
348
+ "type": "number",
349
+ "index": true
350
+ },
351
+ "reported": {
352
+ "$id": "urn:uuid:ecee53f1-d7a8-449f-8935-e2d4a3baa87a",
353
+ "type": "boolean",
354
+ "description": "true when the provider reported the dollars; false when they were weighed from the model's `price`"
355
+ }
356
+ }
357
+ },
358
+ "account": {
359
+ "$id": "urn:uuid:d5a06699-0a3a-41fb-bb05-e1209a195dfd",
360
+ "component": true,
361
+ "journal": false,
362
+ "type": "object",
363
+ "description": "an account a provider's CLI keeps on this machine: the config directory it signs in from and keeps its transcripts in (`CLAUDE_CONFIG_DIR`, `CODEX_HOME`). Each has a plan of its own, and a second account is one more row: `/home/me/.claude-teams` beside `/home/me/.claude`",
364
+ "properties": {
365
+ "home": {
366
+ "$id": "urn:uuid:81988bf2-d35e-4650-b4b9-732717d5242d",
367
+ "type": "string",
368
+ "identity": true,
369
+ "description": "the account's directory, `/Users/erik/.claude-work`; the entity id is derived from it"
370
+ },
371
+ "provider": {
372
+ "$id": "urn:uuid:7d53b14a-422a-4aa0-9cbc-4b920024d060",
373
+ "type": "string",
374
+ "ref": "provider",
375
+ "death": "keep",
376
+ "description": "the provider whose CLI keeps it"
377
+ },
378
+ "offered": {
379
+ "$id": "urn:uuid:faa4853a-02e7-4824-a0d5-a63c350f6e27",
380
+ "type": "boolean",
381
+ "description": "a run may be given it: a spawn that names no account runs on the offered account of its provider further under its weekly pace (@yaks/model `freest`)"
382
+ },
383
+ "expires": {
384
+ "$id": "urn:uuid:cccb30a0-ec55-4944-98d8-6ac997e314d3",
385
+ "type": "string",
386
+ "format": "date-time",
387
+ "description": "when its plan ends, a subscription taken for a trial: from then on no run is given it, offered or not"
388
+ }
389
+ }
390
+ },
391
+ "rate_limit": {
392
+ "$id": "urn:uuid:809084be-e82c-4e47-b3d0-39f176cf45f6",
393
+ "component": true,
394
+ "journal": false,
395
+ "type": "object",
396
+ "description": "how much of a plan limit is used: one row per provider, window, account and, for a limit on one model, model, holding its latest reading",
397
+ "properties": {
398
+ "provider": {
399
+ "$id": "urn:uuid:9e36a3d3-6250-4ff8-96c2-d3d8c6c95b5c",
400
+ "type": "string",
401
+ "ref": "provider",
402
+ "death": "cascade",
403
+ "description": "the provider whose plan it is",
404
+ "identity": true
405
+ },
406
+ "window": {
407
+ "$id": "urn:uuid:c0595996-d133-4e45-bf7e-eaae8fd66698",
408
+ "type": "integer",
409
+ "description": "the limit's window in minutes: 10080 for a week, 300 for five hours",
410
+ "identity": true
411
+ },
412
+ "account": {
413
+ "$id": "urn:uuid:a9069211-0ade-4e85-8803-a42e786b8c08",
414
+ "type": "string",
415
+ "ref": "account",
416
+ "death": "cascade",
417
+ "description": "the account whose plan it is, where the reading came from one: a transcript or a run of that account, its status line, or a native session's request it answered",
418
+ "identity": true
419
+ },
420
+ "model": {
421
+ "$id": "urn:uuid:278a60ad-34d6-418c-8db5-7ea64ebb34d5",
422
+ "type": "string",
423
+ "ref": "model",
424
+ "death": "cascade",
425
+ "description": "the model whose requests it meters, where it is a limit on one model and not on the whole plan: Claude's weekly cap on Fable",
426
+ "identity": true
427
+ },
428
+ "used": {
429
+ "$id": "urn:uuid:6244b5cd-5291-4458-babe-6ed0c984f18e",
430
+ "type": "number",
431
+ "description": "percent of the window's limit used, as the provider reported it"
432
+ },
433
+ "resets": {
434
+ "$id": "urn:uuid:b1db17b5-4410-43be-bc76-e1e399491525",
435
+ "type": "string",
436
+ "format": "date-time",
437
+ "description": "when the window resets"
438
+ },
439
+ "at": {
440
+ "$id": "urn:uuid:4691c584-f2a7-4905-a1d9-7f4566191965",
441
+ "type": "string",
442
+ "format": "date-time",
443
+ "description": "when the provider reported it"
444
+ }
445
+ }
446
+ },
447
+ "stream_item": {
448
+ "$id": "urn:uuid:bf737cfc-e4d1-41ba-a102-0f2f2d96d339",
449
+ "component": true,
450
+ "sync": "none",
451
+ "wire": false,
452
+ "journal": false,
453
+ "type": "object",
454
+ "description": "the provider-neutral identity of a streamed text item, retained on its output entry for completed-result recovery",
455
+ "properties": {
456
+ "index": {
457
+ "$id": "urn:uuid:97a08dde-8e36-4556-a2cc-0f5b9fd26ecf",
458
+ "type": "integer"
459
+ },
460
+ "id": {
461
+ "$id": "urn:uuid:dcbc1307-188f-4c13-9060-f2b759d89258",
462
+ "type": "string"
463
+ }
464
+ }
465
+ },
466
+ "model_result": {
467
+ "$id": "urn:uuid:930f56ab-043f-4dc5-a26f-e54017582fd3",
468
+ "component": true,
469
+ "sync": "none",
470
+ "journal": false,
471
+ "wire": false,
472
+ "type": "object",
473
+ "description": "provider evidence on the original ask, saved before billing settlement and transcript delivery so either can recover without generation",
474
+ "properties": {
475
+ "pending": {
476
+ "$id": "urn:uuid:dd1e87d2-60ae-4dd2-aa9f-2de0d0702079",
477
+ "type": "string",
478
+ "store": "blob",
479
+ "description": "the provider acknowledgement and the accounting terms of a generation that can be retrieved"
480
+ },
481
+ "body": {
482
+ "$id": "urn:uuid:63786c43-0aaa-40b2-a441-171aa056fc8f",
483
+ "type": "string",
484
+ "store": "blob",
485
+ "description": "the completed ModelResult, including usage and known cost; absent cost remains unknown"
486
+ }
487
+ }
488
+ },
489
+ "response": {
490
+ "$id": "urn:uuid:36d801ce-ee71-4bf7-975b-7a2275951e1b",
491
+ "component": true,
492
+ "journal": false,
493
+ "type": "object",
494
+ "description": "what a provider answered a model request that failed, as it arrived, kept beside the line recording the failure so the failure can be read rather than reconstructed; never the request's credentials",
495
+ "properties": {
496
+ "body": {
497
+ "$id": "urn:uuid:ef14205f-e872-40f4-8179-4ab28c32804e",
498
+ "type": "string",
499
+ "store": "blob",
500
+ "description": "the body of an error status, or the event that ended the stream, as sent"
501
+ },
502
+ "headers": {
503
+ "$id": "urn:uuid:dd6e8931-614d-45a0-a53f-dacbef7c0521",
504
+ "type": "object",
505
+ "description": "the headers that speak of the provider's limits (retry-after, rate limits, plan usage), by lowercase name"
506
+ }
507
+ }
508
+ },
509
+ "questions": {
510
+ "$id": "urn:uuid:fba536e9-3c23-493b-a306-d560537b98c3",
511
+ "component": true,
512
+ "type": "object",
513
+ "description": "typed questions about the transcript, asked with the next request and answered by one `answer` entry each rather than in prose",
514
+ "properties": {
515
+ "asked": {
516
+ "$id": "urn:uuid:464b2c98-e46a-4a9f-bcea-cf9bcc3d81e3",
517
+ "type": "object",
518
+ "description": "each question by its name, in Jev's terms: {type: noul, choice or score, instructions, criteria}"
519
+ }
520
+ }
521
+ },
522
+ "answer": {
523
+ "$id": "urn:uuid:62229acf-52c2-4942-bb22-827e7614468c",
524
+ "component": true,
525
+ "type": "object",
526
+ "description": "a model's answer to one typed question, in the terms it was asked in",
527
+ "properties": {
528
+ "question": {
529
+ "$id": "urn:uuid:4be4d3b3-1969-4acc-8e88-6e67dfd59828",
530
+ "type": "string",
531
+ "description": "the name of the question it answers"
532
+ },
533
+ "noul": {
534
+ "$id": "urn:uuid:dcbcc188-6140-4953-9eaf-5d36ed3b6069",
535
+ "type": "number",
536
+ "description": "for a noul, the probability that it holds"
537
+ },
538
+ "choice": {
539
+ "$id": "urn:uuid:0ad86ffe-d317-4968-be2b-8181d89def4c",
540
+ "type": "string",
541
+ "description": "for a choice, the option chosen"
542
+ },
543
+ "score": {
544
+ "$id": "urn:uuid:672c74fd-fcf2-4d1f-9355-542608061439",
545
+ "type": "number",
546
+ "description": "for a score, where along its criteria the answer falls"
547
+ },
548
+ "confidence": {
549
+ "$id": "urn:uuid:53859cbb-109a-4253-a7d8-290b497d79be",
550
+ "type": "number",
551
+ "description": "how sure the model is of a choice or a score, from 0 to 1"
552
+ },
553
+ "probabilities": {
554
+ "$id": "urn:uuid:86152233-40bd-4a05-93ef-9cbb9a998166",
555
+ "type": "object",
556
+ "description": "each option's probability, by the option's name or place"
557
+ }
558
+ }
559
+ },
560
+ "grades": {
561
+ "enum": [
562
+ "frontier",
563
+ "mid",
564
+ "small"
565
+ ]
566
+ },
567
+ "transports": {
568
+ "enum": [
569
+ "process",
570
+ "http",
571
+ "machine"
572
+ ]
573
+ },
574
+ "inference": {
575
+ "$id": "urn:uuid:bd15c54c-a2af-4d6f-b1f3-e7c4c7e43dda",
576
+ "component": true,
577
+ "type": "object",
578
+ "wire": false,
579
+ "sync": "none",
580
+ "journal": false,
581
+ "description": "the pinned executor and private frozen request and completed receipt references for the original model ask",
582
+ "properties": {
583
+ "executor": {
584
+ "$id": "urn:uuid:6151c004-8ffe-4859-a826-676a7b038b0a",
585
+ "type": "string",
586
+ "description": "the independently deployed executor release that accepted this ask"
587
+ },
588
+ "request": {
589
+ "$id": "urn:uuid:8d3e4e7d-3c78-47dd-85fe-9033e3a1a3b5",
590
+ "type": "string",
591
+ "description": "private frozen request object reference"
592
+ },
593
+ "receipt": {
594
+ "$id": "urn:uuid:f1d0b70f-81c2-400a-a5ca-8645c7677e00",
595
+ "type": "string",
596
+ "description": "private completed receipt object reference; absent while pending"
597
+ }
598
+ }
599
+ }
600
+ },
601
+ "kinds": {
602
+ "provider": {
603
+ "$id": "urn:uuid:17523bb7-2863-41b5-aeca-e0c975e991f2",
604
+ "description": "a service that runs models",
605
+ "prefix": "Y"
606
+ },
607
+ "model": {
608
+ "$id": "urn:uuid:a36bc876-472c-4126-a604-c3769951eb8a",
609
+ "description": "a model, whoever serves it",
610
+ "prefix": "O"
611
+ }
612
+ }
613
+ }