Metadata-Version: 2.4
Name: model-pin-check
Version: 0.2.0
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 sentence 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,anthropic,gemini,bedrock,azure-openai,deprecation,model-retirement,eol,ci,pre-commit,lint
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 sentence 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.
