modelrig 0.0.1 → 0.2.0

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 (420) hide show
  1. package/CHANGELOG.md +94 -0
  2. package/LICENSE +201 -0
  3. package/README.md +145 -8
  4. package/data/PROVENANCE.md +19 -0
  5. package/data/pricing-manual.json +22 -0
  6. package/data/pricing-map.json +46362 -0
  7. package/data/pricing-overlay.json +419 -0
  8. package/dist/adapters/anthropic.d.ts +90 -0
  9. package/dist/adapters/anthropic.d.ts.map +1 -0
  10. package/dist/adapters/anthropic.js +296 -0
  11. package/dist/adapters/build-adapters.d.ts +11 -0
  12. package/dist/adapters/build-adapters.d.ts.map +1 -0
  13. package/dist/adapters/build-adapters.js +45 -0
  14. package/dist/adapters/deepseek.d.ts +47 -0
  15. package/dist/adapters/deepseek.d.ts.map +1 -0
  16. package/dist/adapters/deepseek.js +216 -0
  17. package/dist/adapters/gemini.d.ts +44 -0
  18. package/dist/adapters/gemini.d.ts.map +1 -0
  19. package/dist/adapters/gemini.js +262 -0
  20. package/dist/adapters/grok.d.ts +53 -0
  21. package/dist/adapters/grok.d.ts.map +1 -0
  22. package/dist/adapters/grok.js +232 -0
  23. package/dist/adapters/openai-compat.d.ts +80 -0
  24. package/dist/adapters/openai-compat.d.ts.map +1 -0
  25. package/dist/adapters/openai-compat.js +244 -0
  26. package/dist/adapters/openai-stream.d.ts +58 -0
  27. package/dist/adapters/openai-stream.d.ts.map +1 -0
  28. package/dist/adapters/openai-stream.js +120 -0
  29. package/dist/adapters/openai.d.ts +55 -0
  30. package/dist/adapters/openai.d.ts.map +1 -0
  31. package/dist/adapters/openai.js +281 -0
  32. package/dist/adapters/sampling.d.ts +28 -0
  33. package/dist/adapters/sampling.d.ts.map +1 -0
  34. package/dist/adapters/sampling.js +34 -0
  35. package/dist/adapters/tool-mapping.d.ts +92 -0
  36. package/dist/adapters/tool-mapping.d.ts.map +1 -0
  37. package/dist/adapters/tool-mapping.js +143 -0
  38. package/dist/artifacts/artifact.d.ts +137 -0
  39. package/dist/artifacts/artifact.d.ts.map +1 -0
  40. package/dist/artifacts/artifact.js +377 -0
  41. package/dist/artifacts/content-uploader.d.ts +87 -0
  42. package/dist/artifacts/content-uploader.d.ts.map +1 -0
  43. package/dist/artifacts/content-uploader.js +124 -0
  44. package/dist/artifacts/index.d.ts +63 -0
  45. package/dist/artifacts/index.d.ts.map +1 -0
  46. package/dist/artifacts/index.js +80 -0
  47. package/dist/artifacts/run-context.d.ts +129 -0
  48. package/dist/artifacts/run-context.d.ts.map +1 -0
  49. package/dist/artifacts/run-context.js +208 -0
  50. package/dist/artifacts/scrub.d.ts +60 -0
  51. package/dist/artifacts/scrub.d.ts.map +1 -0
  52. package/dist/artifacts/scrub.js +139 -0
  53. package/dist/artifacts/step.d.ts +26 -0
  54. package/dist/artifacts/step.d.ts.map +1 -0
  55. package/dist/artifacts/step.js +37 -0
  56. package/dist/artifacts/taint.d.ts +63 -0
  57. package/dist/artifacts/taint.d.ts.map +1 -0
  58. package/dist/artifacts/taint.js +76 -0
  59. package/dist/bakeoff/cache-sim.d.ts +99 -0
  60. package/dist/bakeoff/cache-sim.d.ts.map +1 -0
  61. package/dist/bakeoff/cache-sim.js +126 -0
  62. package/dist/bakeoff/engine.d.ts +52 -0
  63. package/dist/bakeoff/engine.d.ts.map +1 -0
  64. package/dist/bakeoff/engine.js +163 -0
  65. package/dist/bakeoff/eval-cases.d.ts +96 -0
  66. package/dist/bakeoff/eval-cases.d.ts.map +1 -0
  67. package/dist/bakeoff/eval-cases.js +105 -0
  68. package/dist/bakeoff/replay.d.ts +52 -0
  69. package/dist/bakeoff/replay.d.ts.map +1 -0
  70. package/dist/bakeoff/replay.js +94 -0
  71. package/dist/bakeoff/report.d.ts +41 -0
  72. package/dist/bakeoff/report.d.ts.map +1 -0
  73. package/dist/bakeoff/report.js +142 -0
  74. package/dist/bakeoff/samples.d.ts +77 -0
  75. package/dist/bakeoff/samples.d.ts.map +1 -0
  76. package/dist/bakeoff/samples.js +148 -0
  77. package/dist/bakeoff/stats.d.ts +13 -0
  78. package/dist/bakeoff/stats.d.ts.map +1 -0
  79. package/dist/bakeoff/stats.js +48 -0
  80. package/dist/bakeoff/types.d.ts +37 -0
  81. package/dist/bakeoff/types.d.ts.map +1 -0
  82. package/dist/bakeoff/types.js +10 -0
  83. package/dist/cli.d.ts +25 -0
  84. package/dist/cli.d.ts.map +1 -0
  85. package/dist/cli.js +590 -0
  86. package/dist/config.d.ts +204 -0
  87. package/dist/config.d.ts.map +1 -0
  88. package/dist/config.js +252 -0
  89. package/dist/deprecations.d.ts +32 -0
  90. package/dist/deprecations.d.ts.map +1 -0
  91. package/dist/deprecations.js +59 -0
  92. package/dist/feedback/coverage.d.ts +32 -0
  93. package/dist/feedback/coverage.d.ts.map +1 -0
  94. package/dist/feedback/coverage.js +95 -0
  95. package/dist/feedback/feedback.d.ts +35 -0
  96. package/dist/feedback/feedback.d.ts.map +1 -0
  97. package/dist/feedback/feedback.js +39 -0
  98. package/dist/gateway/http-protocol.d.ts +175 -0
  99. package/dist/gateway/http-protocol.d.ts.map +1 -0
  100. package/dist/gateway/http-protocol.js +105 -0
  101. package/dist/index.d.ts +242 -0
  102. package/dist/index.d.ts.map +1 -0
  103. package/dist/index.js +576 -0
  104. package/dist/init/finder.d.ts +94 -0
  105. package/dist/init/finder.d.ts.map +1 -0
  106. package/dist/init/finder.js +343 -0
  107. package/dist/init/init-cli.d.ts +10 -0
  108. package/dist/init/init-cli.d.ts.map +1 -0
  109. package/dist/init/init-cli.js +86 -0
  110. package/dist/init/observe-cli.d.ts +19 -0
  111. package/dist/init/observe-cli.d.ts.map +1 -0
  112. package/dist/init/observe-cli.js +73 -0
  113. package/dist/init/observe.d.ts +81 -0
  114. package/dist/init/observe.d.ts.map +1 -0
  115. package/dist/init/observe.js +245 -0
  116. package/dist/init/run.d.ts +99 -0
  117. package/dist/init/run.d.ts.map +1 -0
  118. package/dist/init/run.js +281 -0
  119. package/dist/init/signatures.d.ts +39 -0
  120. package/dist/init/signatures.d.ts.map +1 -0
  121. package/dist/init/signatures.js +116 -0
  122. package/dist/matrix/aggregate.d.ts +89 -0
  123. package/dist/matrix/aggregate.d.ts.map +1 -0
  124. package/dist/matrix/aggregate.js +186 -0
  125. package/dist/query/grammar.d.ts +35 -0
  126. package/dist/query/grammar.d.ts.map +1 -0
  127. package/dist/query/grammar.js +279 -0
  128. package/dist/query/run.d.ts +8 -0
  129. package/dist/query/run.d.ts.map +1 -0
  130. package/dist/query/run.js +21 -0
  131. package/dist/registry/build.d.ts +219 -0
  132. package/dist/registry/build.d.ts.map +1 -0
  133. package/dist/registry/build.js +313 -0
  134. package/dist/registry/cache-policy.d.ts +94 -0
  135. package/dist/registry/cache-policy.d.ts.map +1 -0
  136. package/dist/registry/cache-policy.js +238 -0
  137. package/dist/registry/call-notes.d.ts +11 -0
  138. package/dist/registry/call-notes.d.ts.map +1 -0
  139. package/dist/registry/call-notes.js +110 -0
  140. package/dist/registry/claims.d.ts +63 -0
  141. package/dist/registry/claims.d.ts.map +1 -0
  142. package/dist/registry/claims.js +107 -0
  143. package/dist/registry/effective-rate.d.ts +151 -0
  144. package/dist/registry/effective-rate.d.ts.map +1 -0
  145. package/dist/registry/effective-rate.js +156 -0
  146. package/dist/registry/facts.d.ts +32 -0
  147. package/dist/registry/facts.d.ts.map +1 -0
  148. package/dist/registry/facts.js +136 -0
  149. package/dist/registry/fingerprint.d.ts +20 -0
  150. package/dist/registry/fingerprint.d.ts.map +1 -0
  151. package/dist/registry/fingerprint.js +150 -0
  152. package/dist/registry/parity.d.ts +52 -0
  153. package/dist/registry/parity.d.ts.map +1 -0
  154. package/dist/registry/parity.js +82 -0
  155. package/dist/registry/pricing-shape.d.ts +113 -0
  156. package/dist/registry/pricing-shape.d.ts.map +1 -0
  157. package/dist/registry/pricing-shape.js +123 -0
  158. package/dist/registry/pricing.d.ts +43 -0
  159. package/dist/registry/pricing.d.ts.map +1 -0
  160. package/dist/registry/pricing.js +127 -0
  161. package/dist/registry/rows.d.ts +16 -0
  162. package/dist/registry/rows.d.ts.map +1 -0
  163. package/dist/registry/rows.js +57 -0
  164. package/dist/registry/seed.d.ts +43 -0
  165. package/dist/registry/seed.d.ts.map +1 -0
  166. package/dist/registry/seed.js +97 -0
  167. package/dist/registry/select.d.ts +68 -0
  168. package/dist/registry/select.d.ts.map +1 -0
  169. package/dist/registry/select.js +141 -0
  170. package/dist/registry/staleness.d.ts +18 -0
  171. package/dist/registry/staleness.d.ts.map +1 -0
  172. package/dist/registry/staleness.js +39 -0
  173. package/dist/rigindex/bootstrap.d.ts +36 -0
  174. package/dist/rigindex/bootstrap.d.ts.map +1 -0
  175. package/dist/rigindex/bootstrap.js +97 -0
  176. package/dist/rigindex/fit.d.ts +24 -0
  177. package/dist/rigindex/fit.d.ts.map +1 -0
  178. package/dist/rigindex/fit.js +76 -0
  179. package/dist/rigindex/gates.d.ts +52 -0
  180. package/dist/rigindex/gates.d.ts.map +1 -0
  181. package/dist/rigindex/gates.js +109 -0
  182. package/dist/rigindex/graph.d.ts +31 -0
  183. package/dist/rigindex/graph.d.ts.map +1 -0
  184. package/dist/rigindex/graph.js +120 -0
  185. package/dist/rigindex/index.d.ts +23 -0
  186. package/dist/rigindex/index.d.ts.map +1 -0
  187. package/dist/rigindex/index.js +112 -0
  188. package/dist/rigindex/types.d.ts +76 -0
  189. package/dist/rigindex/types.d.ts.map +1 -0
  190. package/dist/rigindex/types.js +8 -0
  191. package/dist/routes/cache-lint.d.ts +41 -0
  192. package/dist/routes/cache-lint.d.ts.map +1 -0
  193. package/dist/routes/cache-lint.js +81 -0
  194. package/dist/routes/draft.d.ts +83 -0
  195. package/dist/routes/draft.d.ts.map +1 -0
  196. package/dist/routes/draft.js +135 -0
  197. package/dist/routes/loader.d.ts +63 -0
  198. package/dist/routes/loader.d.ts.map +1 -0
  199. package/dist/routes/loader.js +574 -0
  200. package/dist/routes/manifest.d.ts +24 -0
  201. package/dist/routes/manifest.d.ts.map +1 -0
  202. package/dist/routes/manifest.js +118 -0
  203. package/dist/routes/resolved-bundle.d.ts +79 -0
  204. package/dist/routes/resolved-bundle.d.ts.map +1 -0
  205. package/dist/routes/resolved-bundle.js +148 -0
  206. package/dist/routes/sampling-config.d.ts +32 -0
  207. package/dist/routes/sampling-config.d.ts.map +1 -0
  208. package/dist/routes/sampling-config.js +91 -0
  209. package/dist/routes/serveability.d.ts +52 -0
  210. package/dist/routes/serveability.d.ts.map +1 -0
  211. package/dist/routes/serveability.js +73 -0
  212. package/dist/routes/template.d.ts +18 -0
  213. package/dist/routes/template.d.ts.map +1 -0
  214. package/dist/routes/template.js +94 -0
  215. package/dist/run/ajv.d.ts +22 -0
  216. package/dist/run/ajv.d.ts.map +1 -0
  217. package/dist/run/ajv.js +32 -0
  218. package/dist/run/cache-handle.d.ts +58 -0
  219. package/dist/run/cache-handle.d.ts.map +1 -0
  220. package/dist/run/cache-handle.js +54 -0
  221. package/dist/run/cache-stamp.d.ts +65 -0
  222. package/dist/run/cache-stamp.d.ts.map +1 -0
  223. package/dist/run/cache-stamp.js +0 -0
  224. package/dist/run/capture-write.d.ts +33 -0
  225. package/dist/run/capture-write.d.ts.map +1 -0
  226. package/dist/run/capture-write.js +55 -0
  227. package/dist/run/cost.d.ts +26 -0
  228. package/dist/run/cost.d.ts.map +1 -0
  229. package/dist/run/cost.js +41 -0
  230. package/dist/run/dispatch.d.ts +99 -0
  231. package/dist/run/dispatch.d.ts.map +1 -0
  232. package/dist/run/dispatch.js +191 -0
  233. package/dist/run/envelope.d.ts +21 -0
  234. package/dist/run/envelope.d.ts.map +1 -0
  235. package/dist/run/envelope.js +45 -0
  236. package/dist/run/grounding.d.ts +56 -0
  237. package/dist/run/grounding.d.ts.map +1 -0
  238. package/dist/run/grounding.js +89 -0
  239. package/dist/run/raw.d.ts +88 -0
  240. package/dist/run/raw.d.ts.map +1 -0
  241. package/dist/run/raw.js +286 -0
  242. package/dist/run/record-attempt.d.ts +40 -0
  243. package/dist/run/record-attempt.d.ts.map +1 -0
  244. package/dist/run/record-attempt.js +99 -0
  245. package/dist/run/repair.d.ts +36 -0
  246. package/dist/run/repair.d.ts.map +1 -0
  247. package/dist/run/repair.js +61 -0
  248. package/dist/run/resolve.d.ts +99 -0
  249. package/dist/run/resolve.d.ts.map +1 -0
  250. package/dist/run/resolve.js +203 -0
  251. package/dist/run/retry.d.ts +19 -0
  252. package/dist/run/retry.d.ts.map +1 -0
  253. package/dist/run/retry.js +50 -0
  254. package/dist/run/run.d.ts +55 -0
  255. package/dist/run/run.d.ts.map +1 -0
  256. package/dist/run/run.js +540 -0
  257. package/dist/run/stream.d.ts +49 -0
  258. package/dist/run/stream.d.ts.map +1 -0
  259. package/dist/run/stream.js +87 -0
  260. package/dist/run/validate.d.ts +15 -0
  261. package/dist/run/validate.d.ts.map +1 -0
  262. package/dist/run/validate.js +55 -0
  263. package/dist/savings/cache-ledger.d.ts +108 -0
  264. package/dist/savings/cache-ledger.d.ts.map +1 -0
  265. package/dist/savings/cache-ledger.js +174 -0
  266. package/dist/savings/cache-reconcile.d.ts +64 -0
  267. package/dist/savings/cache-reconcile.d.ts.map +1 -0
  268. package/dist/savings/cache-reconcile.js +59 -0
  269. package/dist/savings/cache-stats.d.ts +63 -0
  270. package/dist/savings/cache-stats.d.ts.map +1 -0
  271. package/dist/savings/cache-stats.js +108 -0
  272. package/dist/savings/emit.d.ts +38 -0
  273. package/dist/savings/emit.d.ts.map +1 -0
  274. package/dist/savings/emit.js +100 -0
  275. package/dist/savings/odometer.d.ts +32 -0
  276. package/dist/savings/odometer.d.ts.map +1 -0
  277. package/dist/savings/odometer.js +70 -0
  278. package/dist/savings/swap-execute.d.ts +58 -0
  279. package/dist/savings/swap-execute.d.ts.map +1 -0
  280. package/dist/savings/swap-execute.js +130 -0
  281. package/dist/savings/swaps-client.d.ts +55 -0
  282. package/dist/savings/swaps-client.d.ts.map +1 -0
  283. package/dist/savings/swaps-client.js +95 -0
  284. package/dist/settings/api-fetcher.d.ts +39 -0
  285. package/dist/settings/api-fetcher.d.ts.map +1 -0
  286. package/dist/settings/api-fetcher.js +92 -0
  287. package/dist/settings/index.d.ts +10 -0
  288. package/dist/settings/index.d.ts.map +1 -0
  289. package/dist/settings/index.js +15 -0
  290. package/dist/settings/task-settings.d.ts +91 -0
  291. package/dist/settings/task-settings.d.ts.map +1 -0
  292. package/dist/settings/task-settings.js +116 -0
  293. package/dist/status.d.ts +77 -0
  294. package/dist/status.d.ts.map +1 -0
  295. package/dist/status.js +113 -0
  296. package/dist/telemetry/artifact-store.d.ts +48 -0
  297. package/dist/telemetry/artifact-store.d.ts.map +1 -0
  298. package/dist/telemetry/artifact-store.js +189 -0
  299. package/dist/telemetry/cache-miss-streak.d.ts +79 -0
  300. package/dist/telemetry/cache-miss-streak.d.ts.map +1 -0
  301. package/dist/telemetry/cache-miss-streak.js +99 -0
  302. package/dist/telemetry/capture.d.ts +31 -0
  303. package/dist/telemetry/capture.d.ts.map +1 -0
  304. package/dist/telemetry/capture.js +81 -0
  305. package/dist/telemetry/exporter-setup.d.ts +28 -0
  306. package/dist/telemetry/exporter-setup.d.ts.map +1 -0
  307. package/dist/telemetry/exporter-setup.js +34 -0
  308. package/dist/telemetry/exporter.d.ts +137 -0
  309. package/dist/telemetry/exporter.d.ts.map +1 -0
  310. package/dist/telemetry/exporter.js +510 -0
  311. package/dist/telemetry/health.d.ts +76 -0
  312. package/dist/telemetry/health.d.ts.map +1 -0
  313. package/dist/telemetry/health.js +92 -0
  314. package/dist/telemetry/ingest-protocol.d.ts +310 -0
  315. package/dist/telemetry/ingest-protocol.d.ts.map +1 -0
  316. package/dist/telemetry/ingest-protocol.js +363 -0
  317. package/dist/telemetry/load-error-report.d.ts +24 -0
  318. package/dist/telemetry/load-error-report.d.ts.map +1 -0
  319. package/dist/telemetry/load-error-report.js +50 -0
  320. package/dist/telemetry/otel-map.d.ts +121 -0
  321. package/dist/telemetry/otel-map.d.ts.map +1 -0
  322. package/dist/telemetry/otel-map.js +224 -0
  323. package/dist/telemetry/otel-normalize.d.ts +104 -0
  324. package/dist/telemetry/otel-normalize.d.ts.map +1 -0
  325. package/dist/telemetry/otel-normalize.js +530 -0
  326. package/dist/telemetry/otlp-emitter.d.ts +52 -0
  327. package/dist/telemetry/otlp-emitter.d.ts.map +1 -0
  328. package/dist/telemetry/otlp-emitter.js +144 -0
  329. package/dist/telemetry/otlp-proto.d.ts +29 -0
  330. package/dist/telemetry/otlp-proto.d.ts.map +1 -0
  331. package/dist/telemetry/otlp-proto.js +266 -0
  332. package/dist/telemetry/sinks.d.ts +90 -0
  333. package/dist/telemetry/sinks.d.ts.map +1 -0
  334. package/dist/telemetry/sinks.js +180 -0
  335. package/dist/telemetry/store.d.ts +65 -0
  336. package/dist/telemetry/store.d.ts.map +1 -0
  337. package/dist/telemetry/store.js +547 -0
  338. package/dist/tenancy/api-key-format.d.ts +77 -0
  339. package/dist/tenancy/api-key-format.d.ts.map +1 -0
  340. package/dist/tenancy/api-key-format.js +110 -0
  341. package/dist/tenancy/constants.d.ts +23 -0
  342. package/dist/tenancy/constants.d.ts.map +1 -0
  343. package/dist/tenancy/constants.js +25 -0
  344. package/dist/tenancy/scrub.d.ts +47 -0
  345. package/dist/tenancy/scrub.d.ts.map +1 -0
  346. package/dist/tenancy/scrub.js +85 -0
  347. package/dist/types/config-teaching.d.ts +62 -0
  348. package/dist/types/config-teaching.d.ts.map +1 -0
  349. package/dist/types/config-teaching.js +183 -0
  350. package/dist/types/failures-teaching.d.ts +56 -0
  351. package/dist/types/failures-teaching.d.ts.map +1 -0
  352. package/dist/types/failures-teaching.js +177 -0
  353. package/dist/types/failures.d.ts +27 -0
  354. package/dist/types/failures.d.ts.map +1 -0
  355. package/dist/types/failures.js +41 -0
  356. package/dist/types/provider.d.ts +200 -0
  357. package/dist/types/provider.d.ts.map +1 -0
  358. package/dist/types/provider.js +40 -0
  359. package/dist/types/route.d.ts +205 -0
  360. package/dist/types/route.d.ts.map +1 -0
  361. package/dist/types/route.js +6 -0
  362. package/dist/types/telemetry.d.ts +206 -0
  363. package/dist/types/telemetry.d.ts.map +1 -0
  364. package/dist/types/telemetry.js +6 -0
  365. package/dist/validate-cli.d.ts +12 -0
  366. package/dist/validate-cli.d.ts.map +1 -0
  367. package/dist/validate-cli.js +57 -0
  368. package/dist/verify/capture.d.ts +66 -0
  369. package/dist/verify/capture.d.ts.map +1 -0
  370. package/dist/verify/capture.js +180 -0
  371. package/dist/verify/cli-run.d.ts +23 -0
  372. package/dist/verify/cli-run.d.ts.map +1 -0
  373. package/dist/verify/cli-run.js +57 -0
  374. package/dist/verify/diff.d.ts +48 -0
  375. package/dist/verify/diff.d.ts.map +1 -0
  376. package/dist/verify/diff.js +157 -0
  377. package/dist/verify/index.d.ts +17 -0
  378. package/dist/verify/index.d.ts.map +1 -0
  379. package/dist/verify/index.js +24 -0
  380. package/dist/verify/report.d.ts +14 -0
  381. package/dist/verify/report.d.ts.map +1 -0
  382. package/dist/verify/report.js +88 -0
  383. package/dist/verify/types.d.ts +101 -0
  384. package/dist/verify/types.d.ts.map +1 -0
  385. package/dist/verify/types.js +17 -0
  386. package/dist/verify/verify.d.ts +29 -0
  387. package/dist/verify/verify.d.ts.map +1 -0
  388. package/dist/verify/verify.js +148 -0
  389. package/dist/watch/budget.d.ts +19 -0
  390. package/dist/watch/budget.d.ts.map +1 -0
  391. package/dist/watch/budget.js +35 -0
  392. package/dist/watch/evaluate.d.ts +225 -0
  393. package/dist/watch/evaluate.d.ts.map +1 -0
  394. package/dist/watch/evaluate.js +155 -0
  395. package/dist/watch/monitor.d.ts +116 -0
  396. package/dist/watch/monitor.d.ts.map +1 -0
  397. package/dist/watch/monitor.js +199 -0
  398. package/dist/watch/proposals.d.ts +89 -0
  399. package/dist/watch/proposals.d.ts.map +1 -0
  400. package/dist/watch/proposals.js +197 -0
  401. package/dist/watch/run-record.d.ts +64 -0
  402. package/dist/watch/run-record.d.ts.map +1 -0
  403. package/dist/watch/run-record.js +86 -0
  404. package/dist/watch/run-reported.d.ts +20 -0
  405. package/dist/watch/run-reported.d.ts.map +1 -0
  406. package/dist/watch/run-reported.js +53 -0
  407. package/dist/watch/run.d.ts +73 -0
  408. package/dist/watch/run.d.ts.map +1 -0
  409. package/dist/watch/run.js +83 -0
  410. package/dist/watch/state-store.d.ts +48 -0
  411. package/dist/watch/state-store.d.ts.map +1 -0
  412. package/dist/watch/state-store.js +86 -0
  413. package/dist/watch/state.d.ts +21 -0
  414. package/dist/watch/state.d.ts.map +1 -0
  415. package/dist/watch/state.js +93 -0
  416. package/package.json +56 -14
  417. package/registry/LICENSE +20 -0
  418. package/registry/leaderboard.json +3639 -0
  419. package/registry/registry.json +7263 -0
  420. package/index.js +0 -3
