From 984b6a6d1c362ddbc1aa37831531fdb74c56a9ad Mon Sep 17 00:00:00 2001 From: audrzejq <31422031+audrzejq@users.noreply.github.com> Date: Tue, 3 Mar 2026 16:53:58 +0100 Subject: [PATCH] add models monitor and generate openrouter script --- .gitignore | 1 + bun.lock | 211 ++++++++++ models-monitor/chutes.ts | 32 ++ models-monitor/lib.ts | 239 ++++++++++++ models-monitor/openrouter.ts | 27 ++ package.json | 8 +- packages/core/script/generate-openrouter.ts | 410 ++++++++++++++++++++ 7 files changed, 927 insertions(+), 1 deletion(-) create mode 100644 models-monitor/chutes.ts create mode 100644 models-monitor/lib.ts create mode 100644 models-monitor/openrouter.ts create mode 100644 packages/core/script/generate-openrouter.ts diff --git a/.gitignore b/.gitignore index 540879036..08317a156 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ dist .DS_Store node_modules +.env.local diff --git a/bun.lock b/bun.lock index 6e2106226..4c9a28f53 100644 --- a/bun.lock +++ b/bun.lock @@ -4,6 +4,9 @@ "workspaces": { "": { "name": "models.dev", + "dependencies": { + "@aws-sdk/client-s3": "^3.1000.0", + }, }, "packages/core": { "name": "models.dev", @@ -37,8 +40,190 @@ "zod": "3.24.2", }, "packages": { + "@aws-crypto/crc32": ["@aws-crypto/crc32@5.2.0", "", { "dependencies": { "@aws-crypto/util": "^5.2.0", "@aws-sdk/types": "^3.222.0", "tslib": "^2.6.2" } }, "sha512-nLbCWqQNgUiwwtFsen1AdzAtvuLRsQS8rYgMuxCrdKf9kOssamGLuPwyTY9wyYblNr9+1XM8v6zoDTPPSIeANg=="], + + "@aws-crypto/crc32c": ["@aws-crypto/crc32c@5.2.0", "", { "dependencies": { "@aws-crypto/util": "^5.2.0", "@aws-sdk/types": "^3.222.0", "tslib": "^2.6.2" } }, "sha512-+iWb8qaHLYKrNvGRbiYRHSdKRWhto5XlZUEBwDjYNf+ly5SVYG6zEoYIdxvf5R3zyeP16w4PLBn3rH1xc74Rag=="], + + "@aws-crypto/sha1-browser": ["@aws-crypto/sha1-browser@5.2.0", "", { "dependencies": { "@aws-crypto/supports-web-crypto": "^5.2.0", "@aws-crypto/util": "^5.2.0", "@aws-sdk/types": "^3.222.0", "@aws-sdk/util-locate-window": "^3.0.0", "@smithy/util-utf8": "^2.0.0", "tslib": "^2.6.2" } }, "sha512-OH6lveCFfcDjX4dbAvCFSYUjJZjDr/3XJ3xHtjn3Oj5b9RjojQo8npoLeA/bNwkOkrSQ0wgrHzXk4tDRxGKJeg=="], + + "@aws-crypto/sha256-browser": ["@aws-crypto/sha256-browser@5.2.0", "", { "dependencies": { "@aws-crypto/sha256-js": "^5.2.0", "@aws-crypto/supports-web-crypto": "^5.2.0", "@aws-crypto/util": "^5.2.0", "@aws-sdk/types": "^3.222.0", "@aws-sdk/util-locate-window": "^3.0.0", "@smithy/util-utf8": "^2.0.0", "tslib": "^2.6.2" } }, "sha512-AXfN/lGotSQwu6HNcEsIASo7kWXZ5HYWvfOmSNKDsEqC4OashTp8alTmaz+F7TC2L083SFv5RdB+qU3Vs1kZqw=="], + + "@aws-crypto/sha256-js": ["@aws-crypto/sha256-js@5.2.0", "", { "dependencies": { "@aws-crypto/util": "^5.2.0", "@aws-sdk/types": "^3.222.0", "tslib": "^2.6.2" } }, "sha512-FFQQyu7edu4ufvIZ+OadFpHHOt+eSTBaYaki44c+akjg7qZg9oOQeLlk77F6tSYqjDAFClrHJk9tMf0HdVyOvA=="], + + "@aws-crypto/supports-web-crypto": ["@aws-crypto/supports-web-crypto@5.2.0", "", { "dependencies": { "tslib": "^2.6.2" } }, "sha512-iAvUotm021kM33eCdNfwIN//F77/IADDSs58i+MDaOqFrVjZo9bAal0NK7HurRuWLLpF1iLX7gbWrjHjeo+YFg=="], + + "@aws-crypto/util": ["@aws-crypto/util@5.2.0", "", { "dependencies": { "@aws-sdk/types": "^3.222.0", "@smithy/util-utf8": "^2.0.0", "tslib": "^2.6.2" } }, "sha512-4RkU9EsI6ZpBve5fseQlGNUWKMa1RLPQ1dnjnQoe07ldfIzcsGb5hC5W0Dm7u423KWzawlrpbjXBrXCEv9zazQ=="], + + "@aws-sdk/client-s3": ["@aws-sdk/client-s3@3.1000.0", "", { "dependencies": { "@aws-crypto/sha1-browser": "5.2.0", "@aws-crypto/sha256-browser": "5.2.0", "@aws-crypto/sha256-js": "5.2.0", "@aws-sdk/core": "^3.973.15", "@aws-sdk/credential-provider-node": "^3.972.14", "@aws-sdk/middleware-bucket-endpoint": "^3.972.6", "@aws-sdk/middleware-expect-continue": "^3.972.6", "@aws-sdk/middleware-flexible-checksums": "^3.973.1", "@aws-sdk/middleware-host-header": "^3.972.6", "@aws-sdk/middleware-location-constraint": "^3.972.6", "@aws-sdk/middleware-logger": "^3.972.6", "@aws-sdk/middleware-recursion-detection": "^3.972.6", "@aws-sdk/middleware-sdk-s3": "^3.972.15", "@aws-sdk/middleware-ssec": "^3.972.6", "@aws-sdk/middleware-user-agent": "^3.972.15", "@aws-sdk/region-config-resolver": "^3.972.6", "@aws-sdk/signature-v4-multi-region": "^3.996.3", "@aws-sdk/types": "^3.973.4", "@aws-sdk/util-endpoints": "^3.996.3", "@aws-sdk/util-user-agent-browser": "^3.972.6", "@aws-sdk/util-user-agent-node": "^3.973.0", "@smithy/config-resolver": "^4.4.9", "@smithy/core": "^3.23.6", "@smithy/eventstream-serde-browser": "^4.2.10", "@smithy/eventstream-serde-config-resolver": "^4.3.10", "@smithy/eventstream-serde-node": "^4.2.10", "@smithy/fetch-http-handler": "^5.3.11", "@smithy/hash-blob-browser": "^4.2.11", "@smithy/hash-node": "^4.2.10", "@smithy/hash-stream-node": "^4.2.10", "@smithy/invalid-dependency": "^4.2.10", "@smithy/md5-js": "^4.2.10", "@smithy/middleware-content-length": "^4.2.10", "@smithy/middleware-endpoint": "^4.4.20", "@smithy/middleware-retry": "^4.4.37", "@smithy/middleware-serde": "^4.2.11", "@smithy/middleware-stack": "^4.2.10", "@smithy/node-config-provider": "^4.3.10", "@smithy/node-http-handler": "^4.4.12", "@smithy/protocol-http": "^5.3.10", "@smithy/smithy-client": "^4.12.0", "@smithy/types": "^4.13.0", "@smithy/url-parser": "^4.2.10", "@smithy/util-base64": "^4.3.1", "@smithy/util-body-length-browser": "^4.2.1", "@smithy/util-body-length-node": "^4.2.2", "@smithy/util-defaults-mode-browser": "^4.3.36", "@smithy/util-defaults-mode-node": "^4.2.39", "@smithy/util-endpoints": "^3.3.1", "@smithy/util-middleware": "^4.2.10", "@smithy/util-retry": "^4.2.10", "@smithy/util-stream": "^4.5.15", "@smithy/util-utf8": "^4.2.1", "@smithy/util-waiter": "^4.2.10", "tslib": "^2.6.2" } }, "sha512-7kPy33qNGq3NfwHC0412T6LDK1bp4+eiPzetX0sVd9cpTSXuQDKpoOFnB0Njj6uZjJDcLS3n2OeyarwwgkQ0Ow=="], + + "@aws-sdk/core": ["@aws-sdk/core@3.973.15", "", { "dependencies": { "@aws-sdk/types": "^3.973.4", "@aws-sdk/xml-builder": "^3.972.8", "@smithy/core": "^3.23.6", "@smithy/node-config-provider": "^4.3.10", "@smithy/property-provider": "^4.2.10", "@smithy/protocol-http": "^5.3.10", "@smithy/signature-v4": "^5.3.10", "@smithy/smithy-client": "^4.12.0", "@smithy/types": "^4.13.0", "@smithy/util-base64": "^4.3.1", "@smithy/util-middleware": "^4.2.10", "@smithy/util-utf8": "^4.2.1", "tslib": "^2.6.2" } }, "sha512-AlC0oQ1/mdJ8vCIqu524j5RB7M8i8E24bbkZmya1CuiQxkY7SdIZAyw7NDNMGaNINQFq/8oGRMX0HeOfCVsl/A=="], + + "@aws-sdk/crc64-nvme": ["@aws-sdk/crc64-nvme@3.972.3", "", { "dependencies": { "@smithy/types": "^4.13.0", "tslib": "^2.6.2" } }, "sha512-UExeK+EFiq5LAcbHm96CQLSia+5pvpUVSAsVApscBzayb7/6dJBJKwV4/onsk4VbWSmqxDMcfuTD+pC4RxgZHg=="], + + "@aws-sdk/credential-provider-env": ["@aws-sdk/credential-provider-env@3.972.13", "", { "dependencies": { "@aws-sdk/core": "^3.973.15", "@aws-sdk/types": "^3.973.4", "@smithy/property-provider": "^4.2.10", "@smithy/types": "^4.13.0", "tslib": "^2.6.2" } }, "sha512-6ljXKIQ22WFKyIs1jbORIkGanySBHaPPTOI4OxACP5WXgbcR0nDYfqNJfXEGwCK7IzHdNbCSFsNKKs0qCexR8Q=="], + + "@aws-sdk/credential-provider-http": ["@aws-sdk/credential-provider-http@3.972.15", "", { "dependencies": { "@aws-sdk/core": "^3.973.15", "@aws-sdk/types": "^3.973.4", "@smithy/fetch-http-handler": "^5.3.11", "@smithy/node-http-handler": "^4.4.12", "@smithy/property-provider": "^4.2.10", "@smithy/protocol-http": "^5.3.10", "@smithy/smithy-client": "^4.12.0", "@smithy/types": "^4.13.0", "@smithy/util-stream": "^4.5.15", "tslib": "^2.6.2" } }, "sha512-dJuSTreu/T8f24SHDNTjd7eQ4rabr0TzPh2UTCwYexQtzG3nTDKm1e5eIdhiroTMDkPEJeY+WPkA6F9wod/20A=="], + + "@aws-sdk/credential-provider-ini": ["@aws-sdk/credential-provider-ini@3.972.13", "", { "dependencies": { "@aws-sdk/core": "^3.973.15", "@aws-sdk/credential-provider-env": "^3.972.13", "@aws-sdk/credential-provider-http": "^3.972.15", "@aws-sdk/credential-provider-login": "^3.972.13", "@aws-sdk/credential-provider-process": "^3.972.13", "@aws-sdk/credential-provider-sso": "^3.972.13", "@aws-sdk/credential-provider-web-identity": "^3.972.13", "@aws-sdk/nested-clients": "^3.996.3", "@aws-sdk/types": "^3.973.4", "@smithy/credential-provider-imds": "^4.2.10", "@smithy/property-provider": "^4.2.10", "@smithy/shared-ini-file-loader": "^4.4.5", "@smithy/types": "^4.13.0", "tslib": "^2.6.2" } }, "sha512-JKSoGb7XeabZLBJptpqoZIFbROUIS65NuQnEHGOpuT9GuuZwag2qciKANiDLFiYk4u8nSrJC9JIOnWKVvPVjeA=="], + + "@aws-sdk/credential-provider-login": ["@aws-sdk/credential-provider-login@3.972.13", "", { "dependencies": { "@aws-sdk/core": "^3.973.15", "@aws-sdk/nested-clients": "^3.996.3", "@aws-sdk/types": "^3.973.4", "@smithy/property-provider": "^4.2.10", "@smithy/protocol-http": "^5.3.10", "@smithy/shared-ini-file-loader": "^4.4.5", "@smithy/types": "^4.13.0", "tslib": "^2.6.2" } }, "sha512-RtYcrxdnJHKY8MFQGLltCURcjuMjnaQpAxPE6+/QEdDHHItMKZgabRe/KScX737F9vJMQsmJy9EmMOkCnoC1JQ=="], + + "@aws-sdk/credential-provider-node": ["@aws-sdk/credential-provider-node@3.972.14", "", { "dependencies": { "@aws-sdk/credential-provider-env": "^3.972.13", "@aws-sdk/credential-provider-http": "^3.972.15", "@aws-sdk/credential-provider-ini": "^3.972.13", "@aws-sdk/credential-provider-process": "^3.972.13", "@aws-sdk/credential-provider-sso": "^3.972.13", "@aws-sdk/credential-provider-web-identity": "^3.972.13", "@aws-sdk/types": "^3.973.4", "@smithy/credential-provider-imds": "^4.2.10", "@smithy/property-provider": "^4.2.10", "@smithy/shared-ini-file-loader": "^4.4.5", "@smithy/types": "^4.13.0", "tslib": "^2.6.2" } }, "sha512-WqoC2aliIjQM/L3oFf6j+op/enT2i9Cc4UTxxMEKrJNECkq4/PlKE5BOjSYFcq6G9mz65EFbXJh7zOU4CvjSKQ=="], + + "@aws-sdk/credential-provider-process": ["@aws-sdk/credential-provider-process@3.972.13", "", { "dependencies": { "@aws-sdk/core": "^3.973.15", "@aws-sdk/types": "^3.973.4", "@smithy/property-provider": "^4.2.10", "@smithy/shared-ini-file-loader": "^4.4.5", "@smithy/types": "^4.13.0", "tslib": "^2.6.2" } }, "sha512-rsRG0LQA4VR+jnDyuqtXi2CePYSmfm5GNL9KxiW8DSe25YwJSr06W8TdUfONAC+rjsTI+aIH2rBGG5FjMeANrw=="], + + "@aws-sdk/credential-provider-sso": ["@aws-sdk/credential-provider-sso@3.972.13", "", { "dependencies": { "@aws-sdk/core": "^3.973.15", "@aws-sdk/nested-clients": "^3.996.3", "@aws-sdk/token-providers": "3.999.0", "@aws-sdk/types": "^3.973.4", "@smithy/property-provider": "^4.2.10", "@smithy/shared-ini-file-loader": "^4.4.5", "@smithy/types": "^4.13.0", "tslib": "^2.6.2" } }, "sha512-fr0UU1wx8kNHDhTQBXioc/YviSW8iXuAxHvnH7eQUtn8F8o/FU3uu6EUMvAQgyvn7Ne5QFnC0Cj0BFlwCk+RFw=="], + + "@aws-sdk/credential-provider-web-identity": ["@aws-sdk/credential-provider-web-identity@3.972.13", "", { "dependencies": { "@aws-sdk/core": "^3.973.15", "@aws-sdk/nested-clients": "^3.996.3", "@aws-sdk/types": "^3.973.4", "@smithy/property-provider": "^4.2.10", "@smithy/shared-ini-file-loader": "^4.4.5", "@smithy/types": "^4.13.0", "tslib": "^2.6.2" } }, "sha512-a6iFMh1pgUH0TdcouBppLJUfPM7Yd3R9S1xFodPtCRoLqCz2RQFA3qjA8x4112PVYXEd4/pHX2eihapq39w0rA=="], + + "@aws-sdk/middleware-bucket-endpoint": ["@aws-sdk/middleware-bucket-endpoint@3.972.6", "", { "dependencies": { "@aws-sdk/types": "^3.973.4", "@aws-sdk/util-arn-parser": "^3.972.2", "@smithy/node-config-provider": "^4.3.10", "@smithy/protocol-http": "^5.3.10", "@smithy/types": "^4.13.0", "@smithy/util-config-provider": "^4.2.1", "tslib": "^2.6.2" } }, "sha512-3H2bhvb7Cb/S6WFsBy/Dy9q2aegC9JmGH1inO8Lb2sWirSqpLJlZmvQHPE29h2tIxzv6el/14X/tLCQ8BQU6ZQ=="], + + "@aws-sdk/middleware-expect-continue": ["@aws-sdk/middleware-expect-continue@3.972.6", "", { "dependencies": { "@aws-sdk/types": "^3.973.4", "@smithy/protocol-http": "^5.3.10", "@smithy/types": "^4.13.0", "tslib": "^2.6.2" } }, "sha512-QMdffpU+GkSGC+bz6WdqlclqIeCsOfgX8JFZ5xvwDtX+UTj4mIXm3uXu7Ko6dBseRcJz1FA6T9OmlAAY6JgJUg=="], + + "@aws-sdk/middleware-flexible-checksums": ["@aws-sdk/middleware-flexible-checksums@3.973.1", "", { "dependencies": { "@aws-crypto/crc32": "5.2.0", "@aws-crypto/crc32c": "5.2.0", "@aws-crypto/util": "5.2.0", "@aws-sdk/core": "^3.973.15", "@aws-sdk/crc64-nvme": "^3.972.3", "@aws-sdk/types": "^3.973.4", "@smithy/is-array-buffer": "^4.2.1", "@smithy/node-config-provider": "^4.3.10", "@smithy/protocol-http": "^5.3.10", "@smithy/types": "^4.13.0", "@smithy/util-middleware": "^4.2.10", "@smithy/util-stream": "^4.5.15", "@smithy/util-utf8": "^4.2.1", "tslib": "^2.6.2" } }, "sha512-QLXsxsI6VW8LuGK+/yx699wzqP/NMCGk/hSGP+qtB+Lcff+23UlbahyouLlk+nfT7Iu021SkXBhnAuVd6IZcPw=="], + + "@aws-sdk/middleware-host-header": ["@aws-sdk/middleware-host-header@3.972.6", "", { "dependencies": { "@aws-sdk/types": "^3.973.4", "@smithy/protocol-http": "^5.3.10", "@smithy/types": "^4.13.0", "tslib": "^2.6.2" } }, "sha512-5XHwjPH1lHB+1q4bfC7T8Z5zZrZXfaLcjSMwTd1HPSPrCmPFMbg3UQ5vgNWcVj0xoX4HWqTGkSf2byrjlnRg5w=="], + + "@aws-sdk/middleware-location-constraint": ["@aws-sdk/middleware-location-constraint@3.972.6", "", { "dependencies": { "@aws-sdk/types": "^3.973.4", "@smithy/types": "^4.13.0", "tslib": "^2.6.2" } }, "sha512-XdZ2TLwyj3Am6kvUc67vquQvs6+D8npXvXgyEUJAdkUDx5oMFJKOqpK+UpJhVDsEL068WAJl2NEGzbSik7dGJQ=="], + + "@aws-sdk/middleware-logger": ["@aws-sdk/middleware-logger@3.972.6", "", { "dependencies": { "@aws-sdk/types": "^3.973.4", "@smithy/types": "^4.13.0", "tslib": "^2.6.2" } }, "sha512-iFnaMFMQdljAPrvsCVKYltPt2j40LQqukAbXvW7v0aL5I+1GO7bZ/W8m12WxW3gwyK5p5u1WlHg8TSAizC5cZw=="], + + "@aws-sdk/middleware-recursion-detection": ["@aws-sdk/middleware-recursion-detection@3.972.6", "", { "dependencies": { "@aws-sdk/types": "^3.973.4", "@aws/lambda-invoke-store": "^0.2.2", "@smithy/protocol-http": "^5.3.10", "@smithy/types": "^4.13.0", "tslib": "^2.6.2" } }, "sha512-dY4v3of5EEMvik6+UDwQ96KfUFDk8m1oZDdkSc5lwi4o7rFrjnv0A+yTV+gu230iybQZnKgDLg/rt2P3H+Vscw=="], + + "@aws-sdk/middleware-sdk-s3": ["@aws-sdk/middleware-sdk-s3@3.972.15", "", { "dependencies": { "@aws-sdk/core": "^3.973.15", "@aws-sdk/types": "^3.973.4", "@aws-sdk/util-arn-parser": "^3.972.2", "@smithy/core": "^3.23.6", "@smithy/node-config-provider": "^4.3.10", "@smithy/protocol-http": "^5.3.10", "@smithy/signature-v4": "^5.3.10", "@smithy/smithy-client": "^4.12.0", "@smithy/types": "^4.13.0", "@smithy/util-config-provider": "^4.2.1", "@smithy/util-middleware": "^4.2.10", "@smithy/util-stream": "^4.5.15", "@smithy/util-utf8": "^4.2.1", "tslib": "^2.6.2" } }, "sha512-WDLgssevOU5BFx1s8jA7jj6cE5HuImz28sy9jKOaVtz0AW1lYqSzotzdyiybFaBcQTs5zxXOb2pUfyMxgEKY3Q=="], + + "@aws-sdk/middleware-ssec": ["@aws-sdk/middleware-ssec@3.972.6", "", { "dependencies": { "@aws-sdk/types": "^3.973.4", "@smithy/types": "^4.13.0", "tslib": "^2.6.2" } }, "sha512-acvMUX9jF4I2Ew+Z/EA6gfaFaz9ehci5wxBmXCZeulLuv8m+iGf6pY9uKz8TPjg39bdAz3hxoE0eLP8Qz+IYlA=="], + + "@aws-sdk/middleware-user-agent": ["@aws-sdk/middleware-user-agent@3.972.15", "", { "dependencies": { "@aws-sdk/core": "^3.973.15", "@aws-sdk/types": "^3.973.4", "@aws-sdk/util-endpoints": "^3.996.3", "@smithy/core": "^3.23.6", "@smithy/protocol-http": "^5.3.10", "@smithy/types": "^4.13.0", "tslib": "^2.6.2" } }, "sha512-ABlFVcIMmuRAwBT+8q5abAxOr7WmaINirDJBnqGY5b5jSDo00UMlg/G4a0xoAgwm6oAECeJcwkvDlxDwKf58fQ=="], + + "@aws-sdk/nested-clients": ["@aws-sdk/nested-clients@3.996.3", "", { "dependencies": { "@aws-crypto/sha256-browser": "5.2.0", "@aws-crypto/sha256-js": "5.2.0", "@aws-sdk/core": "^3.973.15", "@aws-sdk/middleware-host-header": "^3.972.6", "@aws-sdk/middleware-logger": "^3.972.6", "@aws-sdk/middleware-recursion-detection": "^3.972.6", "@aws-sdk/middleware-user-agent": "^3.972.15", "@aws-sdk/region-config-resolver": "^3.972.6", "@aws-sdk/types": "^3.973.4", "@aws-sdk/util-endpoints": "^3.996.3", "@aws-sdk/util-user-agent-browser": "^3.972.6", "@aws-sdk/util-user-agent-node": "^3.973.0", "@smithy/config-resolver": "^4.4.9", "@smithy/core": "^3.23.6", "@smithy/fetch-http-handler": "^5.3.11", "@smithy/hash-node": "^4.2.10", "@smithy/invalid-dependency": "^4.2.10", "@smithy/middleware-content-length": "^4.2.10", "@smithy/middleware-endpoint": "^4.4.20", "@smithy/middleware-retry": "^4.4.37", "@smithy/middleware-serde": "^4.2.11", "@smithy/middleware-stack": "^4.2.10", "@smithy/node-config-provider": "^4.3.10", "@smithy/node-http-handler": "^4.4.12", "@smithy/protocol-http": "^5.3.10", "@smithy/smithy-client": "^4.12.0", "@smithy/types": "^4.13.0", "@smithy/url-parser": "^4.2.10", "@smithy/util-base64": "^4.3.1", "@smithy/util-body-length-browser": "^4.2.1", "@smithy/util-body-length-node": "^4.2.2", "@smithy/util-defaults-mode-browser": "^4.3.36", "@smithy/util-defaults-mode-node": "^4.2.39", "@smithy/util-endpoints": "^3.3.1", "@smithy/util-middleware": "^4.2.10", "@smithy/util-retry": "^4.2.10", "@smithy/util-utf8": "^4.2.1", "tslib": "^2.6.2" } }, "sha512-AU5TY1V29xqwg/MxmA2odwysTez+ccFAhmfRJk+QZT5HNv90UTA9qKd1J9THlsQkvmH7HWTEV1lDNxkQO5PzNw=="], + + "@aws-sdk/region-config-resolver": ["@aws-sdk/region-config-resolver@3.972.6", "", { "dependencies": { "@aws-sdk/types": "^3.973.4", "@smithy/config-resolver": "^4.4.9", "@smithy/node-config-provider": "^4.3.10", "@smithy/types": "^4.13.0", "tslib": "^2.6.2" } }, "sha512-Aa5PusHLXAqLTX1UKDvI3pHQJtIsF7Q+3turCHqfz/1F61/zDMWfbTC8evjhrrYVAtz9Vsv3SJ/waSUeu7B6gw=="], + + "@aws-sdk/signature-v4-multi-region": ["@aws-sdk/signature-v4-multi-region@3.996.3", "", { "dependencies": { "@aws-sdk/middleware-sdk-s3": "^3.972.15", "@aws-sdk/types": "^3.973.4", "@smithy/protocol-http": "^5.3.10", "@smithy/signature-v4": "^5.3.10", "@smithy/types": "^4.13.0", "tslib": "^2.6.2" } }, "sha512-gQYI/Buwp0CAGQxY7mR5VzkP56rkWq2Y1ROkFuXh5XY94DsSjJw62B3I0N0lysQmtwiL2ht2KHI9NylM/RP4FA=="], + + "@aws-sdk/token-providers": ["@aws-sdk/token-providers@3.999.0", "", { "dependencies": { "@aws-sdk/core": "^3.973.15", "@aws-sdk/nested-clients": "^3.996.3", "@aws-sdk/types": "^3.973.4", "@smithy/property-provider": "^4.2.10", "@smithy/shared-ini-file-loader": "^4.4.5", "@smithy/types": "^4.13.0", "tslib": "^2.6.2" } }, "sha512-cx0hHUlgXULfykx4rdu/ciNAJaa3AL5xz3rieCz7NKJ68MJwlj3664Y8WR5MGgxfyYJBdamnkjNSx5Kekuc0cg=="], + + "@aws-sdk/types": ["@aws-sdk/types@3.973.4", "", { "dependencies": { "@smithy/types": "^4.13.0", "tslib": "^2.6.2" } }, "sha512-RW60aH26Bsc016Y9B98hC0Plx6fK5P2v/iQYwMzrSjiDh1qRMUCP6KrXHYEHe3uFvKiOC93Z9zk4BJsUi6Tj1Q=="], + + "@aws-sdk/util-arn-parser": ["@aws-sdk/util-arn-parser@3.972.2", "", { "dependencies": { "tslib": "^2.6.2" } }, "sha512-VkykWbqMjlSgBFDyrY3nOSqupMc6ivXuGmvci6Q3NnLq5kC+mKQe2QBZ4nrWRE/jqOxeFP2uYzLtwncYYcvQDg=="], + + "@aws-sdk/util-endpoints": ["@aws-sdk/util-endpoints@3.996.3", "", { "dependencies": { "@aws-sdk/types": "^3.973.4", "@smithy/types": "^4.13.0", "@smithy/url-parser": "^4.2.10", "@smithy/util-endpoints": "^3.3.1", "tslib": "^2.6.2" } }, "sha512-yWIQSNiCjykLL+ezN5A+DfBb1gfXTytBxm57e64lYmwxDHNmInYHRJYYRAGWG1o77vKEiWaw4ui28e3yb1k5aQ=="], + + "@aws-sdk/util-locate-window": ["@aws-sdk/util-locate-window@3.965.4", "", { "dependencies": { "tslib": "^2.6.2" } }, "sha512-H1onv5SkgPBK2P6JR2MjGgbOnttoNzSPIRoeZTNPZYyaplwGg50zS3amXvXqF0/qfXpWEC9rLWU564QTB9bSog=="], + + "@aws-sdk/util-user-agent-browser": ["@aws-sdk/util-user-agent-browser@3.972.6", "", { "dependencies": { "@aws-sdk/types": "^3.973.4", "@smithy/types": "^4.13.0", "bowser": "^2.11.0", "tslib": "^2.6.2" } }, "sha512-Fwr/llD6GOrFgQnKaI2glhohdGuBDfHfora6iG9qsBBBR8xv1SdCSwbtf5CWlUdCw5X7g76G/9Hf0Inh0EmoxA=="], + + "@aws-sdk/util-user-agent-node": ["@aws-sdk/util-user-agent-node@3.973.0", "", { "dependencies": { "@aws-sdk/middleware-user-agent": "^3.972.15", "@aws-sdk/types": "^3.973.4", "@smithy/node-config-provider": "^4.3.10", "@smithy/types": "^4.13.0", "tslib": "^2.6.2" }, "peerDependencies": { "aws-crt": ">=1.0.0" }, "optionalPeers": ["aws-crt"] }, "sha512-A9J2G4Nf236e9GpaC1JnA8wRn6u6GjnOXiTwBLA6NUJhlBTIGfrTy+K1IazmF8y+4OFdW3O5TZlhyspJMqiqjA=="], + + "@aws-sdk/xml-builder": ["@aws-sdk/xml-builder@3.972.8", "", { "dependencies": { "@smithy/types": "^4.13.0", "fast-xml-parser": "5.3.6", "tslib": "^2.6.2" } }, "sha512-Ql8elcUdYCha83Ol7NznBsgN5GVZnv3vUd86fEc6waU6oUdY0T1O9NODkEEOS/Uaogr87avDrUC6DSeM4oXjZg=="], + + "@aws/lambda-invoke-store": ["@aws/lambda-invoke-store@0.2.3", "", {}, "sha512-oLvsaPMTBejkkmHhjf09xTgk71mOqyr/409NKhRIL08If7AhVfUsJhVsx386uJaqNd42v9kWamQ9lFbkoC2dYw=="], + "@models.dev/web": ["@models.dev/web@workspace:packages/web"], + "@smithy/abort-controller": ["@smithy/abort-controller@4.2.10", "", { "dependencies": { "@smithy/types": "^4.13.0", "tslib": "^2.6.2" } }, "sha512-qocxM/X4XGATqQtUkbE9SPUB6wekBi+FyJOMbPj0AhvyvFGYEmOlz6VB22iMePCQsFmMIvFSeViDvA7mZJG47g=="], + + "@smithy/chunked-blob-reader": ["@smithy/chunked-blob-reader@5.2.1", "", { "dependencies": { "tslib": "^2.6.2" } }, "sha512-y5d4xRiD6TzeP5BWlb+Ig/VFqF+t9oANNhGeMqyzU7obw7FYgTgVi50i5JqBTeKp+TABeDIeeXFZdz65RipNtA=="], + + "@smithy/chunked-blob-reader-native": ["@smithy/chunked-blob-reader-native@4.2.2", "", { "dependencies": { "@smithy/util-base64": "^4.3.1", "tslib": "^2.6.2" } }, "sha512-QzzYIlf4yg0w5TQaC9VId3B3ugSk1MI/wb7tgcHtd7CBV9gNRKZrhc2EPSxSZuDy10zUZ0lomNMgkc6/VVe8xg=="], + + "@smithy/config-resolver": ["@smithy/config-resolver@4.4.9", "", { "dependencies": { "@smithy/node-config-provider": "^4.3.10", "@smithy/types": "^4.13.0", "@smithy/util-config-provider": "^4.2.1", "@smithy/util-endpoints": "^3.3.1", "@smithy/util-middleware": "^4.2.10", "tslib": "^2.6.2" } }, "sha512-ejQvXqlcU30h7liR9fXtj7PIAau1t/sFbJpgWPfiYDs7zd16jpH0IsSXKcba2jF6ChTXvIjACs27kNMc5xxE2Q=="], + + "@smithy/core": ["@smithy/core@3.23.6", "", { "dependencies": { "@smithy/middleware-serde": "^4.2.11", "@smithy/protocol-http": "^5.3.10", "@smithy/types": "^4.13.0", "@smithy/util-base64": "^4.3.1", "@smithy/util-body-length-browser": "^4.2.1", "@smithy/util-middleware": "^4.2.10", "@smithy/util-stream": "^4.5.15", "@smithy/util-utf8": "^4.2.1", "@smithy/uuid": "^1.1.1", "tslib": "^2.6.2" } }, "sha512-4xE+0L2NrsFKpEVFlFELkIHQddBvMbQ41LRIP74dGCXnY1zQ9DgksrBcRBDJT+iOzGy4VEJIeU3hkUK5mn06kg=="], + + "@smithy/credential-provider-imds": ["@smithy/credential-provider-imds@4.2.10", "", { "dependencies": { "@smithy/node-config-provider": "^4.3.10", "@smithy/property-provider": "^4.2.10", "@smithy/types": "^4.13.0", "@smithy/url-parser": "^4.2.10", "tslib": "^2.6.2" } }, "sha512-3bsMLJJLTZGZqVGGeBVFfLzuRulVsGTj12BzRKODTHqUABpIr0jMN1vN3+u6r2OfyhAQ2pXaMZWX/swBK5I6PQ=="], + + "@smithy/eventstream-codec": ["@smithy/eventstream-codec@4.2.10", "", { "dependencies": { "@aws-crypto/crc32": "5.2.0", "@smithy/types": "^4.13.0", "@smithy/util-hex-encoding": "^4.2.1", "tslib": "^2.6.2" } }, "sha512-A4ynrsFFfSXUHicfTcRehytppFBcY3HQxEGYiyGktPIOye3Ot7fxpiy4VR42WmtGI4Wfo6OXt/c1Ky1nUFxYYQ=="], + + "@smithy/eventstream-serde-browser": ["@smithy/eventstream-serde-browser@4.2.10", "", { "dependencies": { "@smithy/eventstream-serde-universal": "^4.2.10", "@smithy/types": "^4.13.0", "tslib": "^2.6.2" } }, "sha512-0xupsu9yj9oDVuQ50YCTS9nuSYhGlrwqdaKQel9y2Fz7LU9fNErVlw9N0o4pm4qqvWEGbSTI4HKc6XJfB30MVw=="], + + "@smithy/eventstream-serde-config-resolver": ["@smithy/eventstream-serde-config-resolver@4.3.10", "", { "dependencies": { "@smithy/types": "^4.13.0", "tslib": "^2.6.2" } }, "sha512-8kn6sinrduk0yaYHMJDsNuiFpXwQwibR7n/4CDUqn4UgaG+SeBHu5jHGFdU9BLFAM7Q4/gvr9RYxBHz9/jKrhA=="], + + "@smithy/eventstream-serde-node": ["@smithy/eventstream-serde-node@4.2.10", "", { "dependencies": { "@smithy/eventstream-serde-universal": "^4.2.10", "@smithy/types": "^4.13.0", "tslib": "^2.6.2" } }, "sha512-uUrxPGgIffnYfvIOUmBM5i+USdEBRTdh7mLPttjphgtooxQ8CtdO1p6K5+Q4BBAZvKlvtJ9jWyrWpBJYzBKsyQ=="], + + "@smithy/eventstream-serde-universal": ["@smithy/eventstream-serde-universal@4.2.10", "", { "dependencies": { "@smithy/eventstream-codec": "^4.2.10", "@smithy/types": "^4.13.0", "tslib": "^2.6.2" } }, "sha512-aArqzOEvcs2dK+xQVCgLbpJQGfZihw8SD4ymhkwNTtwKbnrzdhJsFDKuMQnam2kF69WzgJYOU5eJlCx+CA32bw=="], + + "@smithy/fetch-http-handler": ["@smithy/fetch-http-handler@5.3.11", "", { "dependencies": { "@smithy/protocol-http": "^5.3.10", "@smithy/querystring-builder": "^4.2.10", "@smithy/types": "^4.13.0", "@smithy/util-base64": "^4.3.1", "tslib": "^2.6.2" } }, "sha512-wbTRjOxdFuyEg0CpumjZO0hkUl+fetJFqxNROepuLIoijQh51aMBmzFLfoQdwRjxsuuS2jizzIUTjPWgd8pd7g=="], + + "@smithy/hash-blob-browser": ["@smithy/hash-blob-browser@4.2.11", "", { "dependencies": { "@smithy/chunked-blob-reader": "^5.2.1", "@smithy/chunked-blob-reader-native": "^4.2.2", "@smithy/types": "^4.13.0", "tslib": "^2.6.2" } }, "sha512-DrcAx3PM6AEbWZxsKl6CWAGnVwiz28Wp1ZhNu+Hi4uI/6C1PIZBIaPM2VoqBDAsOWbM6ZVzOEQMxFLLdmb4eBQ=="], + + "@smithy/hash-node": ["@smithy/hash-node@4.2.10", "", { "dependencies": { "@smithy/types": "^4.13.0", "@smithy/util-buffer-from": "^4.2.1", "@smithy/util-utf8": "^4.2.1", "tslib": "^2.6.2" } }, "sha512-1VzIOI5CcsvMDvP3iv1vG/RfLJVVVc67dCRyLSB2Hn9SWCZrDO3zvcIzj3BfEtqRW5kcMg5KAeVf1K3dR6nD3w=="], + + "@smithy/hash-stream-node": ["@smithy/hash-stream-node@4.2.10", "", { "dependencies": { "@smithy/types": "^4.13.0", "@smithy/util-utf8": "^4.2.1", "tslib": "^2.6.2" } }, "sha512-w78xsYrOlwXKwN5tv1GnKIRbHb1HygSpeZMP6xDxCPGf1U/xDHjCpJu64c5T35UKyEPwa0bPeIcvU69VY3khUA=="], + + "@smithy/invalid-dependency": ["@smithy/invalid-dependency@4.2.10", "", { "dependencies": { "@smithy/types": "^4.13.0", "tslib": "^2.6.2" } }, "sha512-vy9KPNSFUU0ajFYk0sDZIYiUlAWGEAhRfehIr5ZkdFrRFTAuXEPUd41USuqHU6vvLX4r6Q9X7MKBco5+Il0Org=="], + + "@smithy/is-array-buffer": ["@smithy/is-array-buffer@4.2.1", "", { "dependencies": { "tslib": "^2.6.2" } }, "sha512-Yfu664Qbf1B4IYIsYgKoABt010daZjkaCRvdU/sPnZG6TtHOB0md0RjNdLGzxe5UIdn9js4ftPICzmkRa9RJ4Q=="], + + "@smithy/md5-js": ["@smithy/md5-js@4.2.10", "", { "dependencies": { "@smithy/types": "^4.13.0", "@smithy/util-utf8": "^4.2.1", "tslib": "^2.6.2" } }, "sha512-Op+Dh6dPLWTjWITChFayDllIaCXRofOed8ecpggTC5fkh8yXes0vAEX7gRUfjGK+TlyxoCAA05gHbZW/zB9JwQ=="], + + "@smithy/middleware-content-length": ["@smithy/middleware-content-length@4.2.10", "", { "dependencies": { "@smithy/protocol-http": "^5.3.10", "@smithy/types": "^4.13.0", "tslib": "^2.6.2" } }, "sha512-TQZ9kX5c6XbjhaEBpvhSvMEZ0klBs1CFtOdPFwATZSbC9UeQfKHPLPN9Y+I6wZGMOavlYTOlHEPDrt42PMSH9w=="], + + "@smithy/middleware-endpoint": ["@smithy/middleware-endpoint@4.4.20", "", { "dependencies": { "@smithy/core": "^3.23.6", "@smithy/middleware-serde": "^4.2.11", "@smithy/node-config-provider": "^4.3.10", "@smithy/shared-ini-file-loader": "^4.4.5", "@smithy/types": "^4.13.0", "@smithy/url-parser": "^4.2.10", "@smithy/util-middleware": "^4.2.10", "tslib": "^2.6.2" } }, "sha512-9W6Np4ceBP3XCYAGLoMCmn8t2RRVzuD1ndWPLBbv7H9CrwM9Bprf6Up6BM9ZA/3alodg0b7Kf6ftBK9R1N04vw=="], + + "@smithy/middleware-retry": ["@smithy/middleware-retry@4.4.37", "", { "dependencies": { "@smithy/node-config-provider": "^4.3.10", "@smithy/protocol-http": "^5.3.10", "@smithy/service-error-classification": "^4.2.10", "@smithy/smithy-client": "^4.12.0", "@smithy/types": "^4.13.0", "@smithy/util-middleware": "^4.2.10", "@smithy/util-retry": "^4.2.10", "@smithy/uuid": "^1.1.1", "tslib": "^2.6.2" } }, "sha512-/1psZZllBBSQ7+qo5+hhLz7AEPGLx3Z0+e3ramMBEuPK2PfvLK4SrncDB9VegX5mBn+oP/UTDrM6IHrFjvX1ZA=="], + + "@smithy/middleware-serde": ["@smithy/middleware-serde@4.2.11", "", { "dependencies": { "@smithy/protocol-http": "^5.3.10", "@smithy/types": "^4.13.0", "tslib": "^2.6.2" } }, "sha512-STQdONGPwbbC7cusL60s7vOa6He6A9w2jWhoapL0mgVjmR19pr26slV+yoSP76SIssMTX/95e5nOZ6UQv6jolg=="], + + "@smithy/middleware-stack": ["@smithy/middleware-stack@4.2.10", "", { "dependencies": { "@smithy/types": "^4.13.0", "tslib": "^2.6.2" } }, "sha512-pmts/WovNcE/tlyHa8z/groPeOtqtEpp61q3W0nW1nDJuMq/x+hWa/OVQBtgU0tBqupeXq0VBOLA4UZwE8I0YA=="], + + "@smithy/node-config-provider": ["@smithy/node-config-provider@4.3.10", "", { "dependencies": { "@smithy/property-provider": "^4.2.10", "@smithy/shared-ini-file-loader": "^4.4.5", "@smithy/types": "^4.13.0", "tslib": "^2.6.2" } }, "sha512-UALRbJtVX34AdP2VECKVlnNgidLHA2A7YgcJzwSBg1hzmnO/bZBHl/LDQQyYifzUwp1UOODnl9JJ3KNawpUJ9w=="], + + "@smithy/node-http-handler": ["@smithy/node-http-handler@4.4.12", "", { "dependencies": { "@smithy/abort-controller": "^4.2.10", "@smithy/protocol-http": "^5.3.10", "@smithy/querystring-builder": "^4.2.10", "@smithy/types": "^4.13.0", "tslib": "^2.6.2" } }, "sha512-zo1+WKJkR9x7ZtMeMDAAsq2PufwiLDmkhcjpWPRRkmeIuOm6nq1qjFICSZbnjBvD09ei8KMo26BWxsu2BUU+5w=="], + + "@smithy/property-provider": ["@smithy/property-provider@4.2.10", "", { "dependencies": { "@smithy/types": "^4.13.0", "tslib": "^2.6.2" } }, "sha512-5jm60P0CU7tom0eNrZ7YrkgBaoLFXzmqB0wVS+4uK8PPGmosSrLNf6rRd50UBvukztawZ7zyA8TxlrKpF5z9jw=="], + + "@smithy/protocol-http": ["@smithy/protocol-http@5.3.10", "", { "dependencies": { "@smithy/types": "^4.13.0", "tslib": "^2.6.2" } }, "sha512-2NzVWpYY0tRdfeCJLsgrR89KE3NTWT2wGulhNUxYlRmtRmPwLQwKzhrfVaiNlA9ZpJvbW7cjTVChYKgnkqXj1A=="], + + "@smithy/querystring-builder": ["@smithy/querystring-builder@4.2.10", "", { "dependencies": { "@smithy/types": "^4.13.0", "@smithy/util-uri-escape": "^4.2.1", "tslib": "^2.6.2" } }, "sha512-HeN7kEvuzO2DmAzLukE9UryiUvejD3tMp9a1D1NJETerIfKobBUCLfviP6QEk500166eD2IATaXM59qgUI+YDA=="], + + "@smithy/querystring-parser": ["@smithy/querystring-parser@4.2.10", "", { "dependencies": { "@smithy/types": "^4.13.0", "tslib": "^2.6.2" } }, "sha512-4Mh18J26+ao1oX5wXJfWlTT+Q1OpDR8ssiC9PDOuEgVBGloqg18Fw7h5Ct8DyT9NBYwJgtJ2nLjKKFU6RP1G1Q=="], + + "@smithy/service-error-classification": ["@smithy/service-error-classification@4.2.10", "", { "dependencies": { "@smithy/types": "^4.13.0" } }, "sha512-0R/+/Il5y8nB/By90o8hy/bWVYptbIfvoTYad0igYQO5RefhNCDmNzqxaMx7K1t/QWo0d6UynqpqN5cCQt1MCg=="], + + "@smithy/shared-ini-file-loader": ["@smithy/shared-ini-file-loader@4.4.5", "", { "dependencies": { "@smithy/types": "^4.13.0", "tslib": "^2.6.2" } }, "sha512-pHgASxl50rrtOztgQCPmOXFjRW+mCd7ALr/3uXNzRrRoGV5G2+78GOsQ3HlQuBVHCh9o6xqMNvlIKZjWn4Euug=="], + + "@smithy/signature-v4": ["@smithy/signature-v4@5.3.10", "", { "dependencies": { "@smithy/is-array-buffer": "^4.2.1", "@smithy/protocol-http": "^5.3.10", "@smithy/types": "^4.13.0", "@smithy/util-hex-encoding": "^4.2.1", "@smithy/util-middleware": "^4.2.10", "@smithy/util-uri-escape": "^4.2.1", "@smithy/util-utf8": "^4.2.1", "tslib": "^2.6.2" } }, "sha512-Wab3wW8468WqTKIxI+aZe3JYO52/RYT/8sDOdzkUhjnLakLe9qoQqIcfih/qxcF4qWEFoWBszY0mj5uxffaVXA=="], + + "@smithy/smithy-client": ["@smithy/smithy-client@4.12.0", "", { "dependencies": { "@smithy/core": "^3.23.6", "@smithy/middleware-endpoint": "^4.4.20", "@smithy/middleware-stack": "^4.2.10", "@smithy/protocol-http": "^5.3.10", "@smithy/types": "^4.13.0", "@smithy/util-stream": "^4.5.15", "tslib": "^2.6.2" } }, "sha512-R8bQ9K3lCcXyZmBnQqUZJF4ChZmtWT5NLi6x5kgWx5D+/j0KorXcA0YcFg/X5TOgnTCy1tbKc6z2g2y4amFupQ=="], + + "@smithy/types": ["@smithy/types@4.13.0", "", { "dependencies": { "tslib": "^2.6.2" } }, "sha512-COuLsZILbbQsdrwKQpkkpyep7lCsByxwj7m0Mg5v66/ZTyenlfBc40/QFQ5chO0YN/PNEH1Bi3fGtfXPnYNeDw=="], + + "@smithy/url-parser": ["@smithy/url-parser@4.2.10", "", { "dependencies": { "@smithy/querystring-parser": "^4.2.10", "@smithy/types": "^4.13.0", "tslib": "^2.6.2" } }, "sha512-uypjF7fCDsRk26u3qHmFI/ePL7bxxB9vKkE+2WKEciHhz+4QtbzWiHRVNRJwU3cKhrYDYQE3b0MRFtqfLYdA4A=="], + + "@smithy/util-base64": ["@smithy/util-base64@4.3.1", "", { "dependencies": { "@smithy/util-buffer-from": "^4.2.1", "@smithy/util-utf8": "^4.2.1", "tslib": "^2.6.2" } }, "sha512-BKGuawX4Doq/bI/uEmg+Zyc36rJKWuin3py89PquXBIBqmbnJwBBsmKhdHfNEp0+A4TDgLmT/3MSKZ1SxHcR6w=="], + + "@smithy/util-body-length-browser": ["@smithy/util-body-length-browser@4.2.1", "", { "dependencies": { "tslib": "^2.6.2" } }, "sha512-SiJeLiozrAoCrgDBUgsVbmqHmMgg/2bA15AzcbcW+zan7SuyAVHN4xTSbq0GlebAIwlcaX32xacnrG488/J/6g=="], + + "@smithy/util-body-length-node": ["@smithy/util-body-length-node@4.2.2", "", { "dependencies": { "tslib": "^2.6.2" } }, "sha512-4rHqBvxtJEBvsZcFQSPQqXP2b/yy/YlB66KlcEgcH2WNoOKCKB03DSLzXmOsXjbl8dJ4OEYTn31knhdznwk7zw=="], + + "@smithy/util-buffer-from": ["@smithy/util-buffer-from@4.2.1", "", { "dependencies": { "@smithy/is-array-buffer": "^4.2.1", "tslib": "^2.6.2" } }, "sha512-/swhmt1qTiVkaejlmMPPDgZhEaWb/HWMGRBheaxwuVkusp/z+ErJyQxO6kaXumOciZSWlmq6Z5mNylCd33X7Ig=="], + + "@smithy/util-config-provider": ["@smithy/util-config-provider@4.2.1", "", { "dependencies": { "tslib": "^2.6.2" } }, "sha512-462id/00U8JWFw6qBuTSWfN5TxOHvDu4WliI97qOIOnuC/g+NDAknTU8eoGXEPlLkRVgWEr03jJBLV4o2FL8+A=="], + + "@smithy/util-defaults-mode-browser": ["@smithy/util-defaults-mode-browser@4.3.36", "", { "dependencies": { "@smithy/property-provider": "^4.2.10", "@smithy/smithy-client": "^4.12.0", "@smithy/types": "^4.13.0", "tslib": "^2.6.2" } }, "sha512-R0smq7EHQXRVMxkAxtH5akJ/FvgAmNF6bUy/GwY/N20T4GrwjT633NFm0VuRpC+8Bbv8R9A0DoJ9OiZL/M3xew=="], + + "@smithy/util-defaults-mode-node": ["@smithy/util-defaults-mode-node@4.2.39", "", { "dependencies": { "@smithy/config-resolver": "^4.4.9", "@smithy/credential-provider-imds": "^4.2.10", "@smithy/node-config-provider": "^4.3.10", "@smithy/property-provider": "^4.2.10", "@smithy/smithy-client": "^4.12.0", "@smithy/types": "^4.13.0", "tslib": "^2.6.2" } }, "sha512-otWuoDm35btJV1L8MyHrPl462B07QCdMTktKc7/yM+Psv6KbED/ziXiHnmr7yPHUjfIwE9S8Max0LO24Mo3ZVg=="], + + "@smithy/util-endpoints": ["@smithy/util-endpoints@3.3.1", "", { "dependencies": { "@smithy/node-config-provider": "^4.3.10", "@smithy/types": "^4.13.0", "tslib": "^2.6.2" } }, "sha512-xyctc4klmjmieQiF9I1wssBWleRV0RhJ2DpO8+8yzi2LO1Z+4IWOZNGZGNj4+hq9kdo+nyfrRLmQTzc16Op2Vg=="], + + "@smithy/util-hex-encoding": ["@smithy/util-hex-encoding@4.2.1", "", { "dependencies": { "tslib": "^2.6.2" } }, "sha512-c1hHtkgAWmE35/50gmdKajgGAKV3ePJ7t6UtEmpfCWJmQE9BQAQPz0URUVI89eSkcDqCtzqllxzG28IQoZPvwA=="], + + "@smithy/util-middleware": ["@smithy/util-middleware@4.2.10", "", { "dependencies": { "@smithy/types": "^4.13.0", "tslib": "^2.6.2" } }, "sha512-LxaQIWLp4y0r72eA8mwPNQ9va4h5KeLM0I3M/HV9klmFaY2kN766wf5vsTzmaOpNNb7GgXAd9a25P3h8T49PSA=="], + + "@smithy/util-retry": ["@smithy/util-retry@4.2.10", "", { "dependencies": { "@smithy/service-error-classification": "^4.2.10", "@smithy/types": "^4.13.0", "tslib": "^2.6.2" } }, "sha512-HrBzistfpyE5uqTwiyLsFHscgnwB0kgv8vySp7q5kZ0Eltn/tjosaSGGDj/jJ9ys7pWzIP/icE2d+7vMKXLv7A=="], + + "@smithy/util-stream": ["@smithy/util-stream@4.5.15", "", { "dependencies": { "@smithy/fetch-http-handler": "^5.3.11", "@smithy/node-http-handler": "^4.4.12", "@smithy/types": "^4.13.0", "@smithy/util-base64": "^4.3.1", "@smithy/util-buffer-from": "^4.2.1", "@smithy/util-hex-encoding": "^4.2.1", "@smithy/util-utf8": "^4.2.1", "tslib": "^2.6.2" } }, "sha512-OlOKnaqnkU9X+6wEkd7mN+WB7orPbCVDauXOj22Q7VtiTkvy7ZdSsOg4QiNAZMgI4OkvNf+/VLUC3VXkxuWJZw=="], + + "@smithy/util-uri-escape": ["@smithy/util-uri-escape@4.2.1", "", { "dependencies": { "tslib": "^2.6.2" } }, "sha512-YmiUDn2eo2IOiWYYvGQkgX5ZkBSiTQu4FlDo5jNPpAxng2t6Sjb6WutnZV9l6VR4eJul1ABmCrnWBC9hKHQa6Q=="], + + "@smithy/util-utf8": ["@smithy/util-utf8@4.2.1", "", { "dependencies": { "@smithy/util-buffer-from": "^4.2.1", "tslib": "^2.6.2" } }, "sha512-DSIwNaWtmzrNQHv8g7DBGR9mulSit65KSj5ymGEIAknmIN8IpbZefEep10LaMG/P/xquwbmJ1h9ectz8z6mV6g=="], + + "@smithy/util-waiter": ["@smithy/util-waiter@4.2.10", "", { "dependencies": { "@smithy/abort-controller": "^4.2.10", "@smithy/types": "^4.13.0", "tslib": "^2.6.2" } }, "sha512-4eTWph/Lkg1wZEDAyObwme0kmhEb7J/JjibY2znJdrYRgKbKqB7YoEhhJVJ4R1g/SYih4zuwX7LpJaM8RsnTVg=="], + + "@smithy/uuid": ["@smithy/uuid@1.1.1", "", { "dependencies": { "tslib": "^2.6.2" } }, "sha512-dSfDCeihDmZlV2oyr0yWPTUfh07suS+R5OB+FZGiv/hHyK3hrFBW5rR1UYjfa57vBsrP9lciFkRPzebaV1Qujw=="], + "@tsconfig/bun": ["@tsconfig/bun@1.0.8", "", {}, "sha512-JlJaRaS4hBTypxtFe8WhnwV8blf0R+3yehLk8XuyxUYNx6VXsKCjACSCvOYEFUiqlhlBWxtYCn/zRlOb8BzBQg=="], "@types/bun": ["@types/bun@1.2.16", "", { "dependencies": { "bun-types": "1.2.16" } }, "sha512-1aCZJ/6nSiViw339RsaNhkNoEloLaPzZhxMOYEa7OzRzO41IGg5n/7I43/ZIAW/c+Q6cT12Vf7fOZOoVIzb5BQ=="], @@ -47,26 +232,52 @@ "@types/react": ["@types/react@19.2.2", "", { "dependencies": { "csstype": "^3.0.2" } }, "sha512-6mDvHUFSjyT2B2yeNx2nUgMxh9LtOWvkhIU3uePn2I2oyNymUAX1NIsdgviM4CH+JSrp2D2hsMvJOkxY+0wNRA=="], + "bowser": ["bowser@2.14.1", "", {}, "sha512-tzPjzCxygAKWFOJP011oxFHs57HzIhOEracIgAePE4pqB3LikALKnSzUyU4MGs9/iCEUuHlAJTjTc5M+u7YEGg=="], + "bun-types": ["bun-types@1.2.16", "", { "dependencies": { "@types/node": "*" } }, "sha512-ciXLrHV4PXax9vHvUrkvun9VPVGOVwbbbBF/Ev1cXz12lyEZMoJpIJABOfPcN9gDJRaiKF9MVbSygLg4NXu3/A=="], "csstype": ["csstype@3.1.3", "", {}, "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw=="], + "fast-xml-parser": ["fast-xml-parser@5.3.6", "", { "dependencies": { "strnum": "^2.1.2" }, "bin": { "fxparser": "src/cli/cli.js" } }, "sha512-QNI3sAvSvaOiaMl8FYU4trnEzCwiRr8XMWgAHzlrWpTSj+QaCSvOf1h82OEP1s4hiAXhnbXSyFWCf4ldZzZRVA=="], + "hono": ["hono@4.8.0", "", {}, "sha512-NoiHrqJxoe1MYXqW+/0/Q4NCizKj2Ivm4KmX8mOSBtw9UJ7KYaOGKkO7csIwO5UlZpfvVRdcgiMb0GGyjEjtcw=="], "models.dev": ["models.dev@workspace:packages/core"], + "strnum": ["strnum@2.2.0", "", {}, "sha512-Y7Bj8XyJxnPAORMZj/xltsfo55uOiyHcU2tnAVzHUnSJR/KsEX+9RoDeXEnsXtl/CX4fAcrt64gZ13aGaWPeBg=="], + + "tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="], + "undici-types": ["undici-types@6.20.0", "", {}, "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg=="], "zod": ["zod@3.24.2", "", {}, "sha512-lY7CDW43ECgW9u1TcT3IoXHflywfVqDYze4waEz812jR/bZ8FHDsl7pFQoSZTz5N+2NqRXs8GBwnAwo3ZNxqhQ=="], + "@aws-crypto/sha1-browser/@smithy/util-utf8": ["@smithy/util-utf8@2.3.0", "", { "dependencies": { "@smithy/util-buffer-from": "^2.2.0", "tslib": "^2.6.2" } }, "sha512-R8Rdn8Hy72KKcebgLiv8jQcQkXoLMOGGv5uI1/k0l+snqkOzQ1R0ChUBCxWMlBsFMekWjq0wRudIweFs7sKT5A=="], + + "@aws-crypto/sha256-browser/@smithy/util-utf8": ["@smithy/util-utf8@2.3.0", "", { "dependencies": { "@smithy/util-buffer-from": "^2.2.0", "tslib": "^2.6.2" } }, "sha512-R8Rdn8Hy72KKcebgLiv8jQcQkXoLMOGGv5uI1/k0l+snqkOzQ1R0ChUBCxWMlBsFMekWjq0wRudIweFs7sKT5A=="], + + "@aws-crypto/util/@smithy/util-utf8": ["@smithy/util-utf8@2.3.0", "", { "dependencies": { "@smithy/util-buffer-from": "^2.2.0", "tslib": "^2.6.2" } }, "sha512-R8Rdn8Hy72KKcebgLiv8jQcQkXoLMOGGv5uI1/k0l+snqkOzQ1R0ChUBCxWMlBsFMekWjq0wRudIweFs7sKT5A=="], + "bun-types/@types/node": ["@types/node@24.0.3", "", { "dependencies": { "undici-types": "~7.8.0" } }, "sha512-R4I/kzCYAdRLzfiCabn9hxWfbuHS573x+r0dJMkkzThEa7pbrcDWK+9zu3e7aBOouf+rQAciqPFMnxwr0aWgKg=="], "models.dev/@types/bun": ["@types/bun@1.3.0", "", { "dependencies": { "bun-types": "1.3.0" } }, "sha512-+lAGCYjXjip2qY375xX/scJeVRmZ5cY0wyHYyCYxNcdEXrQ4AOe3gACgd4iQ8ksOslJtW4VNxBJ8llUwc3a6AA=="], + "@aws-crypto/sha1-browser/@smithy/util-utf8/@smithy/util-buffer-from": ["@smithy/util-buffer-from@2.2.0", "", { "dependencies": { "@smithy/is-array-buffer": "^2.2.0", "tslib": "^2.6.2" } }, "sha512-IJdWBbTcMQ6DA0gdNhh/BwrLkDR+ADW5Kr1aZmd4k3DIF6ezMV4R2NIAmT08wQJ3yUK82thHWmC/TnK/wpMMIA=="], + + "@aws-crypto/sha256-browser/@smithy/util-utf8/@smithy/util-buffer-from": ["@smithy/util-buffer-from@2.2.0", "", { "dependencies": { "@smithy/is-array-buffer": "^2.2.0", "tslib": "^2.6.2" } }, "sha512-IJdWBbTcMQ6DA0gdNhh/BwrLkDR+ADW5Kr1aZmd4k3DIF6ezMV4R2NIAmT08wQJ3yUK82thHWmC/TnK/wpMMIA=="], + + "@aws-crypto/util/@smithy/util-utf8/@smithy/util-buffer-from": ["@smithy/util-buffer-from@2.2.0", "", { "dependencies": { "@smithy/is-array-buffer": "^2.2.0", "tslib": "^2.6.2" } }, "sha512-IJdWBbTcMQ6DA0gdNhh/BwrLkDR+ADW5Kr1aZmd4k3DIF6ezMV4R2NIAmT08wQJ3yUK82thHWmC/TnK/wpMMIA=="], + "bun-types/@types/node/undici-types": ["undici-types@7.8.0", "", {}, "sha512-9UJ2xGDvQ43tYyVMpuHlsgApydB8ZKfVYTsLDhXkFL/6gfkp+U8xTGdh8pMJv1SpZna0zxG1DwsKZsreLbXBxw=="], "models.dev/@types/bun/bun-types": ["bun-types@1.3.0", "", { "dependencies": { "@types/node": "*" }, "peerDependencies": { "@types/react": "^19" } }, "sha512-u8X0thhx+yJ0KmkxuEo9HAtdfgCBaM/aI9K90VQcQioAmkVp3SG3FkwWGibUFz3WdXAdcsqOcbU40lK7tbHdkQ=="], + "@aws-crypto/sha1-browser/@smithy/util-utf8/@smithy/util-buffer-from/@smithy/is-array-buffer": ["@smithy/is-array-buffer@2.2.0", "", { "dependencies": { "tslib": "^2.6.2" } }, "sha512-GGP3O9QFD24uGeAXYUjwSTXARoqpZykHadOmA8G5vfJPK0/DC67qa//0qvqrJzL1xc8WQWX7/yc7fwudjPHPhA=="], + + "@aws-crypto/sha256-browser/@smithy/util-utf8/@smithy/util-buffer-from/@smithy/is-array-buffer": ["@smithy/is-array-buffer@2.2.0", "", { "dependencies": { "tslib": "^2.6.2" } }, "sha512-GGP3O9QFD24uGeAXYUjwSTXARoqpZykHadOmA8G5vfJPK0/DC67qa//0qvqrJzL1xc8WQWX7/yc7fwudjPHPhA=="], + + "@aws-crypto/util/@smithy/util-utf8/@smithy/util-buffer-from/@smithy/is-array-buffer": ["@smithy/is-array-buffer@2.2.0", "", { "dependencies": { "tslib": "^2.6.2" } }, "sha512-GGP3O9QFD24uGeAXYUjwSTXARoqpZykHadOmA8G5vfJPK0/DC67qa//0qvqrJzL1xc8WQWX7/yc7fwudjPHPhA=="], + "models.dev/@types/bun/bun-types/@types/node": ["@types/node@24.0.3", "", { "dependencies": { "undici-types": "~7.8.0" } }, "sha512-R4I/kzCYAdRLzfiCabn9hxWfbuHS573x+r0dJMkkzThEa7pbrcDWK+9zu3e7aBOouf+rQAciqPFMnxwr0aWgKg=="], "models.dev/@types/bun/bun-types/@types/node/undici-types": ["undici-types@7.8.0", "", {}, "sha512-9UJ2xGDvQ43tYyVMpuHlsgApydB8ZKfVYTsLDhXkFL/6gfkp+U8xTGdh8pMJv1SpZna0zxG1DwsKZsreLbXBxw=="], diff --git a/models-monitor/chutes.ts b/models-monitor/chutes.ts new file mode 100644 index 000000000..31028aef3 --- /dev/null +++ b/models-monitor/chutes.ts @@ -0,0 +1,32 @@ +/** + * Chutes Models Monitor + * Required env vars: SLACK_WEBHOOK_URL, S3_BUCKET, AWS_REGION, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY + * Optional: CHUTES_API_KEY + * Usage: bun run monitor:chutes + */ + +import { runMonitor, round6 } from './lib.ts' + +runMonitor({ + name: 'Chutes', + title: 'πŸ›° Chutes Models Update', + s3Key: 'chutes/snapshot.json', + async fetchModels() { + const headers: Record = {} + if (process.env.CHUTES_API_KEY) headers['Authorization'] = `Bearer ${process.env.CHUTES_API_KEY}` + + const res = await fetch('https://llm.chutes.ai/v1/models', { headers }) + if (!res.ok) throw new Error(`Chutes API error: ${res.status} ${res.statusText}`) + const data = await res.json() as { data: Array<{ id: string; pricing: { prompt: number; completion: number } }> } + + // Chutes returns prices already in USD/1M tokens + return data.data.map(m => ({ + id: m.id, + price_prompt: round6(m.pricing.prompt), + price_completion: round6(m.pricing.completion), + })) + }, +}).catch(err => { + console.error(err) + process.exit(1) +}) diff --git a/models-monitor/lib.ts b/models-monitor/lib.ts new file mode 100644 index 000000000..99f5e3db5 --- /dev/null +++ b/models-monitor/lib.ts @@ -0,0 +1,239 @@ +import { S3Client, GetObjectCommand, PutObjectCommand } from '@aws-sdk/client-s3' + +// ── Types ───────────────────────────────────────────────────────────────────── + +export interface ModelEntry { + id: string + price_prompt: number // per 1M input tokens, USD + price_completion: number // per 1M output tokens, USD +} + +export interface Snapshot { + timestamp: string + models: ModelEntry[] +} + +type SlackBlock = Record + +// ── Helpers ─────────────────────────────────────────────────────────────────── + +/** Round to 6 decimal places to avoid float noise in comparisons */ +export function round6(n: number): number { + return Math.round(n * 1_000_000) / 1_000_000 +} + +function formatPrice(p: number): string { + if (p === 0) return '$0' + return `$${p.toFixed(2)}` +} + +function priceArrow(oldVal: number, newVal: number): string { + if (newVal > oldVal) return '↑' + if (newVal < oldVal) return '↓' + return 'β†’' +} + +function pctChange(oldVal: number, newVal: number): string { + if (oldVal === 0) return '' + const pct = ((newVal - oldVal) / oldVal) * 100 + const sign = pct > 0 ? '+' : '' + return ` _(${sign}${Math.round(pct)}%)_` +} + +function truncateList(lines: string[], maxItems = 20, sep = '\n'): string { + if (lines.length <= maxItems) return lines.join(sep) + return lines.slice(0, maxItems).join(sep) + `${sep}_…and ${lines.length - maxItems} more_` +} + +// ── S3 ──────────────────────────────────────────────────────────────────────── + +const s3 = new S3Client({ region: process.env.AWS_REGION ?? 'eu-west-1' }) + +export async function loadSnapshot(bucket: string, key: string): Promise { + try { + const res = await s3.send(new GetObjectCommand({ Bucket: bucket, Key: key })) + const body = await res.Body!.transformToString() + return JSON.parse(body) as Snapshot + } catch (e: any) { + if (e.name === 'NoSuchKey' || e.Code === 'NoSuchKey') return null + throw e + } +} + +export async function saveSnapshot(bucket: string, key: string, models: ModelEntry[]): Promise { + const snapshot: Snapshot = { timestamp: new Date().toISOString(), models } + await s3.send( + new PutObjectCommand({ + Bucket: bucket, + Key: key, + Body: JSON.stringify(snapshot, null, 2), + ContentType: 'application/json', + }), + ) +} + +// ── Slack ───────────────────────────────────────────────────────────────────── + +export async function sendSlack(fallbackText: string, blocks: SlackBlock[]): Promise { + const webhookUrl = process.env.SLACK_WEBHOOK_URL ?? '' + if (!webhookUrl) { + console.log('[Slack] No SLACK_WEBHOOK_URL set β€” skipping notification') + console.log('[Slack] Message would be:', fallbackText) + return + } + + const res = await fetch(webhookUrl, { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ text: fallbackText, blocks }), + }) + + if (!res.ok) { + console.error(`[Slack] Webhook error: ${res.status} ${await res.text()}`) + } +} + +type PriceChange = { + id: string + old_prompt: number + new_prompt: number + old_completion: number + new_completion: number +} + +export function buildSlackBlocks( + title: string, + added: ModelEntry[], + removed: ModelEntry[], + priceChanges: PriceChange[], + previousTimestamp: string, +): SlackBlock[] { + const blocks: SlackBlock[] = [ + { type: 'section', text: { type: 'mrkdwn', text: `*${title}*` } }, + { type: 'divider' }, + ] + + if (added.length > 0) { + const lines = added.map( + m => `β€’ \`${m.id}\`\n *in:* ${formatPrice(m.price_prompt)}/1M *out:* ${formatPrice(m.price_completion)}/1M`, + ) + blocks.push({ + type: 'section', + text: { type: 'mrkdwn', text: `βœ… *New models (${added.length})*\n\n${truncateList(lines, 20, '\n\n')}` }, + }) + } + + if (removed.length > 0) { + const lines = removed.map(m => `β€’ \`${m.id}\``) + blocks.push({ + type: 'section', + text: { type: 'mrkdwn', text: `❌ *Removed models (${removed.length})*\n\n${truncateList(lines, 20, '\n\n')}` }, + }) + } + + if (priceChanges.length > 0) { + const lines = priceChanges.map(c => { + const parts: string[] = [] + if (c.old_prompt !== c.new_prompt) { + parts.push(`*in:* ${formatPrice(c.old_prompt)} ${priceArrow(c.old_prompt, c.new_prompt)} ${formatPrice(c.new_prompt)}/1M${pctChange(c.old_prompt, c.new_prompt)}`) + } + if (c.old_completion !== c.new_completion) { + parts.push(`*out:* ${formatPrice(c.old_completion)} ${priceArrow(c.old_completion, c.new_completion)} ${formatPrice(c.new_completion)}/1M${pctChange(c.old_completion, c.new_completion)}`) + } + return `β€’ \`${c.id}\`\n ${parts.join(' ')}` + }) + blocks.push({ + type: 'section', + text: { type: 'mrkdwn', text: `πŸ’° *Price changes (${priceChanges.length})*\n\n${truncateList(lines, 20, '\n\n')}` }, + }) + } + + blocks.push({ + type: 'context', + elements: [{ type: 'mrkdwn', text: `Checked at ${new Date().toISOString()} | Previous snapshot: ${previousTimestamp}` }], + }) + + return blocks +} + +// ── Monitor runner ──────────────────────────────────────────────────────────── + +export interface MonitorOptions { + name: string // e.g. "OpenRouter" + title: string // Slack header, e.g. "πŸ›° OpenRouter Models Update" + s3Key: string // e.g. "openrouter/snapshot.json" + fetchModels: () => Promise +} + +export async function runMonitor({ name, title, s3Key, fetchModels }: MonitorOptions): Promise { + const bucket = process.env.S3_BUCKET ?? 'models-monitor' + + console.log(`Fetching ${name} models...`) + const current = await fetchModels() + console.log(` ${current.length} models fetched`) + + console.log(`Loading snapshot from s3://${bucket}/${s3Key}...`) + const previous = await loadSnapshot(bucket, s3Key) + + if (!previous) { + console.log('No previous snapshot found β€” saving initial snapshot.') + await saveSnapshot(bucket, s3Key, current) + await sendSlack( + `${name} Monitor initialized β€” tracking ${current.length} models.`, + [{ + type: 'section', + text: { + type: 'mrkdwn', + text: `*πŸ›° ${name} Monitor initialized*\nTracking *${current.length} models*. Future runs will report changes.\n\`s3://${bucket}/${s3Key}\``, + }, + }], + ) + console.log('Done.') + return + } + + console.log(` Previous snapshot: ${previous.models.length} models (${previous.timestamp})`) + + const prevMap = new Map(previous.models.map(m => [m.id, m])) + + const added = current.filter(m => !prevMap.has(m.id)) + const removed = previous.models.filter(m => !new Map(current.map(m => [m.id, m])).has(m.id)) + + const priceChanges = current + .filter(m => { + const prev = prevMap.get(m.id) + if (!prev) return false + return prev.price_prompt !== m.price_prompt || prev.price_completion !== m.price_completion + }) + .map(m => { + const prev = prevMap.get(m.id)! + return { + id: m.id, + old_prompt: prev.price_prompt, + new_prompt: m.price_prompt, + old_completion: prev.price_completion, + new_completion: m.price_completion, + } + }) + + console.log(` Added: ${added.length} | Removed: ${removed.length} | Price changes: ${priceChanges.length}`) + + if (added.length === 0 && removed.length === 0 && priceChanges.length === 0) { + console.log('No changes detected.') + await saveSnapshot(bucket, s3Key, current) + return + } + + const summaryParts = [ + added.length > 0 ? `${added.length} new` : null, + removed.length > 0 ? `${removed.length} removed` : null, + priceChanges.length > 0 ? `${priceChanges.length} price change(s)` : null, + ].filter(Boolean) + + await sendSlack( + `${name} update: ${summaryParts.join(', ')}`, + buildSlackBlocks(title, added, removed, priceChanges, previous.timestamp), + ) + await saveSnapshot(bucket, s3Key, current) + console.log('Snapshot updated and Slack notification sent.') +} diff --git a/models-monitor/openrouter.ts b/models-monitor/openrouter.ts new file mode 100644 index 000000000..7ad25a7c4 --- /dev/null +++ b/models-monitor/openrouter.ts @@ -0,0 +1,27 @@ +/** + * OpenRouter Models Monitor + * Required env vars: SLACK_WEBHOOK_URL, S3_BUCKET, AWS_REGION, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY + * Usage: bun run monitor:openrouter + */ + +import { runMonitor, round6 } from './lib.ts' + +runMonitor({ + name: 'OpenRouter', + title: 'πŸ›° OpenRouter Models Update', + s3Key: 'openrouter/snapshot.json', + async fetchModels() { + const res = await fetch('https://openrouter.ai/api/v1/models') + if (!res.ok) throw new Error(`OpenRouter API error: ${res.status} ${res.statusText}`) + const data = await res.json() as { data: Array<{ id: string; pricing: { prompt: string; completion: string } }> } + + return data.data.map(m => ({ + id: m.id, + price_prompt: round6(parseFloat(m.pricing.prompt) * 1_000_000), + price_completion: round6(parseFloat(m.pricing.completion) * 1_000_000), + })) + }, +}).catch(err => { + console.error(err) + process.exit(1) +}) diff --git a/package.json b/package.json index e1b4d4279..e75528cc2 100644 --- a/package.json +++ b/package.json @@ -7,9 +7,12 @@ "dev": "bun run --filter '@models.dev/web' dev", "build": "bun run --filter '@models.dev/web' build", "validate": "bun ./packages/core/script/validate.ts", + "openrouter:generate": "bun ./packages/core/script/generate-openrouter.ts", "helicone:generate": "bun ./packages/core/script/generate-helicone.ts", "venice:generate": "bun ./packages/core/script/generate-venice.ts", - "vercel:generate": "bun ./packages/core/script/generate-vercel.ts" + "vercel:generate": "bun ./packages/core/script/generate-vercel.ts", + "monitor:openrouter": "bun ./models-monitor/openrouter.ts", + "monitor:chutes": "bun ./models-monitor/chutes.ts" }, "type": "module", "workspaces": { @@ -24,5 +27,8 @@ "ai": "4.3.16", "@tsconfig/bun": "^1.0.8" } + }, + "dependencies": { + "@aws-sdk/client-s3": "^3.1000.0" } } \ No newline at end of file diff --git a/packages/core/script/generate-openrouter.ts b/packages/core/script/generate-openrouter.ts new file mode 100644 index 000000000..0cdccfafd --- /dev/null +++ b/packages/core/script/generate-openrouter.ts @@ -0,0 +1,410 @@ +#!/usr/bin/env bun + +/** + * Generates and updates OpenRouter model TOML files. + * Creates new files for missing models, updates existing ones from API data. + * Does NOT delete files β€” models absent from the API may be temporarily unavailable. + * + * Flags: + * --dry-run: Preview changes without writing files + * --new-only: Only create new models, skip updating existing ones + * [provider]: Filter to specific provider(s), e.g. "openai qwen" + * + * Usage: + * bun packages/core/script/generate-openrouter.ts + * bun packages/core/script/generate-openrouter.ts --dry-run + * bun packages/core/script/generate-openrouter.ts openai --dry-run + */ + +import { z } from "zod"; +import path from "node:path"; +import { mkdir } from "node:fs/promises"; + +const OPENROUTER_API = "https://openrouter.ai/api/v1/models"; + +// ── Zod schemas ─────────────────────────────────────────────────────────────── + +const Pricing = z.object({ + prompt: z.string(), + completion: z.string(), + input_cache_read: z.string().optional(), + input_cache_write: z.string().optional(), +}).passthrough(); + +const OpenRouterModel = z.object({ + id: z.string(), + name: z.string(), + created: z.number().nullish(), + context_length: z.number(), + pricing: Pricing, + hugging_face_id: z.string().nullish(), + top_provider: z.object({ + max_completion_tokens: z.number().nullish(), + }).passthrough().nullish(), + architecture: z.object({ + input_modalities: z.array(z.string()).nullish(), + output_modalities: z.array(z.string()).nullish(), + }).passthrough().nullish(), + supported_parameters: z.array(z.string()).nullish(), +}).passthrough(); + +const OpenRouterResponse = z.object({ + data: z.array(OpenRouterModel), +}).passthrough(); + +// ── Types ───────────────────────────────────────────────────────────────────── + +interface ExistingModel { + id?: string; + name?: string; + family?: string; + attachment?: boolean; + reasoning?: boolean; + temperature?: boolean; + tool_call?: boolean; + structured_output?: boolean; + open_weights?: boolean; + knowledge?: string; + status?: string; + release_date?: string; + last_updated?: string; + cost?: { input?: number; output?: number; cache_read?: number; cache_write?: number }; + limit?: { context?: number; output?: number }; + modalities?: { input?: string[]; output?: string[] }; +} + +interface MergedModel { + id?: string; + name: string; + family?: string; + attachment: boolean; + reasoning: boolean; + temperature: boolean; + tool_call: boolean; + structured_output?: boolean; + open_weights: boolean; + knowledge?: string; + status?: string; + release_date: string; + last_updated: string; + cost: { input: number; output: number; cache_read?: number; cache_write?: number }; + limit: { context: number; output: number }; + modalities: { input: string[]; output: string[] }; +} + +interface Change { + field: string; + oldValue: string; + newValue: string; +} + +// ── Helpers ─────────────────────────────────────────────────────────────────── + +function unixToDate(ts: number): string { + return new Date(ts * 1000).toISOString().slice(0, 10); +} + +function getTodayDate(): string { + return new Date().toISOString().slice(0, 10); +} + +function formatInt(n: number): string { + if (n >= 1000) return n.toString().replace(/\B(?=(\d{3})+(?!\d))/g, "_"); + return n.toString(); +} + +function priceStr(p: number): string { + return p === 0 ? "0" : parseFloat(p.toFixed(6)).toString(); +} + +type Modality = "text" | "image" | "audio" | "video" | "pdf"; + +function normalizeModalities(mods: string[]): Modality[] { + return mods + .map((x) => (x === "file" ? "pdf" : x)) + .filter((x): x is Modality => + ["text", "image", "audio", "video", "pdf"].includes(x), + ); +} + +// ── Load existing TOML ──────────────────────────────────────────────────────── + +async function loadExistingModel(filePath: string): Promise { + try { + const file = Bun.file(filePath); + if (!(await file.exists())) return null; + const toml = await import(filePath, { with: { type: "toml" } }).then( + (m) => m.default, + ); + return toml as ExistingModel; + } catch (e) { + console.warn(`Warning: Failed to parse ${filePath}:`, e); + return null; + } +} + +// ── Merge ───────────────────────────────────────────────────────────────────── + +function mergeModel( + api: z.infer, + existing: ExistingModel | null, +): MergedModel { + const inputMods = normalizeModalities(api.architecture?.input_modalities ?? ["text"]); + const outputMods = normalizeModalities(api.architecture?.output_modalities ?? ["text"]); + + const hasAttachment = inputMods.some((m) => ["image", "audio", "video", "pdf"].includes(m)); + const hasTools = api.supported_parameters?.includes("tools") ?? false; + const hasStructuredOutput = + (api.supported_parameters?.includes("response_format") || + api.supported_parameters?.includes("structured_outputs")) ?? + false; + const hasReasoning = api.supported_parameters?.includes("reasoning") ?? false; + const isOpenWeights = !!api.hugging_face_id; + + const releaseDate = api.created ? unixToDate(api.created) : getTodayDate(); + const outputTokens = api.top_provider?.max_completion_tokens ?? api.context_length; + + const inputPrice = parseFloat(api.pricing.prompt) * 1_000_000; + const outputPrice = parseFloat(api.pricing.completion) * 1_000_000; + const cacheReadPrice = api.pricing.input_cache_read + ? parseFloat(api.pricing.input_cache_read) * 1_000_000 + : undefined; + const cacheWritePrice = api.pricing.input_cache_write + ? parseFloat(api.pricing.input_cache_write) * 1_000_000 + : undefined; + + return { + // Preserve id if it was in the existing file + ...(existing?.id && { id: existing.id }), + // Preserve manually curated name, fall back to API + name: existing?.name ?? api.name, + // Only from existing β€” API has no family concept + ...(existing?.family && { family: existing.family }), + // From API (source of truth for capabilities) + attachment: hasAttachment, + reasoning: hasReasoning, + temperature: true, + tool_call: hasTools, + // Preserve manual structured_output override; infer from API otherwise + ...(existing?.structured_output !== undefined + ? { structured_output: existing.structured_output } + : hasStructuredOutput + ? { structured_output: true } + : {}), + // Preserve manual open_weights override; use API signal otherwise + open_weights: existing?.open_weights ?? isOpenWeights, + // Only from existing β€” API has no knowledge cutoff + ...(existing?.knowledge && { knowledge: existing.knowledge }), + ...(existing?.status && { status: existing.status }), + // Preserve manually set release_date; fall back to API created timestamp + release_date: existing?.release_date ?? releaseDate, + last_updated: getTodayDate(), + // Always from API + cost: { + input: inputPrice, + output: outputPrice, + ...(cacheReadPrice !== undefined && cacheReadPrice > 0 ? { cache_read: cacheReadPrice } : {}), + ...(cacheWritePrice !== undefined && cacheWritePrice > 0 ? { cache_write: cacheWritePrice } : {}), + }, + limit: { + context: api.context_length, + output: outputTokens, + }, + modalities: { + input: inputMods, + output: outputMods, + }, + }; +} + +// ── Format TOML ─────────────────────────────────────────────────────────────── + +function formatToml(model: MergedModel): string { + const lines: string[] = []; + + if (model.id) lines.push(`id = "${model.id}"`); + lines.push(`name = "${model.name.replace(/"/g, '\\"')}"`); + if (model.family) lines.push(`family = "${model.family}"`); + lines.push(``); + lines.push(`release_date = "${model.release_date}"`); + lines.push(`last_updated = "${model.last_updated}"`); + lines.push(`attachment = ${model.attachment}`); + lines.push(`reasoning = ${model.reasoning}`); + lines.push(`temperature = ${model.temperature}`); + lines.push(`tool_call = ${model.tool_call}`); + if (model.structured_output !== undefined) { + lines.push(`structured_output = ${model.structured_output}`); + } + lines.push(`open_weights = ${model.open_weights}`); + if (model.knowledge) lines.push(`knowledge = "${model.knowledge}"`); + if (model.status) lines.push(`status = "${model.status}"`); + + lines.push(``); + lines.push(`[cost]`); + lines.push(`input = ${priceStr(model.cost.input)}`); + lines.push(`output = ${priceStr(model.cost.output)}`); + if (model.cost.cache_read !== undefined) lines.push(`cache_read = ${priceStr(model.cost.cache_read)}`); + if (model.cost.cache_write !== undefined) lines.push(`cache_write = ${priceStr(model.cost.cache_write)}`); + + lines.push(``); + lines.push(`[limit]`); + lines.push(`context = ${formatInt(model.limit.context)}`); + lines.push(`output = ${formatInt(model.limit.output)}`); + + lines.push(``); + lines.push(`[modalities]`); + lines.push(`input = [${model.modalities.input.map((m) => `"${m}"`).join(", ")}]`); + lines.push(`output = [${model.modalities.output.map((m) => `"${m}"`).join(", ")}]`); + + return lines.join("\n") + "\n"; +} + +// ── Detect changes ──────────────────────────────────────────────────────────── + +function detectChanges(existing: ExistingModel, merged: MergedModel): Change[] { + const changes: Change[] = []; + const EPSILON = 0.001; + + const fmt = (val: unknown): string => { + if (typeof val === "number") return String(val); + if (Array.isArray(val)) return `[${val.join(", ")}]`; + if (val === undefined) return "(none)"; + return String(val); + }; + + const isMaterialPriceDiff = (a: unknown, b: unknown): boolean => { + if (a === 0 && b === undefined) return false; + if (typeof a === "number" && typeof b === "number") return Math.abs(a - b) > EPSILON; + return JSON.stringify(a) !== JSON.stringify(b); + }; + + const compare = (field: string, oldVal: unknown, newVal: unknown, isPrice = false) => { + const isDiff = isPrice + ? isMaterialPriceDiff(oldVal, newVal) + : JSON.stringify(oldVal) !== JSON.stringify(newVal); + if (isDiff) changes.push({ field, oldValue: fmt(oldVal), newValue: fmt(newVal) }); + }; + + compare("name", existing.name, merged.name); + compare("attachment", existing.attachment, merged.attachment); + compare("reasoning", existing.reasoning, merged.reasoning); + compare("tool_call", existing.tool_call, merged.tool_call); + compare("structured_output", existing.structured_output, merged.structured_output); + compare("open_weights", existing.open_weights, merged.open_weights); + compare("cost.input", existing.cost?.input, merged.cost.input, true); + compare("cost.output", existing.cost?.output, merged.cost.output, true); + compare("cost.cache_read", existing.cost?.cache_read, merged.cost.cache_read, true); + compare("cost.cache_write", existing.cost?.cache_write, merged.cost.cache_write, true); + compare("limit.context", existing.limit?.context, merged.limit.context); + compare("limit.output", existing.limit?.output, merged.limit.output); + compare("modalities.input", existing.modalities?.input, merged.modalities.input); + compare("modalities.output", existing.modalities?.output, merged.modalities.output); + + return changes; +} + +// ── Main ────────────────────────────────────────────────────────────────────── + +async function main() { + const args = process.argv.slice(2); + const dryRun = args.includes("--dry-run"); + const newOnly = args.includes("--new-only"); + const filterProviders = args.filter((a) => !a.startsWith("--")); + + const modelsDir = path.join( + import.meta.dirname, "..", "..", "..", "providers", "openrouter", "models", + ); + + const prefix = [dryRun && "[DRY RUN]", newOnly && "[NEW ONLY]"].filter(Boolean).join(" "); + console.log(`${prefix ? prefix + " " : ""}Fetching OpenRouter models...`); + + const res = await fetch(OPENROUTER_API); + if (!res.ok) { + console.error(`Failed to fetch API: ${res.status} ${res.statusText}`); + process.exit(1); + } + + const parsed = OpenRouterResponse.safeParse(await res.json()); + if (!parsed.success) { + console.error("Invalid API response:", parsed.error.errors); + process.exit(1); + } + + const apiModels = parsed.data.data.filter((m) => m.id.includes("/")); + const apiModelPaths = new Set(); + + if (filterProviders.length > 0) console.log(`Provider filter: ${filterProviders.join(", ")}`); + console.log(`Fetched ${apiModels.length} models from OpenRouter API\n`); + + let created = 0; + let updated = 0; + let unchanged = 0; + + for (const apiModel of apiModels) { + const [providerSlug, ...rest] = apiModel.id.split("/"); + const modelSlug = rest.join("/"); + if (!providerSlug || !modelSlug) continue; + + if (filterProviders.length > 0 && !filterProviders.includes(providerSlug)) continue; + + const relativePath = `${providerSlug}/${modelSlug}.toml`; + const filePath = path.join(modelsDir, relativePath); + apiModelPaths.add(relativePath); + + const existing = await loadExistingModel(filePath); + const merged = mergeModel(apiModel, existing); + const tomlContent = formatToml(merged); + + if (existing === null) { + created++; + if (dryRun) { + console.log(`[DRY RUN] Would create: ${relativePath}`); + console.log(` name = "${merged.name}"`); + console.log(); + } else { + await mkdir(path.dirname(filePath), { recursive: true }); + await Bun.write(filePath, tomlContent); + console.log(`Created: ${relativePath}`); + } + } else { + if (newOnly) { unchanged++; continue; } + + const changes = detectChanges(existing, merged); + + if (changes.length > 0) { + updated++; + if (dryRun) { + console.log(`[DRY RUN] Would update: ${relativePath}`); + } else { + await Bun.write(filePath, tomlContent); + console.log(`Updated: ${relativePath}`); + } + for (const c of changes) { + console.log(` ${c.field}: ${c.oldValue} β†’ ${c.newValue}`); + } + console.log(); + } else { + unchanged++; + } + } + } + + // Report orphaned files but never delete them + let orphaned = 0; + for await (const file of new Bun.Glob("**/*.toml").scan({ cwd: modelsDir, absolute: false })) { + if (!apiModelPaths.has(file)) { + if (orphaned === 0) console.log(); + console.log(`Note: ${file} not in OpenRouter API (kept)`); + orphaned++; + } + } + + console.log(); + if (dryRun) { + console.log(`Summary: ${created} would be created, ${updated} would be updated, ${unchanged} unchanged, ${orphaned} not in API (kept)`); + } else { + console.log(`Summary: ${created} created, ${updated} updated, ${unchanged} unchanged, ${orphaned} not in API (kept)`); + } +} + +await main();