Metadata-Version: 2.4
Name: model-pin-check
Version: 0.6.2
Summary: Find the AI model ids your Python repo pins and say whether the provider has already shut each one down, with the provider's own quoted passage as evidence
Author: referencesource.org
License: CC0-1.0
Project-URL: Homepage, https://referencesource.org/ai-model-deprecation-and-retirement/
Project-URL: Source, https://referencesource.org/ai-model-deprecation-and-retirement/
Keywords: llm,openai,gpt,anthropic,claude,gemini,vertex-ai,bedrock,azure-openai,mistral,groq,together-ai,databricks,watsonx,model-id,model-pin,model-deprecation,model-retirement,model-sunset,retired-model,deprecation,deprecation-check,eol,end-of-life,ci,codemod,autofix,upgrade-path,dockerfile,github-actions,terraform
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Quality Assurance
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# model-pin-check

Find the AI model ids your repo pins and say, for each one, whether the
provider has already shut it down — with the provider's own quoted passage and the
page it came from, so you can check the answer rather than trust it.

```
$ model-pin-check

claude-3-5-sonnet-20240620 — SHUT DOWN
  .env:1:17        ANTHROPIC_MODEL=claude-3-5-sonnet-20240620
  src/llm.py:4:13  MODEL = "claude-3-5-sonnet-20240620"
    Anthropic — Anthropic API / Claude Platform on AWS / Microsoft Foundry
      status: Retired   shutdown: October 28, 2025
      the provider names as replacement: claude-sonnet-5-5
      "| October 28, 2025 | `claude-3-5-sonnet-20240620` | `claude-sonnet-5-5` |"
      https://platform.claude.com/docs/en/about-claude/model-deprecations
      our record: https://referencesource.org/ai-model-deprecation-and-retirement/claude-3-5-sonnet-20240620/  last checked 2026-11-11

1 pinned model id(s) in 2 files: 1 shut down, 0 shut down on some platforms,
0 deprecated, 0 dated but still served.
Only the ids above were looked for; one this scan did not name has not been
cleared.
$ echo $?
1
```

Exit 1 means at least one pinned id has been shut down by every provider we
hold a record for: that call will not come back. A model that is merely
deprecated with a date still in the future is listed and exits 0, because it
still answers and breaking your build over it would be wrong.

## Install

```
pip install model-pin-check          # or: pipx install model-pin-check
model-pin-check
```

As a `pre-commit` hook:

```yaml
repos:
  - repo: https://github.com/referencesource/model-pin-check
    rev: v0.1.0
    hooks:
      - id: model-pin-check
```

As a library:

```python
from model_pin_check import scan, lookup

result = scan(["src"])
for f in result["findings"]:
    print(f["id"], f["verdict"], len(f["hits"]), "places")

hit = lookup("gpt-4-32k")      # None when we hold no record for the id
```

No dependencies, and it makes no network calls: the records ship inside the
package, so it works in a sealed CI job and in an air-gapped build.

## What it scans

Python first — `.py .pyi .ipynb` — then the rest of a Python service's repo:
`.json .jsonc .yaml .yml .toml .ini .cfg .env .tf .hcl`, `.js .ts .tsx .go
.rb .java .rs .php .cs .sh`, and extensionless or suffixed names like
`Dockerfile`, `Dockerfile.prod`, `Makefile`, `Procfile` and `Jenkinsfile`,
matched without regard to case.

Your own dotted directories are read too, because that is where a model id
often is: `.github/workflows/`, `.devcontainer/`, `.streamlit/`, `.cursor/`,
`.claude/`, `.chainlit/`, `.gitlab/`. Caches, build output and somebody
else's code are skipped — `.git`, `.venv`, `venv`, `__pycache__`,
`site-packages`, `.tox`, `node_modules`, `dist`, `build`, `.terraform` and
friends — because somebody else's pin is not your pin.

`--include-docs` adds `.md .rst .txt .adoc`. Those are prose mentions, not
pins, which is why they are off by default.

An id is read in every shape a provider writes it: bare (`gpt-4-32k`), behind
a namespace (`models/gemini-2.5-flash`, `openai/gpt-4o`), with a Bedrock
region prefix (`us.anthropic.claude-3-5-sonnet-20240620-v1:0`), and with a
Vertex AI version inside it (`textembedding-gecko@003`,
`imagegeneration@006` — **new in 0.2.0**; before that the `@` ended the token
and all ten ids of that shape were missed, so a repository calling a shut-down
one came back clean).