package/CHANGELOG.md ADDED
@@ -0,0 +1,94 @@
1
+ # Changelog
2
+
3
+ All notable changes to the `modelrig` npm package are recorded here. The public
4
+ surface is one thing with two halves — this package and the docs/registry site
5
+ at [modelrig.dev](https://modelrig.dev). They ship together under one release
6
+ ceremony (see `docs/ModelRig/oss-publish-policy.md`, §6). The generated docs
7
+ carry an "as of modelrig vX.Y.Z" stamp so a reader can see when the docs and the
8
+ published package diverge.
9
+
10
+ This project adheres to [Semantic Versioning](https://semver.org/). Dates are
11
+ UTC.
12
+
13
+ ## [0.2.0] — unreleased (staged for the R-A ceremony)
14
+
15
+ - Ships the probed capability registry and leaderboard (`registry/registry.json`, `registry/leaderboard.json`) so a clean install routes on the probed profile instead of the static fallback (R-1 F2 ruling). The `modelrig-oracle` MCP server remains unreleased and is flagged as such in the docs.
16
+
17
+ `0.1.0` was frozen on 2026-08-07 and shipped **dist-only** (`files: [dist,
18
+ README, LICENSE]`). The SDK grew a large public surface across the following six
19
+ weeks while the published artifact stood still, and one runtime dependency —
20
+ `data/` — was never in the tarball at all. This release makes the published
21
+ package match the workspace and self-tests that it does.
22
+
23
+ ### Fixed — packaging (the reason for this release)
24
+
25
+ - **`data/` now ships.** `getPricing()` reads `data/pricing-map.json` (and the
26
+ optional `data/pricing-overlay.json`) from the package root at runtime, with
27
+ no `existsSync` guard — so on `0.1.0` the very first cost lookup threw
28
+ `ENOENT` on a clean `npm i modelrig`, breaking the flagship "effective cost"
29
+ story out of the box. `data` is now in the `files` allowlist. It is public
30
+ pricing data (CC BY 4.0; see `data/PROVENANCE.md`), safe to distribute.
31
+ - **Regression pinned forever.** A new hermetic test (`npm pack` → install the
32
+ tarball into a temp dir → load the *installed* package) asserts
33
+ `getPricing()` returns a real rate and the `modelrig` bin runs. Packaging
34
+ breaks are now caught before publish, not by a customer.
35
+ - **`modelrig --help` / `-h` / `help` exit 0** with usage on stdout (was: fell
36
+ through to the unknown-command path and exited 1).
37
+
38
+ ### Added — public API surface accumulated since 0.1.0
39
+
40
+ None of the below existed in the published `0.1.0`; instructions written for the
41
+ current docs failed against it with missing exports. They are all in this tag:
42
+
43
+ - **Inspectable artifact store** — the `artifacts` namespace (runs → steps →
44
+ artifacts, lineaged and integrity-hashed), `resolveArtifactsConfig`,
45
+ per-artifact and per-run evaluation (`artifact.evaluate` / `run.evaluate`).
46
+ - **Run verdicts** — the automatic deterministic `run-outcome@v1` on every run,
47
+ the explicit bounded model judge `run-judge@v1` (`modelrig judge <runId>`),
48
+ and the feedback protocol (`rig.feedback`, `POST /v1/feedback`,
49
+ `computeCoverage`).
50
+ - **Cache accounting & routing** — cache-aware `estimateCostUsd` (cache-read
51
+ and cache-write buckets), `effectiveInputRate` / `classifyCacheVerdict`, the
52
+ `cache: auto` route directive with the miss-streak alert, and the customer
53
+ cache-handle pass-through `rig.run(task, { input, cache: { key, provider } })`
54
+ / `rig.runRaw({ …, cache: { key } })` (CE-1) — the customer owns the TTL
55
+ heartbeat; ModelRig never creates, refreshes, or deletes the resource.
56
+ - **Observe / init (T0–T2)** — `modelrig observe` (scaffold the record-step seam
57
+ behind `MODELRIG_ARTIFACTS=1`, no route migration), `modelrig init --scope`
58
+ (draft a route bundle per call site), `modelrig validate` (keyless structural
59
+ check of `rig.yaml` + every bundle), and `modelrig verify-swap`
60
+ (shadow-equivalence report for a same-model swap).
61
+ - **Route sampling params (CE-6)** — `policy.sampling: { temperature?, top_p?,
62
+ max_output_tokens? }` on a route, validated at load and sent to the provider
63
+ as declared; a sub-1.0 temperature on a Gemini-3 candidate loads with a
64
+ load-time advisory. **This is in the tag.**
65
+ - **OTLP ingest** — bring your own traces (`normalizeOtlpTraces`,
66
+ `startOtlpEmitterIfConfigured`, the OTel semantic-convention map).
67
+ - **Raw lane** (`runRaw` / `runRawStream`), streaming (`runStream`), the
68
+ grounding-inject rung, the `openai-compat` adapter host, and the Anthropic /
69
+ Grok adapters.
70
+ - **Bake-offs & the optimization loop** — `runBakeoff`, `replayVariant`,
71
+ `computeProposal`, the Wilson-interval stats, the swap ledger + verified-
72
+ savings odometer, and the scheduled Rig Analyst Insights surface.
73
+
74
+ ### Fixed — behaviour
75
+
76
+ - **H1 close-drain.** `rig.close()` now resolves only after the exporter's final
77
+ flush drains and after the artifacts streams drain (stores close last), so a
78
+ one-shot CLI or a serverless per-invocation `close()` can no longer lose the
79
+ last rows. One-shot callers **must** `await rig.close()`.
80
+
81
+ ### Notes
82
+
83
+ - Requires **Node ≥ 20**. Installs a native module (`better-sqlite3`), so the
84
+ machine needs a build toolchain. Assumes a long-lived process with a writable
85
+ disk; serverless and edge callers: see the Runtime requirements section of the
86
+ [quickstart](https://modelrig.dev/quickstart.html).
87
+ - Route output schemas validate under **JSON Schema 2020-12** (primary), with
88
+ **draft-07** also accepted. See the quickstart / route-bundles reference.
89
+
90
+ ## [0.1.0] — 2026-08-07
91
+
92
+ Initial public release: capability-aware gateway, routes-as-code, provider
93
+ adapters (Gemini / OpenAI / DeepSeek), typed failures, budget envelopes, and
94
+ local-first SQLite telemetry.
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or Derivative
95
+ Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 ModelRig
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md CHANGED
@@ -1,12 +1,149 @@
1
- # ModelRig
1
+ # modelrig
2
2
 
3
- **The capability-aware AI gateway. Rig it. Prove it. Sell it.**
3
+ **A capability-aware AI gateway.** You declare a route — the shape of the
4
+ answer you need and the set of models allowed to serve it — and ModelRig picks
5
+ a model that can, validates what comes back, retries the right way when it
6
+ doesn't, and records every attempt. Routes are code, failures are typed, and
7
+ cost is capped by an envelope you set.
4
8
 
5
- This package name is reserved for ModelRig — probes of what every model can
6
- actually do, routes that call a task (not a model), and rails to meter and
7
- sell AI endpoints.
9
+ - Node **≥ 20**
10
+ - Works standalone with just a provider key. The hosted console, bake-offs, and
11
+ the model registry are an optional upgrade — see [Signing up](#what-you-get-by-signing-up).
8
12
 
9
- Full release coming soon.
13
+ ## Install
10
14
 
11
- - Website: [modelrig.ai](https://modelrig.ai)
12
- - Docs: [modelrig.dev](https://modelrig.dev)
15
+ ```bash
16
+ npm i modelrig
17
+ ```
18
+
19
+ > **Native dependency.** ModelRig writes one telemetry row to a local SQLite
20
+ > file before each run returns, so a run never blocks on the network. That
21
+ > buffer is `better-sqlite3`, a native module — prebuilt binaries cover
22
+ > macOS and Linux on x64/arm64 (nearly everyone); an unusual platform will
23
+ > compile it at install time and needs a C++ toolchain. Node ≥ 20 is assumed.
24
+
25
+ ## Quickstart
26
+
27
+ This runs with **only a provider key** — no account, no signup.
28
+
29
+ **1. Set a provider key** (any one your route allows):
30
+
31
+ ```bash
32
+ export GEMINI_API_KEY=... # or OPENAI_API_KEY, ANTHROPIC_API_KEY, …
33
+ ```
34
+
35
+ **2. Define a route** at `modelrig/routes/example.support_summarize.yaml` (the
36
+ example the package ships, in `modelrig/routes/`):
37
+
38
+ ```yaml
39
+ route: example.support_summarize
40
+ version: 1
41
+ schema: ./schemas/support_summarize.schema.json # JSON Schema (2020-12 recommended; draft-07 still accepted)
42
+ candidates: # THE candidate set — nothing else can serve
43
+ - provider: openai
44
+ model: gpt-5.4-mini
45
+ - provider: gemini
46
+ model: gemini-3.1-flash-lite
47
+ - provider: deepseek
48
+ model: deepseek-chat
49
+ require: [schema_conformant]
50
+ prefer: [cost]
51
+ prompt:
52
+ system: ./prompts/support_summarize.system.md # {{var}} + {{#if capability.X}} blocks
53
+ variables: [ticket, product, priorContext]
54
+ policy:
55
+ retries: { content_invalid: 2, network: 4, capacity_shed: 3 }
56
+ timeout_ms: 60000
57
+ tier: flex
58
+ json: native
59
+ ```
60
+
61
+ **3. Call it:**
62
+
63
+ ```ts
64
+ import { createRig, loadConfigFromEnv } from "modelrig";
65
+
66
+ const rig = createRig(loadConfigFromEnv()); // keys from GEMINI_API_KEY etc.
67
+ const result = await rig.run("example.support_summarize", {
68
+ input: { ticket, product, priorContext }, // template variables
69
+ tags: { run_id, step: "summarize" },
70
+ budget: { envelope: run_id }, // hard-stop cost envelope
71
+ });
72
+ // result.output — schema-validated JSON (ajv), regardless of serving model
73
+ // result.meta — servedCandidate, tokens (in/out/cached), cost, tiers,
74
+ // validation status, attempts by failure class
75
+ rig.close();
76
+ ```
77
+
78
+ **Data-governance routing (opt-in).** Add `zero_retention` to a route's
79
+ `require`, or pass `zeroRetention: true` on a single `rig.run(...)` call, to
80
+ route only to zero-retention–designated endpoints. It is a hard, opt-in filter
81
+ that fails closed: if no candidate is designated zero-retention, the run raises
82
+ the no-eligible-candidate error rather than dispatching to a retaining endpoint.
83
+ (Capability gating is on by default here — unlike OpenRouter's opt-in
84
+ `require_parameters`.)
85
+
86
+ **Request-time routing controls (opt-in).** A single `rig.run(...)` call can
87
+ narrow the candidate set: `maxPriceUsdPerMTok` drops any model over a price
88
+ ceiling (unknown price + a ceiling → dropped, fail-closed), and
89
+ `providers: { only, ignore }` restricts or excludes providers. `maxPrice` is a
90
+ candidate *filter* (which models are eligible) — distinct from `budget.envelope`,
91
+ which is a *spend cap* on the run's total cost; both compose, both fail closed on
92
+ unpriced models.
93
+
94
+ **Customer cache handle (opt-in).** If your code already engineered provider
95
+ caching, carry it through: `rig.run(task, { input, cache: { key, provider } })`
96
+ passes a customer-owned cache identifier (a Gemini `cachedContents/<id>`, or a
97
+ `prompt_cache_key` value) verbatim to the matching-provider candidate. It wins
98
+ over the route's `cache: auto` stamp, and a non-matching fallback dispatches
99
+ without it. ModelRig carries the handle and prices the hits — it never creates,
100
+ refreshes, or deletes the resource, so a long job needs your own TTL heartbeat
101
+ (see the [caching lifecycle](https://modelrig.dev/caching-lifecycle.html) doc).
102
+ The Lane-B `rig.runRaw({ provider, model, …, cache: { key } })` seam takes the
103
+ same field.
104
+
105
+ Every attempt is recorded in a local SQLite file (`.modelrig/telemetry.db`)
106
+ tagged with your `tags`. Failures are typed —
107
+ `RigFailureError.failure.class` is one of `content_invalid`, `capacity_shed`,
108
+ `network`, `refusal`, `cache_invalid`, `timeout`, `budget_exhausted`,
109
+ `invariant_violation` — with a separate retry budget per class, so a flaky
110
+ network never spends your content-validation retries.
111
+
112
+ ## CLI
113
+
114
+ The package ships a `modelrig` binary:
115
+
116
+ ```bash
117
+ npx modelrig init # scan a repo for provider call sites, scaffold routes
118
+ npx modelrig bakeoff # compare candidates on recorded inputs
119
+ npx modelrig watch # keep the pricing/capability registry current
120
+ npx modelrig swap # propose + actuate a candidate-set change (git-tracked)
121
+ npx modelrig samples # inspect recorded telemetry samples
122
+ ```
123
+
124
+ `npx modelrig serve` (a thin HTTP wrapper over `rig.run`) lives in a separate
125
+ package, `modelrig-server`; the CLI tells you so if it isn't installed.
126
+
127
+ ## What you get by signing up
128
+
129
+ The gateway above is complete on its own. An account at
130
+ [app.modelrig.ai](https://app.modelrig.ai) adds, as an upgrade — never a gate
131
+ on the quickstart:
132
+
133
+ - a **console** for telemetry, cost, and route health across your runs,
134
+ - **bake-offs** and a maintained **model registry** (pricing + capabilities),
135
+ - **hosted telemetry ingest** — set `MODELRIG_API_KEY=rig_sk_…` and the
136
+ exporter posts to the hosted API instead of writing only local SQLite.
137
+
138
+ ## Honest limits
139
+
140
+ - **Prepaid balances and managed billing are not built yet.** This release is
141
+ the gateway and the self-host lane; the hosted control plane has one customer.
142
+ - **`0.x` means the shape may still move.** Route and config contracts are
143
+ stable enough to build on, not frozen.
144
+ - **`modelrig serve` needs the `modelrig-server` package** — it is not bundled
145
+ here.
146
+
147
+ ## License
148
+
149
+ Apache-2.0. See [LICENSE](./LICENSE).
@@ -0,0 +1,19 @@
1
+ # data/pricing-map.json — provenance
2
+
3
+ Copied manually from `vendor/litellm-upstream/model_prices_and_context_window.json`
4
+ at the pinned SHA recorded in `upstream/litellm.pin.json` (`de706a35a6`, pinned
5
+ 2026-07-30). 2,986 model entries at time of copy.
6
+
7
+ Source: LiteLLM (https://github.com/BerriAI/litellm),
8
+ Copyright (c) 2023 Berri AI, MIT License.
9
+
10
+ NOTE (Phase 0 gap): the automated extraction script (`scripts/sync-upstream.ts`
11
+ with provenance header + diff output) was not built before Phase 1 started, so
12
+ this snapshot was copied by hand per implementation-plan §9. Replace this manual
13
+ copy with the sync script's output when Phase 0 tooling lands; until then, any
14
+ pin bump must re-copy this file and update this note.
15
+
16
+ Key naming (verified against the snapshot):
17
+ - Gemini API models: `gemini/<model>` (bare ids resolve to vertex_ai pricing — do not use)
18
+ - OpenAI models: bare `<model>`
19
+ - DeepSeek models: `deepseek/<model>` (bare ids also present)
@@ -0,0 +1,22 @@
1
+ {
2
+ "_provenance": {
3
+ "role": "Website-sourced per-token prices for hosts that do not expose pricing via an API our key can read (today: Fireworks — its /models listing rejects an inference-scoped key). Hand-read from the vendor's public model page, each entry carrying its source URL + read date. Merged into pricing-overlay.json by scripts/pricing-sweep.ts alongside the API-swept prices; both are gap-fillers beneath the pinned LiteLLM snapshot (snapshot wins on shared keys). Replace an entry here with an API/scraper adapter when one exists.",
4
+ "note": "Flat prices (input_cost_per_token / output / cache_read) are the BASE serverless standard rate. Serving-tier multipliers (Fireworks: +25% priority, +50% fast, +10% US-only) are now carried in the additive `pricing_v2` block (pricing-first-class spec) as MULTIPLIERS on base (1.25 / 1.5 / 1.1). Context-length/batch/modality bands are still uncaptured for this model and are absent (not guessed). The flat fields stay for backward compatibility."
5
+ },
6
+ "prices": {
7
+ "fireworks_ai/accounts/fireworks/models/kimi-k3": {
8
+ "input_cost_per_token": 3.0e-6,
9
+ "output_cost_per_token": 1.5e-5,
10
+ "cache_read_input_token_cost": 3.0e-7,
11
+ "source": "fireworks-website:https://fireworks.ai/models/fireworks/kimi-k3 (base serverless standard; +25% priority / +50% fast / +10% US-only)",
12
+ "as_of": "2026-08-09",
13
+ "pricing_v2": {
14
+ "base": { "input": 3.0e-6, "output": 1.5e-5, "cache_read": 3.0e-7 },
15
+ "tiers": { "priority": 1.25, "fast": 1.5, "region_us": 1.1 },
16
+ "source": "fireworks-website:https://fireworks.ai/models/fireworks/kimi-k3",
17
+ "as_of": "2026-08-09",
18
+ "basis": "base serverless · standard tier · text"
19
+ }
20
+ }
21
+ }
22
+ }