model-sunset 0.0.0-stage → 0.1.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 +16 -0
- package/LICENSE +21 -0
- package/README.md +124 -2
- package/data/models.json +1376 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +125 -0
- package/dist/data.d.ts +54 -0
- package/dist/data.js +97 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +3 -0
- package/dist/report.d.ts +16 -0
- package/dist/report.js +90 -0
- package/dist/scan.d.ts +50 -0
- package/dist/scan.js +197 -0
- package/package.json +67 -4
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented here. This project follows [Semantic Versioning](https://semver.org/). Changes to `data/models.json` alone don't get a release; the CLI downloads the list.
|
|
4
|
+
|
|
5
|
+
## [0.1.0] - 2026-10-29
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- `model-sunset` CLI: finds hardcoded model IDs and reports retired ones and upcoming shutdowns with a suggested replacement.
|
|
10
|
+
- Shutdown list for 225 Anthropic, OpenAI and Google models, checked against the providers' pages on 2026-10-29. The CLI downloads the latest list (cached for 24 hours) and falls back to the bundled copy.
|
|
11
|
+
- Matching for Bedrock and Vertex AI spellings, strict matching for short IDs, `.gitignore` support and `model-sunset-ignore` comments.
|
|
12
|
+
- `text`, `json`, `github` and `markdown` output, `--within`, `--fail-on`, `--ignore`, `--offline`, `--data` and `--today`.
|
|
13
|
+
- GitHub Action that annotates files, writes a job summary and keeps an issue up to date.
|
|
14
|
+
- Library API: `loadData`, `scanPaths`, `scanText`, `createMatcher` and formatters.
|
|
15
|
+
|
|
16
|
+
[0.1.0]: https://github.com/acus9345/model-sunset/releases/tag/v0.1.0
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 acus9345
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,125 @@
|
|
|
1
|
-
#
|
|
1
|
+
# model-sunset
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Find hardcoded LLM model IDs in your code and warn when one is retired or about to be.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/model-sunset)
|
|
6
|
+
[](https://github.com/acus9345/model-sunset/actions/workflows/ci.yml)
|
|
7
|
+
[](LICENSE)
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
$ npx model-sunset .
|
|
11
|
+
src/chat.ts:14 claude-3-opus-20240229 RETIRED → suggested: claude-opus-4-8
|
|
12
|
+
src/embed.ts:3 gpt-5-mini sunset 2026-12-11 (in 43 days) → suggested: gpt-5.6-terra
|
|
13
|
+
|
|
14
|
+
2 hardcoded model IDs: 1 retired, 1 deprecated (model list from 2026-10-29).
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Providers retire model IDs on a schedule. On the shutdown date every request to the old ID fails, and nobody remembers which files hardcode it. `model-sunset` keeps a list of shutdown dates for Anthropic, OpenAI and Google models and tells you where your code still uses them.
|
|
18
|
+
|
|
19
|
+
- **The list updates without a release.** The CLI downloads the latest [`data/models.json`](data/models.json) from this repository (cached for 24 hours) and falls back to the copy shipped in the package when it's offline.
|
|
20
|
+
- **Finds the real spellings:** quoted IDs, `.env` and YAML values, Bedrock IDs (`anthropic.claude-3-opus-20240229-v1:0`), Vertex IDs (`claude-3-opus@20240229`) and `models/gemini-...` paths.
|
|
21
|
+
- **Few false positives:** `gpt-4` doesn't match inside `gpt-4o` or `gpt-4.1`, and short IDs such as `o1` only match when quoted or assigned to a `model` key.
|
|
22
|
+
- **Respects `.gitignore`**, and skips `node_modules`, build output, lockfiles and binaries.
|
|
23
|
+
- Text, JSON, Markdown and GitHub annotation output, plus a [GitHub Action](#github-action) that runs weekly and opens an issue.
|
|
24
|
+
|
|
25
|
+
## Usage
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npx model-sunset # scan the current directory
|
|
29
|
+
npx model-sunset src lib # scan some paths
|
|
30
|
+
npx model-sunset --within 90 # only deprecations that hit within 90 days
|
|
31
|
+
npx model-sunset --format json
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
| Option | Default | What it does |
|
|
35
|
+
| --- | --- | --- |
|
|
36
|
+
| `-f, --format` | `text` | `text`, `json`, `github` (workflow annotations) or `markdown`. |
|
|
37
|
+
| `--fail-on` | `deprecated` | Exit 1 on any finding (`deprecated`), only on `retired` IDs, or never (`none`). |
|
|
38
|
+
| `-w, --within <days>` | | Only report deprecated models that shut down within this many days. Retired ones are always reported. |
|
|
39
|
+
| `-i, --ignore <glob>` | | Skip paths, e.g. `-i "docs/**" -i "*.snap"`. Repeatable. |
|
|
40
|
+
| `--offline` | | Use the list shipped with the installed version; no network. |
|
|
41
|
+
| `--data <file\|url>` | | Use your own list in the same format. |
|
|
42
|
+
| `--today <date>` | today | Pretend it's another day, e.g. to see what breaks next quarter. |
|
|
43
|
+
|
|
44
|
+
Exit codes: `0` nothing at or above `--fail-on`, `1` something is, `2` bad usage.
|
|
45
|
+
|
|
46
|
+
To keep a line on purpose (a migration test, a changelog), put `model-sunset-ignore` in a comment on that line.
|
|
47
|
+
|
|
48
|
+
## GitHub Action
|
|
49
|
+
|
|
50
|
+
Copy [`examples/model-sunset.yml`](examples/model-sunset.yml) to `.github/workflows/` in your repository. It runs every Monday, keeps one issue up to date with what it found, and closes the issue once the IDs are gone. On pull requests it adds annotations to the changed files instead.
|
|
51
|
+
|
|
52
|
+
```yaml
|
|
53
|
+
on:
|
|
54
|
+
schedule:
|
|
55
|
+
- cron: "0 9 * * 1"
|
|
56
|
+
workflow_dispatch:
|
|
57
|
+
|
|
58
|
+
permissions:
|
|
59
|
+
contents: read
|
|
60
|
+
issues: write
|
|
61
|
+
|
|
62
|
+
jobs:
|
|
63
|
+
model-sunset:
|
|
64
|
+
runs-on: ubuntu-latest
|
|
65
|
+
steps:
|
|
66
|
+
- uses: actions/checkout@v7
|
|
67
|
+
- uses: acus9345/model-sunset@v0
|
|
68
|
+
with:
|
|
69
|
+
fail-on: retired
|
|
70
|
+
create-issue: true
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
| Input | Default | What it does |
|
|
74
|
+
| --- | --- | --- |
|
|
75
|
+
| `path` | `.` | Paths to scan, separated by spaces. |
|
|
76
|
+
| `fail-on` | `retired` | `retired`, `deprecated` or `none`. |
|
|
77
|
+
| `within` | | Same as `--within`. |
|
|
78
|
+
| `ignore` | | Glob patterns, one per line. |
|
|
79
|
+
| `create-issue` | `false` | Open, update and close an issue with the findings. Needs `issues: write`. |
|
|
80
|
+
| `issue-title` | `Hardcoded model IDs are retired or deprecated` | Title of that issue. |
|
|
81
|
+
| `version` | `0` | Version of the CLI to run from npm. |
|
|
82
|
+
|
|
83
|
+
The findings also go to the job summary, and the action sets the outputs `count` and `retired`.
|
|
84
|
+
|
|
85
|
+
## The data
|
|
86
|
+
|
|
87
|
+
[`data/models.json`](data/models.json) is the whole product, so it's kept separate from the code:
|
|
88
|
+
|
|
89
|
+
```json
|
|
90
|
+
{
|
|
91
|
+
"id": "claude-sonnet-4-5-20250929",
|
|
92
|
+
"provider": "anthropic",
|
|
93
|
+
"deprecated": "2026-09-30",
|
|
94
|
+
"shutdown": "2026-11-30",
|
|
95
|
+
"replacement": "claude-sonnet-5-5"
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
`shutdown` is `null` when a model is deprecated but has no date yet. `aliases` lists other spellings, and `strict: true` limits an ID to quoted or `model =` matches.
|
|
100
|
+
|
|
101
|
+
The dates come from the providers' own pages: [Anthropic](https://platform.claude.com/docs/en/about-claude/model-deprecations), [OpenAI](https://developers.openai.com/api/docs/deprecations) and [Google Gemini API](https://ai.google.dev/gemini-api/docs/deprecations). A [weekly workflow](.github/workflows/data-watch.yml) opens an issue here when one of those pages starts mentioning model names the list hasn't been checked against. Suggested replacements are followed to their end, so a suggestion is never itself on the list.
|
|
102
|
+
|
|
103
|
+
Cloud platforms (Amazon Bedrock, Google Cloud Vertex AI, Azure) can retire the same model on a different date. The list uses each provider's own API dates.
|
|
104
|
+
|
|
105
|
+
Found a wrong date or a missing model? A pull request that changes only `data/models.json` reaches every user within a day, with no new release needed.
|
|
106
|
+
|
|
107
|
+
## Library
|
|
108
|
+
|
|
109
|
+
```js
|
|
110
|
+
import { loadData, scanPaths, formatText } from "model-sunset";
|
|
111
|
+
|
|
112
|
+
const { data } = await loadData();
|
|
113
|
+
const findings = await scanPaths(["src"], data.models);
|
|
114
|
+
console.log(formatText(findings, { updated: data.updated }));
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
`createMatcher(models)` and `scanText(text, file, matcher, today)` let you scan text you already have, for example in a pre-commit hook. The list is also importable as `model-sunset/models.json`.
|
|
118
|
+
|
|
119
|
+
## Limits
|
|
120
|
+
|
|
121
|
+
It finds IDs written out in your code, configs and docs. An ID built at runtime (`` `claude-3-${size}` ``), read from a database or set in a provider dashboard won't be found. The list covers Anthropic, OpenAI and Google's Gemini API; pull requests for other providers are welcome.
|
|
122
|
+
|
|
123
|
+
## License
|
|
124
|
+
|
|
125
|
+
MIT
|