Last Orders
Find retiring AI model IDs in your code before they break. One command scans your repo for OpenAI, Anthropic Claude and Google Gemini model IDs that are being shut down. For each one it tells you the shutdown date, the replacement the provider recommends, and the code changes the new model needs.
Next shutdown: Claude Sonnet 4.5 (
claude-sonnet-4-5-20250929, and theclaude-sonnet-4-5alias) retires on the Claude API on 30 November 2026. OpenAI switched off o1, o3-mini, o4-mini, gpt-3.5-turbo and others on 23 October 2026.
Heads-up: OpenAI removes GPT-4o, GPT-4o mini, GPT-4.1 and GPT-4.1 mini from the API on 14 January 2027 and recommends
gpt-6-luna. In our tests,gpt-6-lunarejectsmax_tokens, and it rejects tool calls on Chat Completions unlessreasoning_effortis"none". So changing the model name isn't enough. The scan flags both.
The scan is free. You don't need an account, a licence or an API key, and your code never leaves your machine.
Install
pipx install lastorders # or: pip install lastorders
You need Python 3.10 or later.
Scan
lastorders scan . # scan the current repo
lastorders scan path/to/repo --out scan-results
lastorders scan . --offline # no network at all (uses the bundled migration pack)
You get scan.md, a readable report, and scan.json, the same data for tools. They go in lastorders-out/, or wherever --out points. Each finding includes:
- File, line and model ID, from code (Python, R, R Markdown, Quarto, JS, TS, PHP, Rust, C#, Go, EJS, shell, Makefiles, Jupyter notebooks,
.httprequest files,<script>blocks and quoted values such as<option value>in HTML and Django templates, and extensionless scripts with a shebang),.envfiles, YAML, JSON, TOML,*.exampleconfig templates and docs (including MDX and Cursor.mdcrules) - Shutdown date and recommended replacement, from the provider's published deprecations
- Risk level. High means the date is close or has passed, or the new model needs a code change your
code doesn't have yet, such as
max_tokensbecomingmax_completion_tokens,reasoning_effortfor tools andtemperature, or an unsupported endpoint - Fine-tuned models (
ft:...), listed separately. They shut down with their base model and can't be swapped automatically. - Models chosen by environment variable (
os.getenv("OPENAI_MODEL")), so you can check the values you have deployed - SDKs detected: the official
openaiandanthropicclients, LangChain and plain HTTP
Useful flags:
| Flag | What it does |
|---|---|
--fail-on-high |
exit code 2 if anything is high risk (for CI) |
--include-generated |
also scan generated, minified and vendored files (one summary line each by default; they do not fail CI) |
--no-docs |
skip .md / .txt files |
--pack openai |
only use some providers' packs (default: all) |
--offline |
use the bundled pack only; makes no network calls |
--format json |
print the summary as JSON |
--summary-file F / --annotations |
CI outputs (used by the GitHub Action) |
Fix
Without a licence, swap and fix print a per-file summary of model IDs that would change. They do not print a diff, and they do not write one.
lastorders fix .
# app/summarise.py: 1 change (gpt-4o-2024-08-06 -> gpt-6-luna)
With a licence, the same commands write a reviewable patch and leave the repo unchanged until you apply it:
lastorders fix . # writes lastorders-out/fix.diff + fix-plan.md
lastorders fix . --verify # also checks the patch on a scratch copy (see below)
git apply lastorders-out/fix.diff
fix swaps the retiring model IDs it can change safely, then makes the code changes the new model needs at each API call.
It does not rename every ID. If an ID keeps a definition somewhere (a renamed copy would create a duplicate key or
list entry, or it sits in a migration, price list, catalogue, deployment name or fixture), the ID is kept everywhere:
no other reference to it is renamed, and each one is listed instead. The CLI prints the first KEPT <id> and
MUST UPDATE TOGETHER file:line lines, then points to the full list: kept_definitions and must_update_together in
swap-summary.json, and the kept-definition items in fix-plan.md. Together with everything below, that is the must-review list.
On some repos it is the whole result and the patch is empty.
At each call it does change:
- Renames
max_tokens, tomax_completion_tokenson Chat Completions ormax_output_tokenson Responses. - Adds
reasoning_effort: "none"where gpt-6-luna needs it: Chat Completions calls with tools, and calls that settemperature,top_porlogprobs. On Responses it addsreasoning.effort. - Puts anything it can't decide safely on the must-review list in
fix-plan.md: legacyfunctionscalls, Assistants and legacy Completions calls (these stay on their current model in the patch), fine-tunes and fine-tuning jobs, LangChain wrappers, calls that pass**kwargsor a spread object, conflicting values, and calls whose model isn't visible in the code (use--assume-model).
Every change comes from the migration pack's rules. Python is edited with
libcst, so your formatting and comments are kept. JS and TS are edited
with a built-in parser. Rules the pack marks inferred are only suggested unless you pass --include-inferred.
Old models reject reasoning_effort. We tested gpt-4o and gpt-4.1 against the live API, and both return
HTTP 400. Any fix that adds it has to ship together with the model switch. When the model comes from an
environment variable, the plan marks the fix "ship with the model switch". --no-model-swap applies only
the changes that are safe on the old model.
--verify applies the patch to a temporary copy of your repo, then:
- checks the changed files still parse;
- re-runs the fixer and checks it changes nothing more;
- replays each fixed call twice: once as it was (old model, old arguments) and once as patched (new model, new arguments).
Without --live, the replay uses simulated responses. With --live and your own OPENAI_API_KEY (licence),
the calls go straight to OpenAI. A control run also sends the unpatched arguments to the new model, to show
each fix was needed. --evals evals/regression.yaml reruns your own suite with the fixed arguments.
GitHub Action
Add .github/workflows/model-scan.yml:
name: Model retirement scan
on:
pull_request:
schedule: [{ cron: "0 7 * * 1" }] # weekly, so new deprecations show up without code changes
permissions:
contents: read
jobs:
scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: burntandtoast/lastorders@v0.4.13
with:
fail-on-high: "true"
The Action posts a summary table to the job page, marks findings inline on the PR and uploads scan.json
as an artifact. Inputs:
| Input | Default | |
|---|---|---|
path |
. |
folder to scan |
fail-on-high |
false |
fail the job on high-risk findings |
include-docs |
true |
scan .md/.txt |
annotations |
true |
inline PR annotations |
packs |
all | e.g. openai,anthropic |
offline |
false |
bundled pack only, no network |
packs-url |
built-in | override the pack URL |
version |
action source | install this version from PyPI instead |
python-version |
3.12 |
|
fix-preview |
false |
also print the per-file model summary. With LASTORDERS_LICENCE, write the patch and run simulated verify |
artifact-name |
lastorders-scan |
Outputs: total, high and report-dir.
Migration packs: where the data comes from
What the scanner knows lives in migration packs, versioned JSON files with one pack per provider. Each pack
holds the model IDs and aliases, shutdown dates, replacements, call-site patterns, and parameter and endpoint
rules. Every fact links to the provider's documentation and the date we checked it. Rules we confirmed
against the live API are marked live-tested, and anything we assumed is marked inferred.
- OpenAI: full pack. The default mapping swaps the 14 Jan 2027 GPT-4o / GPT-4.1 batch to
gpt-6-luna, and the 23 Oct 2026 chat and reasoning models togpt-5.6-luna,gpt-5.6-solorgpt-5.6-terra. For those three replacements, live-tested on 16 Oct 2026 (probes/probe_56-result.json), the paidfixrenames Chat Completionsmax_tokenstomax_completion_tokensand setsreasoning_efforttononewhere the call uses temperature (other than 1),top_p,logprobsor tools, in the same change as the model switch. Responses calls with those parameters are flagged.reasoning_effortmaxis flagged.o1-pro(the documented substitute isgpt-5.6-solwithreasoning.mode: pro),gpt-image-1and fine-tunes are flagged, not rewritten. Models that have already shut down, including the 28 Sep 2026 batch and the 23 Jul 2026 batch, are reported as already retired. - Anthropic: Claude API retirement dates from Anthropic's model deprecations page, plus the undated
claude-sonnet-4-5alias (from the Sonnet 4.5 model page), which retires withclaude-sonnet-4-5-20250929on 30 Nov 2026. Sampling-parameter rules are checked per call, so atemperatureon an OpenAI call in the same file doesn't flag a Claude call. Amazon Bedrock and Google Cloud dates for Claude are not covered. - Google: Vertex AI only, and flag-only.
gemini-2.5-pro,gemini-2.5-flashandgemini-2.5-flash-literetire on Vertex on 20 Oct 2026.gemini-live-2.5-flash-native-audioretires on 13 Dec 2026; the model versions table lists no replacement ID.gemini-2.5-flash-imageretires on 15 Mar 2027; the table listsgemini-3.1-flash-lite-image. A Vertex retirement is high risk only when that file is using Vertex and the shutdown is within 30 days or already past. On the Gemini API the same IDs are not treated as this retirement, so the finding stays informational. Nothing is rewritten automatically. - Azure OpenAI and Bedrock: planned
The tool checks for a newer pack once a day and falls back to the copy bundled with the package.
lastorders packs list shows which version and source you're using. The format is documented in
docs/PACKS.md, with a JSON Schema in migration_kit/pack_data/pack.schema.json.
Privacy and network use
- The scan runs entirely on your machine. Your code and prompts are never uploaded.
- The tool has no telemetry, analytics or tracking. (Our website counts visits anonymously with Cloudflare Web Analytics: no cookies, no ads, no tracking across sites.)
- The tool only ever contacts us to download the latest migration pack (a plain GET of a static JSON file,
with no identifiers) and, for paid features, to check a licence key. That check sends only the key and the
repo name (
github.com/owner/repo), and the signed answer is cached for a week, with a 14-day offline grace period after that. --offline(orLASTORDERS_OFFLINE=1) turns off all network access and uses the bundled pack.- The paid
evalcommand calls the AI provider directly with your own API key. Nothing goes through us.
Paid features
| Free | Licence (per repo) | Done for you | |
|---|---|---|---|
scan, GitHub Action, per-file model summary (fix / swap with no licence) |
✓ | ✓ | ✓ |
fix / swap patch (.diff, plan, simulated --verify), --apply, fix --verify --live, init-evals + eval, client-ready report |
✓ | ✓ | |
| We do the migration, evals and handoff | ✓ |
One licence covers one GitHub repository, monorepos included. It's bound to the repo the first time
you use it. A licence is £179 per repo, one-off, tax included. It unlocks a reviewable patch plus a must-review
list of anything it couldn't safely change, and a before-and-after report. You run it and review it before you
merge. See https://lastorders.burntandtoast.com/#pricing, or run lastorders licence buy, which prints the checkout
link for this repo. Then pass the key with LASTORDERS_LICENCE (a repository secret in Actions) or --licence.
Prefer us to do it? From £1,500: hello@burntandtoast.com. lastorders licence status shows
whether it's verified. Paid commands work --offline from the cached check. Repos without an origin remote
can set LASTORDERS_REPO=github.com/owner/repo. The licence server lives in server/; see
docs/LICENCE-SERVER.md.
init-evals reads the call sites the scan found, including prompts, JSON schemas and tool definitions where
they can be read from the code, and writes a starter evals/regression.yaml. You then edit it into 10 to 20
real examples. eval runs them against the old and new model with your own key.
Licence
The free scan is MIT: the scanner, migration packs, CLI and licence client.
The patch is proprietary (LICENSE-COMMERCIAL), together with eval, init-evals and report. That covers migration_kit/swapper.py and migration_kit/fixer/: generating the diff, writing it, applying it, and simulated or live verify. The source is in this repository so you can read it. Using it requires a paid licence (£179 per repo) from https://lastorders.burntandtoast.com/#pricing. You may not redistribute that code, or modify it to skip the licence check. Without a licence the CLI prints only the per-file model summary.
Limitations
- Detection uses pattern matching. Model names built at runtime or stored in a database won't be found; env-var lookups are listed so you can check them.
- A pack is only as current as its
updateddate. Always check the provider's documentation before acting. - The scan names retiring model IDs. Review every licensed patch before you apply it.
fixaims to make parameter changes and model switches together, but a call can end up with one and not the other. For example, it can renamemax_tokenstomax_completion_tokenson a call it leaves ongpt-4o(the old model accepts it). It addsreasoning_effortonly on calls it switches, or, when the model comes from an environment variable, marks the change "ship with the model switch".- The free scan can show a finding as a plain replacement that the licensed patch won't make, so the scan report
can overstate the size of the patch. The scan doesn't run swap's duplicate-key and duplicate-id checks, and swap
skips docs unless you pass
--include-docs. In our test on 38 public repos, 274 rows showed as plain replacements but were kept by swap (119 in one repo, 35 and 18 in two others). The freelastorders fix .(orswap .) preview uses the real plan and shows the actual per-file count. - Generated, minified and vendored files are skipped by both scan and swap. An ID still defined in a skipped generated file (such as a generated model registry) doesn't count as a kept definition, so references to it elsewhere can still be renamed. Check generated registries by hand.
Made by Burnt & Toast Studios. Not affiliated with OpenAI or Anthropic.
Metadata
Release files for lastorders 0.4.13
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| lastorders-0.4.13.tar.gz | 141.4 kB | With provenance | Details for lastorders-0.4.13.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| lastorders-0.4.13-py3-none-any.whl | Python 3 | none | any | Details for lastorders-0.4.13-py3-none-any.whl |
Total release size: 283.6 kB
Release files / lastorders-0.4.13.tar.gz
| Download URL | lastorders-0.4.13.tar.gz |
|---|---|
| Size | 141.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
08133fb652d6ac2b1f2f6c688a4555004ed793bae681125bb599064a2df03843
|
|
BLAKE2b-256 checksum How to use checksums |
839e3312c808b801ef75f75fb5a5b15ba2a8c129da29338a2b2e726c9f8eff4b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 23, 2026.
Transparency logRelease files / lastorders-0.4.13-py3-none-any.whl
| Download URL | lastorders-0.4.13-py3-none-any.whl |
|---|---|
| Size | 142.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
83640a74fb9b6ab6e7f229d6daad751a6a40161908e0d1f5ef2c7bc36175c2ad
|
|
BLAKE2b-256 checksum How to use checksums |
dccfad480738ee4cde453924edc6872b04eb2a757b9bd6f8618ae0dd2f8d0915
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 23, 2026.
Transparency logSecurity for lastorders 0.4.13
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for lastorders-0.4.13.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 23, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.