## What it will not tell you

* **An id it did not name has not been cleared.** The scan reports what it
  found in the files it opened, and prints how many files that was. A clean
  run over nothing is not a clean bill of health.
* **An id we hold no record for is unknown to us, not supported.**
  `--model some-new-id` says so in those words, with the number of records
  held and the date they were built, so you can see the denominator.
* **Gone on one platform is not gone.** The same id is served by several
  platforms on different dates: `gpt-4o` has one retirement date on Azure and
  another on OpenAI's own API. "SHUT DOWN" is reported only when every record
  for the id says so; otherwise you get "shut down on some platforms" and the
  rows that disagree. `--strict` exits 1 for that case too.
* **A date that can be read two ways is read the later way.** Providers print
  retirement dates every way there is, and `3/9/2026` is March 9 to an
  American vendor and 3 September to a European one. Both readings are
  printed and the later one decides, so a model is never called gone early.
* **It changes no files.** The npm twin can rewrite a dead pin to the
  successor the provider names (`npx model-pin-check --fix`). That half is
  not ported here yet: a wrong rewrite edits your code, and the rules that
  make it safe deserve their own tests rather than a hurried port. `--fix`
  here exits 2 and says this.

## Where the data comes from

Every row was read off a provider's own deprecation or lifecycle page and
kept with the sentence it was read from, the page URL, and the date it was
last re-checked. The records are re-verified on a schedule and anything found
wrong is fixed or pulled.

