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.
- package/CHANGELOG.md +94 -0
- package/LICENSE +201 -0
- package/README.md +145 -8
- package/data/PROVENANCE.md +19 -0
- package/data/pricing-manual.json +22 -0
- package/data/pricing-map.json +46362 -0
- package/data/pricing-overlay.json +419 -0
- package/dist/adapters/anthropic.d.ts +90 -0
- package/dist/adapters/anthropic.d.ts.map +1 -0
- package/dist/adapters/anthropic.js +296 -0
- package/dist/adapters/build-adapters.d.ts +11 -0
- package/dist/adapters/build-adapters.d.ts.map +1 -0
- package/dist/adapters/build-adapters.js +45 -0
- package/dist/adapters/deepseek.d.ts +47 -0
- package/dist/adapters/deepseek.d.ts.map +1 -0
- package/dist/adapters/deepseek.js +216 -0
- package/dist/adapters/gemini.d.ts +44 -0
- package/dist/adapters/gemini.d.ts.map +1 -0
- package/dist/adapters/gemini.js +262 -0
- package/dist/adapters/grok.d.ts +53 -0
- package/dist/adapters/grok.d.ts.map +1 -0
- package/dist/adapters/grok.js +232 -0
- package/dist/adapters/openai-compat.d.ts +80 -0
- package/dist/adapters/openai-compat.d.ts.map +1 -0
- package/dist/adapters/openai-compat.js +244 -0
- package/dist/adapters/openai-stream.d.ts +58 -0
- package/dist/adapters/openai-stream.d.ts.map +1 -0
- package/dist/adapters/openai-stream.js +120 -0
- package/dist/adapters/openai.d.ts +55 -0
- package/dist/adapters/openai.d.ts.map +1 -0
- package/dist/adapters/openai.js +281 -0
- package/dist/adapters/sampling.d.ts +28 -0
- package/dist/adapters/sampling.d.ts.map +1 -0
- package/dist/adapters/sampling.js +34 -0
- package/dist/adapters/tool-mapping.d.ts +92 -0
- package/dist/adapters/tool-mapping.d.ts.map +1 -0
- package/dist/adapters/tool-mapping.js +143 -0
- package/dist/artifacts/artifact.d.ts +137 -0
- package/dist/artifacts/artifact.d.ts.map +1 -0
- package/dist/artifacts/artifact.js +377 -0
- package/dist/artifacts/content-uploader.d.ts +87 -0
- package/dist/artifacts/content-uploader.d.ts.map +1 -0
- package/dist/artifacts/content-uploader.js +124 -0
- package/dist/artifacts/index.d.ts +63 -0
- package/dist/artifacts/index.d.ts.map +1 -0
- package/dist/artifacts/index.js +80 -0
- package/dist/artifacts/run-context.d.ts +129 -0
- package/dist/artifacts/run-context.d.ts.map +1 -0
- package/dist/artifacts/run-context.js +208 -0
- package/dist/artifacts/scrub.d.ts +60 -0
- package/dist/artifacts/scrub.d.ts.map +1 -0
- package/dist/artifacts/scrub.js +139 -0
- package/dist/artifacts/step.d.ts +26 -0
- package/dist/artifacts/step.d.ts.map +1 -0
- package/dist/artifacts/step.js +37 -0
- package/dist/artifacts/taint.d.ts +63 -0
- package/dist/artifacts/taint.d.ts.map +1 -0
- package/dist/artifacts/taint.js +76 -0
- package/dist/bakeoff/cache-sim.d.ts +99 -0
- package/dist/bakeoff/cache-sim.d.ts.map +1 -0
- package/dist/bakeoff/cache-sim.js +126 -0
- package/dist/bakeoff/engine.d.ts +52 -0
- package/dist/bakeoff/engine.d.ts.map +1 -0
- package/dist/bakeoff/engine.js +163 -0
- package/dist/bakeoff/eval-cases.d.ts +96 -0
- package/dist/bakeoff/eval-cases.d.ts.map +1 -0
- package/dist/bakeoff/eval-cases.js +105 -0
- package/dist/bakeoff/replay.d.ts +52 -0
- package/dist/bakeoff/replay.d.ts.map +1 -0
- package/dist/bakeoff/replay.js +94 -0
- package/dist/bakeoff/report.d.ts +41 -0
- package/dist/bakeoff/report.d.ts.map +1 -0
- package/dist/bakeoff/report.js +142 -0
- package/dist/bakeoff/samples.d.ts +77 -0
- package/dist/bakeoff/samples.d.ts.map +1 -0
- package/dist/bakeoff/samples.js +148 -0
- package/dist/bakeoff/stats.d.ts +13 -0
- package/dist/bakeoff/stats.d.ts.map +1 -0
- package/dist/bakeoff/stats.js +48 -0
- package/dist/bakeoff/types.d.ts +37 -0
- package/dist/bakeoff/types.d.ts.map +1 -0
- package/dist/bakeoff/types.js +10 -0
- package/dist/cli.d.ts +25 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +590 -0
- package/dist/config.d.ts +204 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +252 -0
- package/dist/deprecations.d.ts +32 -0
- package/dist/deprecations.d.ts.map +1 -0
- package/dist/deprecations.js +59 -0
- package/dist/feedback/coverage.d.ts +32 -0
- package/dist/feedback/coverage.d.ts.map +1 -0
- package/dist/feedback/coverage.js +95 -0
- package/dist/feedback/feedback.d.ts +35 -0
- package/dist/feedback/feedback.d.ts.map +1 -0
- package/dist/feedback/feedback.js +39 -0
- package/dist/gateway/http-protocol.d.ts +175 -0
- package/dist/gateway/http-protocol.d.ts.map +1 -0
- package/dist/gateway/http-protocol.js +105 -0
- package/dist/index.d.ts +242 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +576 -0
- package/dist/init/finder.d.ts +94 -0
- package/dist/init/finder.d.ts.map +1 -0
- package/dist/init/finder.js +343 -0
- package/dist/init/init-cli.d.ts +10 -0
- package/dist/init/init-cli.d.ts.map +1 -0
- package/dist/init/init-cli.js +86 -0
- package/dist/init/observe-cli.d.ts +19 -0
- package/dist/init/observe-cli.d.ts.map +1 -0
- package/dist/init/observe-cli.js +73 -0
- package/dist/init/observe.d.ts +81 -0
- package/dist/init/observe.d.ts.map +1 -0
- package/dist/init/observe.js +245 -0
- package/dist/init/run.d.ts +99 -0
- package/dist/init/run.d.ts.map +1 -0
- package/dist/init/run.js +281 -0
- package/dist/init/signatures.d.ts +39 -0
- package/dist/init/signatures.d.ts.map +1 -0
- package/dist/init/signatures.js +116 -0
- package/dist/matrix/aggregate.d.ts +89 -0
- package/dist/matrix/aggregate.d.ts.map +1 -0
- package/dist/matrix/aggregate.js +186 -0
- package/dist/query/grammar.d.ts +35 -0
- package/dist/query/grammar.d.ts.map +1 -0
- package/dist/query/grammar.js +279 -0
- package/dist/query/run.d.ts +8 -0
- package/dist/query/run.d.ts.map +1 -0
- package/dist/query/run.js +21 -0
- package/dist/registry/build.d.ts +219 -0
- package/dist/registry/build.d.ts.map +1 -0
- package/dist/registry/build.js +313 -0
- package/dist/registry/cache-policy.d.ts +94 -0
- package/dist/registry/cache-policy.d.ts.map +1 -0
- package/dist/registry/cache-policy.js +238 -0
- package/dist/registry/call-notes.d.ts +11 -0
- package/dist/registry/call-notes.d.ts.map +1 -0
- package/dist/registry/call-notes.js +110 -0
- package/dist/registry/claims.d.ts +63 -0
- package/dist/registry/claims.d.ts.map +1 -0
- package/dist/registry/claims.js +107 -0
- package/dist/registry/effective-rate.d.ts +151 -0
- package/dist/registry/effective-rate.d.ts.map +1 -0
- package/dist/registry/effective-rate.js +156 -0
- package/dist/registry/facts.d.ts +32 -0
- package/dist/registry/facts.d.ts.map +1 -0
- package/dist/registry/facts.js +136 -0
- package/dist/registry/fingerprint.d.ts +20 -0
- package/dist/registry/fingerprint.d.ts.map +1 -0
- package/dist/registry/fingerprint.js +150 -0
- package/dist/registry/parity.d.ts +52 -0
- package/dist/registry/parity.d.ts.map +1 -0
- package/dist/registry/parity.js +82 -0
- package/dist/registry/pricing-shape.d.ts +113 -0
- package/dist/registry/pricing-shape.d.ts.map +1 -0
- package/dist/registry/pricing-shape.js +123 -0
- package/dist/registry/pricing.d.ts +43 -0
- package/dist/registry/pricing.d.ts.map +1 -0
- package/dist/registry/pricing.js +127 -0
- package/dist/registry/rows.d.ts +16 -0
- package/dist/registry/rows.d.ts.map +1 -0
- package/dist/registry/rows.js +57 -0
- package/dist/registry/seed.d.ts +43 -0
- package/dist/registry/seed.d.ts.map +1 -0
- package/dist/registry/seed.js +97 -0
- package/dist/registry/select.d.ts +68 -0
- package/dist/registry/select.d.ts.map +1 -0
- package/dist/registry/select.js +141 -0
- package/dist/registry/staleness.d.ts +18 -0
- package/dist/registry/staleness.d.ts.map +1 -0
- package/dist/registry/staleness.js +39 -0
- package/dist/rigindex/bootstrap.d.ts +36 -0
- package/dist/rigindex/bootstrap.d.ts.map +1 -0
- package/dist/rigindex/bootstrap.js +97 -0
- package/dist/rigindex/fit.d.ts +24 -0
- package/dist/rigindex/fit.d.ts.map +1 -0
- package/dist/rigindex/fit.js +76 -0
- package/dist/rigindex/gates.d.ts +52 -0
- package/dist/rigindex/gates.d.ts.map +1 -0
- package/dist/rigindex/gates.js +109 -0
- package/dist/rigindex/graph.d.ts +31 -0
- package/dist/rigindex/graph.d.ts.map +1 -0
- package/dist/rigindex/graph.js +120 -0
- package/dist/rigindex/index.d.ts +23 -0
- package/dist/rigindex/index.d.ts.map +1 -0
- package/dist/rigindex/index.js +112 -0
- package/dist/rigindex/types.d.ts +76 -0
- package/dist/rigindex/types.d.ts.map +1 -0
- package/dist/rigindex/types.js +8 -0
- package/dist/routes/cache-lint.d.ts +41 -0
- package/dist/routes/cache-lint.d.ts.map +1 -0
- package/dist/routes/cache-lint.js +81 -0
- package/dist/routes/draft.d.ts +83 -0
- package/dist/routes/draft.d.ts.map +1 -0
- package/dist/routes/draft.js +135 -0
- package/dist/routes/loader.d.ts +63 -0
- package/dist/routes/loader.d.ts.map +1 -0
- package/dist/routes/loader.js +574 -0
- package/dist/routes/manifest.d.ts +24 -0
- package/dist/routes/manifest.d.ts.map +1 -0
- package/dist/routes/manifest.js +118 -0
- package/dist/routes/resolved-bundle.d.ts +79 -0
- package/dist/routes/resolved-bundle.d.ts.map +1 -0
- package/dist/routes/resolved-bundle.js +148 -0
- package/dist/routes/sampling-config.d.ts +32 -0
- package/dist/routes/sampling-config.d.ts.map +1 -0
- package/dist/routes/sampling-config.js +91 -0
- package/dist/routes/serveability.d.ts +52 -0
- package/dist/routes/serveability.d.ts.map +1 -0
- package/dist/routes/serveability.js +73 -0
- package/dist/routes/template.d.ts +18 -0
- package/dist/routes/template.d.ts.map +1 -0
- package/dist/routes/template.js +94 -0
- package/dist/run/ajv.d.ts +22 -0
- package/dist/run/ajv.d.ts.map +1 -0
- package/dist/run/ajv.js +32 -0
- package/dist/run/cache-handle.d.ts +58 -0
- package/dist/run/cache-handle.d.ts.map +1 -0
- package/dist/run/cache-handle.js +54 -0
- package/dist/run/cache-stamp.d.ts +65 -0
- package/dist/run/cache-stamp.d.ts.map +1 -0
- package/dist/run/cache-stamp.js +0 -0
- package/dist/run/capture-write.d.ts +33 -0
- package/dist/run/capture-write.d.ts.map +1 -0
- package/dist/run/capture-write.js +55 -0
- package/dist/run/cost.d.ts +26 -0
- package/dist/run/cost.d.ts.map +1 -0
- package/dist/run/cost.js +41 -0
- package/dist/run/dispatch.d.ts +99 -0
- package/dist/run/dispatch.d.ts.map +1 -0
- package/dist/run/dispatch.js +191 -0
- package/dist/run/envelope.d.ts +21 -0
- package/dist/run/envelope.d.ts.map +1 -0
- package/dist/run/envelope.js +45 -0
- package/dist/run/grounding.d.ts +56 -0
- package/dist/run/grounding.d.ts.map +1 -0
- package/dist/run/grounding.js +89 -0
- package/dist/run/raw.d.ts +88 -0
- package/dist/run/raw.d.ts.map +1 -0
- package/dist/run/raw.js +286 -0
- package/dist/run/record-attempt.d.ts +40 -0
- package/dist/run/record-attempt.d.ts.map +1 -0
- package/dist/run/record-attempt.js +99 -0
- package/dist/run/repair.d.ts +36 -0
- package/dist/run/repair.d.ts.map +1 -0
- package/dist/run/repair.js +61 -0
- package/dist/run/resolve.d.ts +99 -0
- package/dist/run/resolve.d.ts.map +1 -0
- package/dist/run/resolve.js +203 -0
- package/dist/run/retry.d.ts +19 -0
- package/dist/run/retry.d.ts.map +1 -0
- package/dist/run/retry.js +50 -0
- package/dist/run/run.d.ts +55 -0
- package/dist/run/run.d.ts.map +1 -0
- package/dist/run/run.js +540 -0
- package/dist/run/stream.d.ts +49 -0
- package/dist/run/stream.d.ts.map +1 -0
- package/dist/run/stream.js +87 -0
- package/dist/run/validate.d.ts +15 -0
- package/dist/run/validate.d.ts.map +1 -0
- package/dist/run/validate.js +55 -0
- package/dist/savings/cache-ledger.d.ts +108 -0
- package/dist/savings/cache-ledger.d.ts.map +1 -0
- package/dist/savings/cache-ledger.js +174 -0
- package/dist/savings/cache-reconcile.d.ts +64 -0
- package/dist/savings/cache-reconcile.d.ts.map +1 -0
- package/dist/savings/cache-reconcile.js +59 -0
- package/dist/savings/cache-stats.d.ts +63 -0
- package/dist/savings/cache-stats.d.ts.map +1 -0
- package/dist/savings/cache-stats.js +108 -0
- package/dist/savings/emit.d.ts +38 -0
- package/dist/savings/emit.d.ts.map +1 -0
- package/dist/savings/emit.js +100 -0
- package/dist/savings/odometer.d.ts +32 -0
- package/dist/savings/odometer.d.ts.map +1 -0
- package/dist/savings/odometer.js +70 -0
- package/dist/savings/swap-execute.d.ts +58 -0
- package/dist/savings/swap-execute.d.ts.map +1 -0
- package/dist/savings/swap-execute.js +130 -0
- package/dist/savings/swaps-client.d.ts +55 -0
- package/dist/savings/swaps-client.d.ts.map +1 -0
- package/dist/savings/swaps-client.js +95 -0
- package/dist/settings/api-fetcher.d.ts +39 -0
- package/dist/settings/api-fetcher.d.ts.map +1 -0
- package/dist/settings/api-fetcher.js +92 -0
- package/dist/settings/index.d.ts +10 -0
- package/dist/settings/index.d.ts.map +1 -0
- package/dist/settings/index.js +15 -0
- package/dist/settings/task-settings.d.ts +91 -0
- package/dist/settings/task-settings.d.ts.map +1 -0
- package/dist/settings/task-settings.js +116 -0
- package/dist/status.d.ts +77 -0
- package/dist/status.d.ts.map +1 -0
- package/dist/status.js +113 -0
- package/dist/telemetry/artifact-store.d.ts +48 -0
- package/dist/telemetry/artifact-store.d.ts.map +1 -0
- package/dist/telemetry/artifact-store.js +189 -0
- package/dist/telemetry/cache-miss-streak.d.ts +79 -0
- package/dist/telemetry/cache-miss-streak.d.ts.map +1 -0
- package/dist/telemetry/cache-miss-streak.js +99 -0
- package/dist/telemetry/capture.d.ts +31 -0
- package/dist/telemetry/capture.d.ts.map +1 -0
- package/dist/telemetry/capture.js +81 -0
- package/dist/telemetry/exporter-setup.d.ts +28 -0
- package/dist/telemetry/exporter-setup.d.ts.map +1 -0
- package/dist/telemetry/exporter-setup.js +34 -0
- package/dist/telemetry/exporter.d.ts +137 -0
- package/dist/telemetry/exporter.d.ts.map +1 -0
- package/dist/telemetry/exporter.js +510 -0
- package/dist/telemetry/health.d.ts +76 -0
- package/dist/telemetry/health.d.ts.map +1 -0
- package/dist/telemetry/health.js +92 -0
- package/dist/telemetry/ingest-protocol.d.ts +310 -0
- package/dist/telemetry/ingest-protocol.d.ts.map +1 -0
- package/dist/telemetry/ingest-protocol.js +363 -0
- package/dist/telemetry/load-error-report.d.ts +24 -0
- package/dist/telemetry/load-error-report.d.ts.map +1 -0
- package/dist/telemetry/load-error-report.js +50 -0
- package/dist/telemetry/otel-map.d.ts +121 -0
- package/dist/telemetry/otel-map.d.ts.map +1 -0
- package/dist/telemetry/otel-map.js +224 -0
- package/dist/telemetry/otel-normalize.d.ts +104 -0
- package/dist/telemetry/otel-normalize.d.ts.map +1 -0
- package/dist/telemetry/otel-normalize.js +530 -0
- package/dist/telemetry/otlp-emitter.d.ts +52 -0
- package/dist/telemetry/otlp-emitter.d.ts.map +1 -0
- package/dist/telemetry/otlp-emitter.js +144 -0
- package/dist/telemetry/otlp-proto.d.ts +29 -0
- package/dist/telemetry/otlp-proto.d.ts.map +1 -0
- package/dist/telemetry/otlp-proto.js +266 -0
- package/dist/telemetry/sinks.d.ts +90 -0
- package/dist/telemetry/sinks.d.ts.map +1 -0
- package/dist/telemetry/sinks.js +180 -0
- package/dist/telemetry/store.d.ts +65 -0
- package/dist/telemetry/store.d.ts.map +1 -0
- package/dist/telemetry/store.js +547 -0
- package/dist/tenancy/api-key-format.d.ts +77 -0
- package/dist/tenancy/api-key-format.d.ts.map +1 -0
- package/dist/tenancy/api-key-format.js +110 -0
- package/dist/tenancy/constants.d.ts +23 -0
- package/dist/tenancy/constants.d.ts.map +1 -0
- package/dist/tenancy/constants.js +25 -0
- package/dist/tenancy/scrub.d.ts +47 -0
- package/dist/tenancy/scrub.d.ts.map +1 -0
- package/dist/tenancy/scrub.js +85 -0
- package/dist/types/config-teaching.d.ts +62 -0
- package/dist/types/config-teaching.d.ts.map +1 -0
- package/dist/types/config-teaching.js +183 -0
- package/dist/types/failures-teaching.d.ts +56 -0
- package/dist/types/failures-teaching.d.ts.map +1 -0
- package/dist/types/failures-teaching.js +177 -0
- package/dist/types/failures.d.ts +27 -0
- package/dist/types/failures.d.ts.map +1 -0
- package/dist/types/failures.js +41 -0
- package/dist/types/provider.d.ts +200 -0
- package/dist/types/provider.d.ts.map +1 -0
- package/dist/types/provider.js +40 -0
- package/dist/types/route.d.ts +205 -0
- package/dist/types/route.d.ts.map +1 -0
- package/dist/types/route.js +6 -0
- package/dist/types/telemetry.d.ts +206 -0
- package/dist/types/telemetry.d.ts.map +1 -0
- package/dist/types/telemetry.js +6 -0
- package/dist/validate-cli.d.ts +12 -0
- package/dist/validate-cli.d.ts.map +1 -0
- package/dist/validate-cli.js +57 -0
- package/dist/verify/capture.d.ts +66 -0
- package/dist/verify/capture.d.ts.map +1 -0
- package/dist/verify/capture.js +180 -0
- package/dist/verify/cli-run.d.ts +23 -0
- package/dist/verify/cli-run.d.ts.map +1 -0
- package/dist/verify/cli-run.js +57 -0
- package/dist/verify/diff.d.ts +48 -0
- package/dist/verify/diff.d.ts.map +1 -0
- package/dist/verify/diff.js +157 -0
- package/dist/verify/index.d.ts +17 -0
- package/dist/verify/index.d.ts.map +1 -0
- package/dist/verify/index.js +24 -0
- package/dist/verify/report.d.ts +14 -0
- package/dist/verify/report.d.ts.map +1 -0
- package/dist/verify/report.js +88 -0
- package/dist/verify/types.d.ts +101 -0
- package/dist/verify/types.d.ts.map +1 -0
- package/dist/verify/types.js +17 -0
- package/dist/verify/verify.d.ts +29 -0
- package/dist/verify/verify.d.ts.map +1 -0
- package/dist/verify/verify.js +148 -0
- package/dist/watch/budget.d.ts +19 -0
- package/dist/watch/budget.d.ts.map +1 -0
- package/dist/watch/budget.js +35 -0
- package/dist/watch/evaluate.d.ts +225 -0
- package/dist/watch/evaluate.d.ts.map +1 -0
- package/dist/watch/evaluate.js +155 -0
- package/dist/watch/monitor.d.ts +116 -0
- package/dist/watch/monitor.d.ts.map +1 -0
- package/dist/watch/monitor.js +199 -0
- package/dist/watch/proposals.d.ts +89 -0
- package/dist/watch/proposals.d.ts.map +1 -0
- package/dist/watch/proposals.js +197 -0
- package/dist/watch/run-record.d.ts +64 -0
- package/dist/watch/run-record.d.ts.map +1 -0
- package/dist/watch/run-record.js +86 -0
- package/dist/watch/run-reported.d.ts +20 -0
- package/dist/watch/run-reported.d.ts.map +1 -0
- package/dist/watch/run-reported.js +53 -0
- package/dist/watch/run.d.ts +73 -0
- package/dist/watch/run.d.ts.map +1 -0
- package/dist/watch/run.js +83 -0
- package/dist/watch/state-store.d.ts +48 -0
- package/dist/watch/state-store.d.ts.map +1 -0
- package/dist/watch/state-store.js +86 -0
- package/dist/watch/state.d.ts +21 -0
- package/dist/watch/state.d.ts.map +1 -0
- package/dist/watch/state.js +93 -0
- package/package.json +56 -14
- package/registry/LICENSE +20 -0
- package/registry/leaderboard.json +3639 -0
- package/registry/registry.json +7263 -0
- package/index.js +0 -3
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Cache Policy Registry — cache-aware-routing spec §3, [Briefing §7].
|
|
4
|
+
*
|
|
5
|
+
* Per-provider cache SEMANTICS as versioned DATA, never routing code: TTLs,
|
|
6
|
+
* refresh-on-read, minimum-cacheable prefix, key mechanism, telemetry dialect,
|
|
7
|
+
* endpoint affinity. A provider rule change (OpenAI shipping paid writes,
|
|
8
|
+
* Anthropic GA-ing the 1h TTL) becomes a data edit here with a new `as_of`, not
|
|
9
|
+
* a code change anywhere else — the whole point of the registry.
|
|
10
|
+
*
|
|
11
|
+
* TWO HOMES, both pre-existing (spec §3):
|
|
12
|
+
* • RATES ride pricing — `ModelPricingV2.base.{cache_read,cache_write,
|
|
13
|
+
* cache_write_1h}` and flat `ModelPricing.cacheWrite*UsdPerTok`, entered via
|
|
14
|
+
* the pricing sweep with source+as_of. NOT here.
|
|
15
|
+
* • POLICY (this file) is the non-price semantics.
|
|
16
|
+
*
|
|
17
|
+
* L5 (fail-closed): every field cites a first-party page (research §2.1, fetched
|
|
18
|
+
* 2026-08-18). A value we could not verify is `null` (or `cache_supported:
|
|
19
|
+
* false`) — never a guess. `getCachePolicy` returns a fail-closed
|
|
20
|
+
* `cache_supported: false` policy for any provider not seeded, identical posture
|
|
21
|
+
* to the zero-coverage gates.
|
|
22
|
+
*
|
|
23
|
+
* ── CROSS-REFERENCES (no import — the probes package is standalone since P2) ──
|
|
24
|
+
* • `min_cacheable_tokens` is reconciled by hand against the probes package's
|
|
25
|
+
* `MIN_CACHEABLE_TOKENS` (packages/modelrig-probes/src/caching.ts, PR #157),
|
|
26
|
+
* which cites the same first-party pages. See MIN_CACHEABLE_RECONCILIATION
|
|
27
|
+
* below for the value-by-value comparison and the two deliberate deltas
|
|
28
|
+
* (anthropic, gemini) flagged for the architect to converge if desired. A
|
|
29
|
+
* reciprocal comment lives in caching.ts.
|
|
30
|
+
* • OBSERVED cache facts (`cache_hit_rate`, `mean_cached_tokens`,
|
|
31
|
+
* `declared_caching_unrealized`) are materialized separately in
|
|
32
|
+
* `src/registry/build.ts` from probe/production telemetry — the DECLARED
|
|
33
|
+
* policy here is the counterpart truth, and the §5.6 streak alert (WS-C)
|
|
34
|
+
* cross-references `declared_caching_unrealized` (same smell, other plane).
|
|
35
|
+
*/
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.failClosedCachePolicy = failClosedCachePolicy;
|
|
38
|
+
exports.getCachePolicy = getCachePolicy;
|
|
39
|
+
exports.seededCachePolicyProviders = seededCachePolicyProviders;
|
|
40
|
+
const AS_OF = "2026-08-18";
|
|
41
|
+
/**
|
|
42
|
+
* min_cacheable_tokens reconciliation vs probes `MIN_CACHEABLE_TOKENS`
|
|
43
|
+
* (packages/modelrig-probes/src/caching.ts, PR #157). Same first-party pages;
|
|
44
|
+
* the two tables cannot share by import (probes is standalone). The probe table
|
|
45
|
+
* is a conservative PROBE-ELIGIBILITY gate — it decides whether to SPEND a
|
|
46
|
+
* paired probe call, so it errs toward the larger provider-wide bound. This
|
|
47
|
+
* registry records the documented minimum for the models ModelRig actually
|
|
48
|
+
* serves, for accounting/policy. Value-by-value (registry ⇄ probes):
|
|
49
|
+
*
|
|
50
|
+
* anthropic 1024 ⇄ 2048 DELTA — registry = Sonnet 5 / Opus 4.8 minimum
|
|
51
|
+
* (the deployed frontier; Opus 5/Fable 5 = 512,
|
|
52
|
+
* Haiku up to 4096); probes uses a haiku-safe 2048.
|
|
53
|
+
* openai 1024 ⇄ 1024 agree (automatic prefix engages ≥1024).
|
|
54
|
+
* gemini 4096 ⇄ 2048 DELTA — registry = implicit-caching 4096-token
|
|
55
|
+
* minimum prefix (research §2.1 / spec §1.4); probes
|
|
56
|
+
* uses 2048. FLAGGED for the architect to converge.
|
|
57
|
+
* deepseek 64 ⇄ 64 agree (64-token cache blocks).
|
|
58
|
+
* grok null ⇄ 1024* registry = no documented minimum (L5 null);
|
|
59
|
+
* deepinfra null ⇄ 1024* probes falls these to DEFAULT_MIN_CACHEABLE_TOKENS
|
|
60
|
+
* fireworks null ⇄ 1024* (1024) as an operational gate. Deliberate divergence:
|
|
61
|
+
* the registry will not assert a minimum it cannot
|
|
62
|
+
* source first-party.
|
|
63
|
+
*/
|
|
64
|
+
const POLICIES = {
|
|
65
|
+
// Anthropic — explicit cache_control (≤4 breakpoints) + automatic top-level
|
|
66
|
+
// mode. Writes 1.25× (5m) / 2× (1h); reads 0.1×. platform.claude.com
|
|
67
|
+
// prompt-caching, fetched 2026-08-18 (research §2.1).
|
|
68
|
+
anthropic: {
|
|
69
|
+
cache_supported: true,
|
|
70
|
+
mode: "explicit_breakpoints",
|
|
71
|
+
default_ttl_seconds: 300, // 5-min ephemeral, refreshes free on read
|
|
72
|
+
extended_ttl_seconds: 3600, // 1h GA at the 2× write multiplier
|
|
73
|
+
ttl_refresh_on_read: true, // documented: a read refreshes the 5m window
|
|
74
|
+
min_cacheable_tokens: 1024, // Sonnet 5 / Opus 4.8 (deployed); see reconciliation
|
|
75
|
+
cache_key_param: "cache_control",
|
|
76
|
+
reports_read_tokens: true, // cache_read_input_tokens
|
|
77
|
+
reports_write_tokens: true, // cache_creation_input_tokens (+ 5m/1h split)
|
|
78
|
+
usage_dialect: "anthropic",
|
|
79
|
+
provider_affinity_required: false, // model-scoped/workspace-isolated, no endpoint stickiness
|
|
80
|
+
source: "platform.claude.com/docs prompt-caching (fetched 2026-08-18)",
|
|
81
|
+
as_of: AS_OF,
|
|
82
|
+
policy_version: AS_OF,
|
|
83
|
+
},
|
|
84
|
+
// OpenAI — automatic prefix caching (≤5.5 baseline). Reads 0.1×; writes free
|
|
85
|
+
// ≤5.5, and GPT-5.6+ adds explicit breakpoints + PAID writes (1.25×, exact
|
|
86
|
+
// 30-min TTL) reported as input_tokens_details.cache_write_tokens.
|
|
87
|
+
// developers.openai.com prompt-caching, fetched 2026-08-18 (research §2.1).
|
|
88
|
+
openai: {
|
|
89
|
+
cache_supported: true,
|
|
90
|
+
mode: "automatic_prefix", // 5.6+ additionally supports explicit_breakpoints
|
|
91
|
+
default_ttl_seconds: 600, // 5-10 min inactivity window (5.6+: exact 30 min)
|
|
92
|
+
extended_ttl_seconds: 86400, // optional 24h retention, same price
|
|
93
|
+
ttl_refresh_on_read: true, // inactivity-based window — activity extends it (≤5.5)
|
|
94
|
+
min_cacheable_tokens: 1024, // automatic prefix engages at ≥1024 tokens
|
|
95
|
+
cache_key_param: "prompt_cache_key", // routing hint (not required to cache)
|
|
96
|
+
reports_read_tokens: true, // prompt_tokens_details.cached_tokens
|
|
97
|
+
reports_write_tokens: true, // input_tokens_details.cache_write_tokens (5.6+; 0 on ≤5.5)
|
|
98
|
+
usage_dialect: "openai_details",
|
|
99
|
+
provider_affinity_required: true, // ~15 req/min/key affinity (research §2.5)
|
|
100
|
+
source: "developers.openai.com/docs prompt-caching (fetched 2026-08-18)",
|
|
101
|
+
as_of: AS_OF,
|
|
102
|
+
policy_version: AS_OF,
|
|
103
|
+
},
|
|
104
|
+
// DeepSeek — automatic disk cache, always on. Reads ~0.03× (deepest in
|
|
105
|
+
// market); writes free. Usage is a hit/miss PARTITION (not a subset).
|
|
106
|
+
// api-docs.deepseek.com, fetched 2026-08-18 (research §2.1).
|
|
107
|
+
deepseek: {
|
|
108
|
+
cache_supported: true,
|
|
109
|
+
mode: "automatic_prefix",
|
|
110
|
+
default_ttl_seconds: null, // "hours to days", no exact documented TTL
|
|
111
|
+
extended_ttl_seconds: null,
|
|
112
|
+
ttl_refresh_on_read: false, // undocumented → conservative
|
|
113
|
+
min_cacheable_tokens: 64, // 64-token cache blocks (matches probes)
|
|
114
|
+
cache_key_param: null, // pure automatic, no key
|
|
115
|
+
reports_read_tokens: true, // prompt_cache_hit_tokens
|
|
116
|
+
reports_write_tokens: false, // writes free; miss tokens are the non-cached input
|
|
117
|
+
usage_dialect: "deepseek_partition",
|
|
118
|
+
provider_affinity_required: false,
|
|
119
|
+
source: "api-docs.deepseek.com context-caching (fetched 2026-08-18)",
|
|
120
|
+
as_of: AS_OF,
|
|
121
|
+
policy_version: AS_OF,
|
|
122
|
+
},
|
|
123
|
+
// Gemini — implicit caching, default-on 2.5+. Reads 0.1×; writes free. TTL is
|
|
124
|
+
// undocumented best-effort. EXCLUDED from WS-C `cache: auto` (its adapter
|
|
125
|
+
// treats any cache.key as a cachedContents RESOURCE NAME and drops
|
|
126
|
+
// systemInstruction+tools — gemini.ts:145). ai.google.dev, fetched 2026-08-18.
|
|
127
|
+
gemini: {
|
|
128
|
+
cache_supported: true,
|
|
129
|
+
mode: "automatic_prefix",
|
|
130
|
+
default_ttl_seconds: null, // undocumented best-effort
|
|
131
|
+
extended_ttl_seconds: null,
|
|
132
|
+
ttl_refresh_on_read: false, // undocumented → conservative
|
|
133
|
+
min_cacheable_tokens: 4096, // implicit-caching minimum prefix (spec §1.4); see reconciliation
|
|
134
|
+
cache_key_param: null, // implicit only; the cachedContents API is a different (explicit) product
|
|
135
|
+
reports_read_tokens: true, // usageMetadata.cachedContentTokenCount
|
|
136
|
+
reports_write_tokens: false,
|
|
137
|
+
usage_dialect: "gemini_metadata",
|
|
138
|
+
provider_affinity_required: false,
|
|
139
|
+
source: "ai.google.dev/gemini-api context-caching (fetched 2026-08-18)",
|
|
140
|
+
as_of: AS_OF,
|
|
141
|
+
policy_version: AS_OF,
|
|
142
|
+
},
|
|
143
|
+
// Grok (xAI) — automatic caching; reads 0.25× (Grok 4.6, model-varying),
|
|
144
|
+
// writes free. TTL ~5 min (3rd-party). docs.x.ai, fetched 2026-08-18.
|
|
145
|
+
grok: {
|
|
146
|
+
cache_supported: true,
|
|
147
|
+
mode: "automatic_prefix",
|
|
148
|
+
default_ttl_seconds: 300, // ~5 min (3rd-party; not first-party confirmed)
|
|
149
|
+
extended_ttl_seconds: null,
|
|
150
|
+
ttl_refresh_on_read: false, // undocumented → conservative
|
|
151
|
+
min_cacheable_tokens: null, // no documented minimum (L5)
|
|
152
|
+
cache_key_param: "prompt_cache_key", // x-grok-conv-id / prompt_cache_key hint
|
|
153
|
+
reports_read_tokens: true, // prompt_tokens_details.cached_tokens (compat)
|
|
154
|
+
reports_write_tokens: false,
|
|
155
|
+
usage_dialect: "openai_details",
|
|
156
|
+
provider_affinity_required: false, // team-scoped, undocumented
|
|
157
|
+
source: "docs.x.ai prompt-caching (fetched 2026-08-18)",
|
|
158
|
+
as_of: AS_OF,
|
|
159
|
+
policy_version: AS_OF,
|
|
160
|
+
},
|
|
161
|
+
// Fireworks — automatic caching on all models; reads ~0.5× serverless / free
|
|
162
|
+
// dedicated. Usage rides HTTP HEADERS (fireworks-prompt-tokens /
|
|
163
|
+
// -cached-prompt-tokens), NOT the usage JSON the openai-compat adapter reads —
|
|
164
|
+
// so cache tokens are NOT observable on our path today (header lift is a
|
|
165
|
+
// spec non-goal / flagged follow-up). docs.fireworks.ai, fetched 2026-08-18.
|
|
166
|
+
fireworks: {
|
|
167
|
+
cache_supported: true,
|
|
168
|
+
mode: "automatic_prefix",
|
|
169
|
+
default_ttl_seconds: null, // minutes-to-hours LRU, no exact
|
|
170
|
+
extended_ttl_seconds: null,
|
|
171
|
+
ttl_refresh_on_read: false,
|
|
172
|
+
min_cacheable_tokens: null,
|
|
173
|
+
cache_key_param: null,
|
|
174
|
+
reports_read_tokens: false, // header-based; not read by our usage-JSON path yet
|
|
175
|
+
reports_write_tokens: false,
|
|
176
|
+
usage_dialect: "fireworks_headers",
|
|
177
|
+
provider_affinity_required: true, // x-session-affinity
|
|
178
|
+
source: "docs.fireworks.ai prompt-caching (fetched 2026-08-18)",
|
|
179
|
+
as_of: AS_OF,
|
|
180
|
+
policy_version: AS_OF,
|
|
181
|
+
},
|
|
182
|
+
// DeepInfra — caching on SELECT models only (DeepSeek V3.x, Qwen3, some
|
|
183
|
+
// Claude), cached rates unverified first-party. Fail-closed to
|
|
184
|
+
// cache_supported:false, matching DeepInfra's existing pricing posture
|
|
185
|
+
// (pricing-sweep sweepDeepInfra: base-only, richer fields unverified, L5).
|
|
186
|
+
deepinfra: {
|
|
187
|
+
cache_supported: false,
|
|
188
|
+
mode: "automatic_prefix",
|
|
189
|
+
default_ttl_seconds: null,
|
|
190
|
+
extended_ttl_seconds: null,
|
|
191
|
+
ttl_refresh_on_read: false,
|
|
192
|
+
min_cacheable_tokens: null,
|
|
193
|
+
cache_key_param: null,
|
|
194
|
+
reports_read_tokens: false,
|
|
195
|
+
reports_write_tokens: false,
|
|
196
|
+
usage_dialect: "openai_details",
|
|
197
|
+
provider_affinity_required: false,
|
|
198
|
+
source: "deepinfra — cached rates unverified first-party (fail-closed, L5)",
|
|
199
|
+
as_of: AS_OF,
|
|
200
|
+
policy_version: AS_OF,
|
|
201
|
+
},
|
|
202
|
+
};
|
|
203
|
+
/** The fail-closed policy for any provider not seeded (spec §3): caching is
|
|
204
|
+
* assumed OFF until a first-party source says otherwise — identical posture to
|
|
205
|
+
* the zero-coverage gates. `usage_dialect` defaults to the OpenAI shape only as
|
|
206
|
+
* a type-satisfying placeholder; `cache_supported: false` means no consumer
|
|
207
|
+
* reads it. */
|
|
208
|
+
function failClosedCachePolicy() {
|
|
209
|
+
return {
|
|
210
|
+
cache_supported: false,
|
|
211
|
+
mode: "automatic_prefix",
|
|
212
|
+
default_ttl_seconds: null,
|
|
213
|
+
extended_ttl_seconds: null,
|
|
214
|
+
ttl_refresh_on_read: false,
|
|
215
|
+
min_cacheable_tokens: null,
|
|
216
|
+
cache_key_param: null,
|
|
217
|
+
reports_read_tokens: false,
|
|
218
|
+
reports_write_tokens: false,
|
|
219
|
+
usage_dialect: "openai_details",
|
|
220
|
+
provider_affinity_required: false,
|
|
221
|
+
source: "unseeded provider — fail-closed (no first-party cache policy)",
|
|
222
|
+
as_of: AS_OF,
|
|
223
|
+
policy_version: AS_OF,
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* The cache policy for a provider — the seeded first-party record, or a
|
|
228
|
+
* fail-closed `cache_supported: false` policy when the provider is not seeded
|
|
229
|
+
* (spec §3). Provider-level in v1; model-specific overrides land with the
|
|
230
|
+
* conversational-gateway phase.
|
|
231
|
+
*/
|
|
232
|
+
function getCachePolicy(provider) {
|
|
233
|
+
return POLICIES[provider] ?? failClosedCachePolicy();
|
|
234
|
+
}
|
|
235
|
+
/** Every seeded provider — for tests and the console policy surface (WS-D). */
|
|
236
|
+
function seededCachePolicyProviders() {
|
|
237
|
+
return Object.keys(POLICIES);
|
|
238
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-model call-shaping knowledge as data — addendum A1 (Phase 2), closed as
|
|
3
|
+
* post-C2 patch P1 (Phase 3 step 0). Seeded from the adapters' documented
|
|
4
|
+
* constraints (the same facts the adapter code enforces); consumed by the
|
|
5
|
+
* registry artifact today and the Phase 5 oracle's `get_call_notes` later.
|
|
6
|
+
* Registry entries carry these top-level as `callNotes[]`; the Supabase
|
|
7
|
+
* mirror rides them inside the existing `declared` jsonb (no migration).
|
|
8
|
+
*/
|
|
9
|
+
/** Call notes for a "provider/model" key; [] for unknown providers. */
|
|
10
|
+
export declare function callNotesFor(modelKey: string): readonly string[];
|
|
11
|
+
//# sourceMappingURL=call-notes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"call-notes.d.ts","sourceRoot":"","sources":["../../src/registry/call-notes.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAwCH,uEAAuE;AACvE,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAkEhE"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Per-model call-shaping knowledge as data — addendum A1 (Phase 2), closed as
|
|
4
|
+
* post-C2 patch P1 (Phase 3 step 0). Seeded from the adapters' documented
|
|
5
|
+
* constraints (the same facts the adapter code enforces); consumed by the
|
|
6
|
+
* registry artifact today and the Phase 5 oracle's `get_call_notes` later.
|
|
7
|
+
* Registry entries carry these top-level as `callNotes[]`; the Supabase
|
|
8
|
+
* mirror rides them inside the existing `declared` jsonb (no migration).
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.callNotesFor = callNotesFor;
|
|
12
|
+
/** Models that accept thinkingConfig — mirror of the gemini adapter's set. */
|
|
13
|
+
const GEMINI_THINKING_CAPABLE = new Set([
|
|
14
|
+
"gemini-3.1-pro-preview",
|
|
15
|
+
"gemini-3.0-pro-preview",
|
|
16
|
+
"gemini-3.1-flash-preview",
|
|
17
|
+
]);
|
|
18
|
+
/**
|
|
19
|
+
* Models whose published probe measurements predate the provider-default
|
|
20
|
+
* reasoning policy (architect ruling, 2026-08-10): probe cycles 001–002
|
|
21
|
+
* pinned thinkingConfig thinkingLevel "high" on this set, inflating output
|
|
22
|
+
* tokens (billed as output) and therefore the effective-cost figure. The only
|
|
23
|
+
* board model affected. Remove each entry once its cycle-003 re-measure
|
|
24
|
+
* (provider-default thinking) is published.
|
|
25
|
+
*/
|
|
26
|
+
const GEMINI_PROBED_AT_THINKING_HIGH = new Set(["gemini-3.1-pro-preview"]);
|
|
27
|
+
const GEMINI_COMMON = [
|
|
28
|
+
"temperature must be 1.0 — lower values cause output looping on Gemini 3 models",
|
|
29
|
+
"native strict structured output via responseJsonSchema; very complex schemas can be rejected as INVALID_ARGUMENT (complexity ceiling)",
|
|
30
|
+
"native web grounding via the googleSearch tool",
|
|
31
|
+
"cachedContent excludes systemInstruction and tools — bake the system prompt (and the googleSearch tool for grounded steps) into the cache at creation time",
|
|
32
|
+
];
|
|
33
|
+
const OPENAI_COMMON = [
|
|
34
|
+
"native strict structured output via response_format json_schema with strict: true",
|
|
35
|
+
"streamed refusal deltas are terminal for the call, even alongside partial content",
|
|
36
|
+
"prompt caching is keyed via prompt_cache_key; retention extends to 24h when the cache directive's TTL is ≥ 86400s",
|
|
37
|
+
"finish_reason=stop with <200 visible completion tokens on a 50K+ token prompt indicates flex-tier degradation or a stream drop — treat as invalid, not success",
|
|
38
|
+
];
|
|
39
|
+
const DEEPSEEK_COMMON = [
|
|
40
|
+
"no native json_schema — json_object forcing only; the schema must be coached into the prompt and validated caller-side",
|
|
41
|
+
'json_object mode returns 400 unless the literal word "JSON" appears in the prompt',
|
|
42
|
+
"automatic prefix caching: prompt_cache_hit_tokens are billed ~10x cheaper than fresh input",
|
|
43
|
+
"no service tiers — served tier is always standard",
|
|
44
|
+
];
|
|
45
|
+
/** Call notes for a "provider/model" key; [] for unknown providers. */
|
|
46
|
+
function callNotesFor(modelKey) {
|
|
47
|
+
const slash = modelKey.indexOf("/");
|
|
48
|
+
if (slash <= 0)
|
|
49
|
+
return [];
|
|
50
|
+
const provider = modelKey.slice(0, slash);
|
|
51
|
+
const model = modelKey.slice(slash + 1);
|
|
52
|
+
switch (provider) {
|
|
53
|
+
case "gemini":
|
|
54
|
+
return [
|
|
55
|
+
...GEMINI_COMMON,
|
|
56
|
+
GEMINI_THINKING_CAPABLE.has(model)
|
|
57
|
+
? "accepts thinkingConfig (thinking level); thinking tokens are billed as output and count against maxOutputTokens"
|
|
58
|
+
: "does NOT accept thinkingConfig — sending it returns 400 (thinking models only)",
|
|
59
|
+
...(GEMINI_PROBED_AT_THINKING_HIGH.has(model)
|
|
60
|
+
? [
|
|
61
|
+
"probe cycles 001-002 measured this model at thinking level high; probes run at provider-default thinking from cycle 003, and the published cost figure is re-measured then",
|
|
62
|
+
]
|
|
63
|
+
: []),
|
|
64
|
+
];
|
|
65
|
+
case "openai": {
|
|
66
|
+
// The Pro tier is Responses-API only (v1/chat/completions returns "not a
|
|
67
|
+
// chat model") — probed via the responses caller (coverage follow-ups
|
|
68
|
+
// 2026-08-11). Reasoning tokens bill as output at the Pro rate.
|
|
69
|
+
const responsesOnly = model.endsWith("-pro");
|
|
70
|
+
const flexEligible = !model.includes("-mini") &&
|
|
71
|
+
!model.includes("-nano") &&
|
|
72
|
+
!responsesOnly &&
|
|
73
|
+
["gpt-5.4", "gpt-5.2", "gpt-5.1", "gpt-5", "gpt-4.1"].some((p) => model.startsWith(p));
|
|
74
|
+
return [
|
|
75
|
+
...OPENAI_COMMON,
|
|
76
|
+
...(responsesOnly
|
|
77
|
+
? [
|
|
78
|
+
"Responses-API only — v1/chat/completions rejects it ('not a chat model'); probed via the v1/responses caller with strict json_schema output; reasoning tokens are billed as output at the Pro rate",
|
|
79
|
+
]
|
|
80
|
+
: []),
|
|
81
|
+
flexEligible
|
|
82
|
+
? "flex service tier eligible — discounted, sheddable capacity; served tier is echoed on the stream"
|
|
83
|
+
: "NOT flex-eligible (mini/nano, Pro, and older families) — flex requests are silently served at default tier",
|
|
84
|
+
];
|
|
85
|
+
}
|
|
86
|
+
case "deepseek": {
|
|
87
|
+
// Alias resolution (coverage follow-ups, verified 2026-08-11 against the
|
|
88
|
+
// live models list + a call to each): DeepSeek's model list now shows only
|
|
89
|
+
// deepseek-v4-flash / deepseek-v4-pro; the classic `deepseek-chat` and
|
|
90
|
+
// `deepseek-reasoner` are rolling ALIASES that both currently resolve to
|
|
91
|
+
// deepseek-v4-flash (the API echoes `model: "deepseek-v4-flash"`). They are
|
|
92
|
+
// alive, not retired — kept on the board with this note. reasoner is
|
|
93
|
+
// v4-flash in reasoning mode.
|
|
94
|
+
const aliasNote = model === "deepseek-chat"
|
|
95
|
+
? "rolling alias — currently serves deepseek-v4-flash (API echoes model=deepseek-v4-flash, verified 2026-08-11); alive despite being absent from the models list"
|
|
96
|
+
: model === "deepseek-reasoner"
|
|
97
|
+
? "rolling alias — currently serves deepseek-v4-flash in reasoning mode (API echoes model=deepseek-v4-flash, verified 2026-08-11); alive despite being absent from the models list"
|
|
98
|
+
: "listed as a current DeepSeek model (deepseek-v4-*), 2026-08-11";
|
|
99
|
+
return [
|
|
100
|
+
...DEEPSEEK_COMMON,
|
|
101
|
+
model.includes("reasoner")
|
|
102
|
+
? "emits reasoning_content (chain-of-thought) deltas — exclude them from the JSON buffer; only delta.content is the answer"
|
|
103
|
+
: "max_tokens up to 64K — full capacity for long structured reports",
|
|
104
|
+
aliasNote,
|
|
105
|
+
];
|
|
106
|
+
}
|
|
107
|
+
default:
|
|
108
|
+
return [];
|
|
109
|
+
}
|
|
110
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Curated credential-scoped claims — Phase 4 WS3 fact-shape upgrade.
|
|
3
|
+
* Every fact is {value, scope, source, as_of}: WHAT is claimed, UNDER WHICH
|
|
4
|
+
* CREDENTIAL it holds, WHERE it's cited, and WHEN it was checked.
|
|
5
|
+
*
|
|
6
|
+
* Scope semantics (the TrustedRouter lesson): a provider's zero-data-
|
|
7
|
+
* retention arrangement on OUR managed account does not transfer to a
|
|
8
|
+
* customer's own (BYOK) key — the same capability can be true on one
|
|
9
|
+
* credential and false on the other, and conflating them is a compliance
|
|
10
|
+
* hazard. Conservative default: models/facts absent here are absent from
|
|
11
|
+
* the registry — false-until-cited, same doctrine as probed-beats-declared.
|
|
12
|
+
*
|
|
13
|
+
* This is the curated seed (same pattern as call-notes.ts); probe-derived
|
|
14
|
+
* facts can join the same shape later without changing consumers.
|
|
15
|
+
*/
|
|
16
|
+
export declare const SCOPES: readonly ["managed", "byok", "any"];
|
|
17
|
+
export type FactScope = (typeof SCOPES)[number];
|
|
18
|
+
export interface ScopedFact {
|
|
19
|
+
readonly value: boolean | string | number;
|
|
20
|
+
/** Which credential the claim holds under: the vendor-managed account,
|
|
21
|
+
* a bring-your-own-key credential, or any. */
|
|
22
|
+
readonly scope: FactScope;
|
|
23
|
+
/** Citation — a URL or document reference; never "we assume". */
|
|
24
|
+
readonly source: string;
|
|
25
|
+
readonly as_of: string;
|
|
26
|
+
}
|
|
27
|
+
export type ModelFacts = Readonly<Record<string, readonly ScopedFact[]>>;
|
|
28
|
+
/** Facts for a model, or null when nothing is cited (the conservative
|
|
29
|
+
* default — absence is the claim). */
|
|
30
|
+
export declare function factsFor(modelKey: string): ModelFacts | null;
|
|
31
|
+
/** Which credential an account is calling a model under. Phase 6 WS3: the
|
|
32
|
+
* telemetry `key_ownership` dimension, seen from the registry's side. */
|
|
33
|
+
export type CredentialOwnership = "managed" | "byok";
|
|
34
|
+
/** A fact resolved to what holds under ONE credential. */
|
|
35
|
+
export interface CredentialScopedFact {
|
|
36
|
+
readonly value: boolean | string | number;
|
|
37
|
+
readonly source: string;
|
|
38
|
+
readonly as_of: string;
|
|
39
|
+
/**
|
|
40
|
+
* True when a fact is cited for THIS credential (its own scope or `any`).
|
|
41
|
+
* False means "not established for your key" — the honest answer when a
|
|
42
|
+
* fact holds only under our managed account and the account is BYOK. It is
|
|
43
|
+
* NEVER silently promoted to the managed value.
|
|
44
|
+
*/
|
|
45
|
+
readonly established: boolean;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Render a model's facts as they hold under ONE account's credential — Phase 6
|
|
49
|
+
* WS3, the "credential-scoped facts render per account" deliverable.
|
|
50
|
+
*
|
|
51
|
+
* THE RULE, and the whole reason this exists: **a BYOK key does not inherit our
|
|
52
|
+
* managed-account posture.** If `zero_retention` is cited `true` under
|
|
53
|
+
* `managed` and nothing is cited under `byok`, a BYOK account sees
|
|
54
|
+
* `established: false` — not `true`. Inheriting the managed value onto a
|
|
55
|
+
* customer's own key is the exact compliance hazard claims.ts's scope field
|
|
56
|
+
* exists to prevent (the TrustedRouter lesson). An `any`-scoped fact holds on
|
|
57
|
+
* every credential; a scope-specific fact holds only on its own.
|
|
58
|
+
*
|
|
59
|
+
* Returns one entry per fact NAME, so a caller (the console's model surface)
|
|
60
|
+
* can render "zero retention: yes / not established for your key" honestly.
|
|
61
|
+
*/
|
|
62
|
+
export declare function factsUnderCredential(modelKey: string, ownership: CredentialOwnership): Readonly<Record<string, CredentialScopedFact>>;
|
|
63
|
+
//# sourceMappingURL=claims.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claims.d.ts","sourceRoot":"","sources":["../../src/registry/claims.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,eAAO,MAAM,MAAM,qCAAsC,CAAC;AAC1D,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC;AAEhD,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;IAC1C;kDAC8C;IAC9C,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;IAC1B,iEAAiE;IACjE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,UAAU,EAAE,CAAC,CAAC,CAAC;AA0CzE;sCACsC;AACtC,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI,CAE5D;AAED;yEACyE;AACzE,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG,MAAM,CAAC;AAErD,0DAA0D;AAC1D,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;IAC1C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB;;;;;OAKG;IACH,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;CAC/B;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,mBAAmB,GAC7B,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC,CAwBhD"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Curated credential-scoped claims — Phase 4 WS3 fact-shape upgrade.
|
|
4
|
+
* Every fact is {value, scope, source, as_of}: WHAT is claimed, UNDER WHICH
|
|
5
|
+
* CREDENTIAL it holds, WHERE it's cited, and WHEN it was checked.
|
|
6
|
+
*
|
|
7
|
+
* Scope semantics (the TrustedRouter lesson): a provider's zero-data-
|
|
8
|
+
* retention arrangement on OUR managed account does not transfer to a
|
|
9
|
+
* customer's own (BYOK) key — the same capability can be true on one
|
|
10
|
+
* credential and false on the other, and conflating them is a compliance
|
|
11
|
+
* hazard. Conservative default: models/facts absent here are absent from
|
|
12
|
+
* the registry — false-until-cited, same doctrine as probed-beats-declared.
|
|
13
|
+
*
|
|
14
|
+
* This is the curated seed (same pattern as call-notes.ts); probe-derived
|
|
15
|
+
* facts can join the same shape later without changing consumers.
|
|
16
|
+
*/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.SCOPES = void 0;
|
|
19
|
+
exports.factsFor = factsFor;
|
|
20
|
+
exports.factsUnderCredential = factsUnderCredential;
|
|
21
|
+
exports.SCOPES = ["managed", "byok", "any"];
|
|
22
|
+
/** The curated claims table. Add entries WITH citations only. */
|
|
23
|
+
const CLAIMS = {
|
|
24
|
+
"openai/gpt-5.4-mini": {
|
|
25
|
+
zero_retention: [
|
|
26
|
+
{
|
|
27
|
+
// OpenAI's API-platform data controls: eligible orgs can be approved
|
|
28
|
+
// for zero data retention on the API — an ACCOUNT property, granted
|
|
29
|
+
// to our managed platform account.
|
|
30
|
+
value: true,
|
|
31
|
+
scope: "managed",
|
|
32
|
+
source: "https://platform.openai.com/docs/models/how-we-use-your-data",
|
|
33
|
+
as_of: "2026-08-02",
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
// The same claim does NOT transfer to a customer's own key: a BYOK
|
|
37
|
+
// org has whatever retention ITS account negotiated — unknowable
|
|
38
|
+
// from here, so the honest value is false (not "probably fine").
|
|
39
|
+
value: false,
|
|
40
|
+
scope: "byok",
|
|
41
|
+
source: "https://platform.openai.com/docs/models/how-we-use-your-data",
|
|
42
|
+
as_of: "2026-08-02",
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
},
|
|
46
|
+
"gemini/gemini-3.1-pro-preview": {
|
|
47
|
+
zero_retention: [
|
|
48
|
+
{
|
|
49
|
+
// Paid-tier Gemini API: prompts/outputs not used for training, but
|
|
50
|
+
// retained transiently for abuse monitoring — that is NOT zero
|
|
51
|
+
// retention, on any credential. Recorded false to keep the registry
|
|
52
|
+
// honest where marketing language blurs.
|
|
53
|
+
value: false,
|
|
54
|
+
scope: "any",
|
|
55
|
+
source: "https://ai.google.dev/gemini-api/terms",
|
|
56
|
+
as_of: "2026-08-02",
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
/** Facts for a model, or null when nothing is cited (the conservative
|
|
62
|
+
* default — absence is the claim). */
|
|
63
|
+
function factsFor(modelKey) {
|
|
64
|
+
return CLAIMS[modelKey] ?? null;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Render a model's facts as they hold under ONE account's credential — Phase 6
|
|
68
|
+
* WS3, the "credential-scoped facts render per account" deliverable.
|
|
69
|
+
*
|
|
70
|
+
* THE RULE, and the whole reason this exists: **a BYOK key does not inherit our
|
|
71
|
+
* managed-account posture.** If `zero_retention` is cited `true` under
|
|
72
|
+
* `managed` and nothing is cited under `byok`, a BYOK account sees
|
|
73
|
+
* `established: false` — not `true`. Inheriting the managed value onto a
|
|
74
|
+
* customer's own key is the exact compliance hazard claims.ts's scope field
|
|
75
|
+
* exists to prevent (the TrustedRouter lesson). An `any`-scoped fact holds on
|
|
76
|
+
* every credential; a scope-specific fact holds only on its own.
|
|
77
|
+
*
|
|
78
|
+
* Returns one entry per fact NAME, so a caller (the console's model surface)
|
|
79
|
+
* can render "zero retention: yes / not established for your key" honestly.
|
|
80
|
+
*/
|
|
81
|
+
function factsUnderCredential(modelKey, ownership) {
|
|
82
|
+
const facts = CLAIMS[modelKey];
|
|
83
|
+
if (facts === undefined)
|
|
84
|
+
return {};
|
|
85
|
+
const out = {};
|
|
86
|
+
for (const [name, claims] of Object.entries(facts)) {
|
|
87
|
+
// Prefer the credential-specific claim; fall back to an `any` claim; never
|
|
88
|
+
// borrow the OTHER credential's claim.
|
|
89
|
+
const specific = claims.find((c) => c.scope === ownership);
|
|
90
|
+
const anyScoped = claims.find((c) => c.scope === "any");
|
|
91
|
+
const chosen = specific ?? anyScoped;
|
|
92
|
+
if (chosen !== undefined) {
|
|
93
|
+
out[name] = {
|
|
94
|
+
value: chosen.value,
|
|
95
|
+
source: chosen.source,
|
|
96
|
+
as_of: chosen.as_of,
|
|
97
|
+
established: true,
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
// A managed-only fact seen from a BYOK account (or vice-versa): not
|
|
102
|
+
// inherited. The value is the conservative false, flagged not-established.
|
|
103
|
+
out[name] = { value: false, source: claims[0]?.source ?? "", as_of: claims[0]?.as_of ?? "", established: false };
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return out;
|
|
107
|
+
}
|