The compilation: [referencesource.org/ai-model-deprecation-and-retirement](https://referencesource.org/out/pkg/model-pin-check/)

Facts and a short attributed quote from each provider's own documentation;
this compilation CC0-1.0. This is not a provider's own tool and is not
affiliated with any of them. Automated: built and maintained by a program.

## The npm twin

The same records, the same verdicts, the same data file, for repos that have
Node: `npx model-pin-check`. It additionally rewrites dead pins. This Python
build exists because a `pip install` or a `pre-commit` hook is how a Python
repository installs a check, and plenty of Python CI jobs have no Node at
all.

<!-- release-notes:start -->

## Release notes

### 0.6.2 — 2026-11-25

**29 values in this package were wrong, and they are corrected here. Every
release from 0.2.0 onwards shipped all 29; if you are pinned to 0.6.1 or
earlier, upgrade — those versions are superseded.** Five of the twenty-nine
changed this tool's verdict and not just a date: it answered `shut down` for
models the provider's own page still lists as served, and a CI job that failed
on one of those lines failed for nothing.

Nothing in the code changed except one new notice, described at the end of this
entry. The data file is rebuilt from the records, each of which was corrected by
re-reading the provider's own page on the date in the last column; every
corrected value is quoted on its record page from the row it was read out of.

### The five that changed a verdict

These are the ones to look at first, because the error pointed the dangerous
way: towards calling a live model dead.

* **`gemini-3.6-flash`** was shipped with a shutdown date of **November 19,
  2026** — a date in the past — against Google's **January 28, 2027**. The
  verdict went from `shut down` to `dated but still served`. The replacement it
  names also moved, `gemini-3.8-flash` to **gemini-4-hydrogen**.
* **`gpt-4o-transcribe`**, **`gpt-4o-mini-transcribe`** and
  **`gpt-4o-mini-tts`** were all shipped as retired on **2026-10-15** against
  **2027-02-26**, **2027-01-20** and **2027-01-20**. All three went from `shut
  down` to `dated but still served`.
* **`Llama-4-Maverick-17B-128E-Instruct-FP8`** was shipped as retired on
  **2026-11-19** against **2027-02-03** — `shut down` to `dated but still
  served`.

One more changed verdict in the other direction, which is the kind this tool
exists to catch: **`claude-opus-4-5-20251101`** was shipped as `Active` with
"Not sooner than November 24, 2026" and is now **Deprecated** with a shutdown
of **January 22, 2027**, naming **claude-opus-5-5** as its replacement. A reader
on 0.6.1 was told a deprecated model was fine.

### Every corrected value, with the date we found it

| model id | field | 0.6.1 shipped | this release ships | found |
| --- | --- | --- | --- | --- |
| `gpt-4o-mini-transcribe` | shutdown_date | 2026-10-15 | **2027-01-20** | 2026-11-20 |
| `gpt-4o-mini-tts` | shutdown_date | 2026-10-15 | **2027-01-20** | 2026-11-20 |
| `gpt-4o-transcribe` | shutdown_date | 2026-10-15 | **2027-02-26** | 2026-11-20 |
| `gpt-chat-latest` | shutdown_date | 2027-05-18 | **2027-02-02** | 2026-11-20 |
| `gpt-image-1` | shutdown_date | 2026-10-23 | **2026-10-28** | 2026-11-20 |
| `gpt-realtime-2.1` | shutdown_date | 2027-06-25 | **2027-07-31** | 2026-11-20 |
| `gpt-realtime-2.1-mini` | shutdown_date | 2027-06-25 | **2027-07-31** | 2026-11-20 |
| `gpt-realtime-mini` | shutdown_date | 2026-12-15 | **2027-06-15** | 2026-11-20 |
| `Cohere-rerank-v4.0-fast` | shutdown_date | 2027-09-13 | **2027-09-14** | 2026-11-22 |
| `Cohere-rerank-v4.0-pro` | shutdown_date | 2027-09-13 | **2027-09-14** | 2026-11-22 |
| `DeepSeek-V3.2` | shutdown_date | 2027-11-01 | **2027-11-02** | 2026-11-22 |
| `DeepSeek-V4-Flash` | shutdown_date | 2028-02-20 | **2028-02-22** | 2026-11-22 |
| `DeepSeek-V4-Pro` | shutdown_date | 2028-02-20 | **2028-02-22** | 2026-11-22 |
| `MAI-Image-2.5` | shutdown_date | 2026-10-01 | **2026-11-24** | 2026-11-22 |
| `MAI-Image-2.5-Flash` | shutdown_date | 2026-10-01 | **2026-11-24** | 2026-11-22 |
| `MAI-Image-2.5-Pro` | shutdown_date | 2026-10-01 | **2026-11-24** | 2026-11-22 |
| `MAI-Image-2e` | shutdown_date | 2026-08-15 | **2026-08-28** | 2026-11-22 |
| `claude-fable-5` | shutdown_date | 2027-12-05 | **2027-12-07** | 2026-11-22 |
| `claude-fable-5-1` | shutdown_date | 2027-12-05 | **2027-12-07** | 2026-11-22 |
| `claude-mythos-5-1` | shutdown_date | 2027-09-01 | **2027-12-07** | 2026-11-22 |
| `gemini-3.6-flash` | shutdown_date | November 19, 2026 | **January 28, 2027** | 2026-11-22 |
| `gemini-3.6-flash` | replacement_model | gemini-3.8-flash | **gemini-4-hydrogen** | 2026-11-23 |
| `gemini-3.7-flash` | replacement_model | gemini-3.8-flash | **gemini-4-hydrogen** | 2026-11-23 |
| `claude-opus-4-5-20251101` | lifecycle_status | Active | **Deprecated** | 2026-11-25 |
| `claude-opus-4-5-20251101` | shutdown_date | Not sooner than November 24, 2026 | **January 22, 2027** | 2026-11-25 |
| `claude-opus-4-5-20251101` | replacement_model | *(none stated)* | **claude-opus-5-5** | 2026-11-25 |
| `Llama-3.3-70B-Instruct` | shutdown_date | 2027-01-31 | **2027-02-03** | 2026-11-25 |
| `Llama-4-Maverick-17B-128E-Instruct-FP8` | shutdown_date | 2026-11-19 | **2027-02-03** | 2026-11-25 |
| `Llama-4-Scout-17B-16E-Instruct` | shutdown_date | 2027-01-31 | **2027-02-03** | 2026-11-25 |

The dates in the last column are the day we read the provider's page and
recorded the move, not the day the provider made it. Twenty-five of the
twenty-nine were published as a dated change on
<https://referencesource.org/changes/> on that day; the four found on
2026-11-25 (`claude-opus-4-5-20251101`'s replacement and the three Llama rows)
came out of a re-read with no separate change story filed.

This release also adds 35 records that 0.6.1 did not hold, and no record was
dropped: 1,239 records, up from 1,204.

### Which releases are superseded, exactly

Read against the data file each release actually published, not against the
repository:

* **All 29 corrected values were in npm 0.2.0, 0.3.0, 0.4.0, 0.5.0, 0.6.0 and
  0.6.1, and in PyPI 0.2.0, 0.3.0, 0.6.0 and 0.6.1.**
* The first npm release (2026-11-15) held 21 of the 29 records at all, and 20
  of those 21 carried the wrong value. The one it had right was
  `gpt-realtime-mini`.

Nothing is being yanked. The wrong answers are named here instead, because they
travelled into two registries where a reader pins them, and withdrawing the
releases quietly would leave that reader with no way to know which answer they
had acted on.

### New: a value under review says so, in the data and in the output

Correcting a value takes two steps. First we notice that the provider's page no
longer says what our quote says, and publish that as a dated change. Then we
re-read the page and write the new value in. Between those two steps we were
still shipping the old value with nothing beside it — and, worse, the website
was calling it *verified* while our own change feed said it had moved. That was
a misrepresentation and it is fixed on both surfaces as of 2026-11-25.

In this package the fix is a `under_review` list on any record whose published
value one of our own later readings contradicts. Each entry carries the value
we ship, the value the later reading states, the date we filed it, the page and
the provider's own passage — and whether that passage itself states the new
value, because often it does not and claiming otherwise would be the same error
one step along. The default output prints it beside the value and the quote;
`--json` carries it on each record under `findings[].records[]`; the whole-file
count is `under_review_records` with a sentence in `under_review_note`.

`under_review` is **absent, never an empty list**, on a record nothing
contradicts. An empty list would read as "we checked and there is no reported
change", which is a promise this package cannot make.

**In this release the list is empty everywhere**, because every one of the 29
reported changes above has now been adopted — which is what a correction
release is. The key exists so that the next one is visible the day it is filed
rather than the day it is fixed.

One wording change throughout, no behaviour attached: what we call the evidence
is now "the provider's own quoted passage" rather than "the provider's own
sentence". A quote is often a table row or a fragment, and calling it a
sentence overstated what we hold.

### 0.6.1 — 2026-11-20

**Three Azure retirement dates in this package were wrong, and every release
up to and including 0.6.0 shipped at least one of them. If you are pinned to
0.6.0 or earlier, upgrade: those versions are superseded.** Nothing in the code
changed. The data file is rebuilt from the records, which were corrected
against Microsoft's own retirement table on **2026-11-19**.

What a reader was told, and what the provider's table actually says. Each
corrected value is quoted from the row it was read out of, and each record page
below carries that quote and the date it was last confirmed.

| id | platform | this package said | the table says | corrected |
| --- | --- | --- | --- | --- |
| `gpt-realtime-mini` (version 2025-10-06) | Azure / Microsoft Foundry | retired **2026-09-21** | **2027-04-06** | 2026-11-19 |
| `gpt-image-1.5` | Azure / Microsoft Foundry | retires **2026-12-16** | **2027-06-16** | 2026-11-19 |
| `codex-mini` | Azure / Microsoft Foundry | retired **2026-11-15** | **2026-11-17** | 2026-11-19 |

* **`gpt-realtime-mini` is the one that gave a wrong verdict, not just a wrong
  date.** A shutdown date of 2026-09-21 is two months in the past, so this
  package answered `gpt-realtime-mini — shut down on some platforms` and exited
  1 for a model Microsoft serves until 2027-04-06. A CI job that failed on that
  line failed for nothing. No file was ever rewritten over it: `--write` only
  replaces a pin where every platform holding the id names one same
  replacement, and the Azure row names none. Source row, as printed:
  `| gpt-realtime-mini | 2025-10-06 | GA | 2027-04-06 | — |`
  (<https://referencesource.org/ai-model-deprecation-and-retirement/2025-10-06-gpt-realtime-mini/>).
* **`gpt-image-1.5` was given one month to live instead of seven.** Row:
  `| gpt-image-1.5 | 2025-12-16 | GA | 2027-06-16 | — |`
  (<https://referencesource.org/ai-model-deprecation-and-retirement/gpt-image-1-5-2/>).
  The verdict was unchanged — the OpenAI platform deprecates the same id on
  2026-12-01 — but anybody who read the Azure date out of `--json` and planned
  a migration round it planned it a half-year early.
* **`codex-mini` was two days out.** Microsoft moved the row from 2026-11-15 to
  2026-11-17. Both dates are in the past, so the verdict was right either way.
  Row: `| codex-mini | 2025-05-16 | Deprecated | 2026-11-17 | — |`
  (<https://referencesource.org/ai-model-deprecation-and-retirement/codex-mini/>).

**Which versions are superseded, exactly.** The dates are history, so this is
stated per release rather than as a blanket warning:

* `codex-mini` **2026-11-15** and `gpt-image-1.5` **2026-12-16** were in
  **every** release before this one: npm 0.1.0, 0.2.0, 0.3.0, 0.4.0, 0.5.0,
  0.6.0 and PyPI 0.1.0, 0.2.0, 0.3.0, 0.6.0.
* `gpt-realtime-mini` **2026-09-21** was in npm **0.3.0, 0.4.0, 0.5.0, 0.6.0**
  and in **every** PyPI release (0.1.0 onwards). npm 0.1.0 and 0.2.0 shipped
  2027-04-06 and were right; the wrong date arrived in a re-harvest on
  2026-11-16 and was published the same day.

Nothing is being yanked. The wrong answer is named here instead, because it
travelled into two registries where a reader pins it, and withdrawing the
releases quietly would leave the reader with no way to know which answer they
had acted on.

**Also in this release, from two days of re-checking** (the records behind this
package are re-read daily; 0.6.0's data file was built on 2026-11-17 and this
one on 2026-11-19):

* 63 further values moved on 36 other ids, none of them a repair of a mistake
  of ours.
  * **8 Azure ids now read `SHUT DOWN`** where 0.6.0 read "deprecated",
    because the date their row prints has since passed: `o1`, `o1-pro`, `o3`,
    `o3-mini`, `o3-pro`, `o3-deep-research`, `o4-mini` and
    `Llama-4-Maverick-17B-128E-Instruct-FP8`. One Vertex AI id,
    `gemini-3.6-flash`, the same.
  * **27 Gemini Developer API ids** re-read from Google's own deprecations
    page on 2026-11-17: `gemini-2.5-flash` and `gemini-2.5-pro` gained a
    shutdown date of December 1, 2026 where the page had announced none, four
    preview ids had theirs moved later (one to March 31, 2027),
    `gemini-3.1-flash-live-preview` had its date withdrawn again, and 23
    recommended replacements changed.
* 243 quotes and source URLs were refreshed under unchanged values — Google now
  serves that page from `aistudio.google.com` and the rows are rendered as
  bullets rather than a table, so the sentence this package shows as evidence
  had to be re-read even where the date had not moved.

**A limit this release does not fix, stated plainly.** The verdict for each id
is computed when the data file is built, not when you run the tool, so a
retirement date that passes *after* a release still reads "deprecated" until
the next one. That is why the eight Azure ids above moved to `SHUT DOWN` in a
release rather than on the day. Computing it from the date at run time is the
obvious fix and it is queued with its own tests; it changes what the tool
answers, so it is not being slipped into a correction release.

### The two copies, and the one thing only npm does

Everything else is the same in both copies — the records, the scanner, the
verdicts, the exit codes, `--json`, `--model`, `--include-docs`, `--strict`,
`--quiet`, `--full-quote`.

* **`--fix` and `--write` are npm only.** The repair half — rewrite a dead pin
  to the successor the provider itself names — arrived in npm 0.2.0 and has
  never been ported to Python. The Python copy does not ignore the flags: it
  exits 2 and says where the repair lives, because silently doing nothing to
  somebody's code would be worse than refusing. A wrong rewrite edits your
  files, so the port waits for its own tests rather than a hurried copy.

That is the whole difference, and it is the reason npm's number used to run
ahead: npm had two releases before the Python copy existed, one of them
`--fix`. A shared version number is a release number for the pair; it does not
claim the two copies accept the same flags. This section does.

Every released version, and what it changed: `CHANGELOG.md` in this package.

<!-- release-notes:end -->
