Driftline
# Driftline
See how your prompts change **before** an AI model is retired.
[](https://glama.ai/mcp/servers/AI-Driftline/driftline)

Driftline is a GitHub Action. It finds the model IDs in your code (OpenAI, Anthropic, Google, Mistral, xAI, Cohere, DeepSeek, Groq, and Amazon Bedrock, Vertex AI and Azure), checks them against the providers' published retirement dates, and runs your real prompts on both the current and the replacement model so you can see what changes before you switch.
It runs inside your own CI with your own API keys. There is no Driftline server: prompts go straight from your runner to your AI provider.
## What you get
- **Annotations** on the exact file and line of retired or retiring models (the 50 most urgent; the rest are in the report).
- **A report** in the job summary, and optionally a GitHub issue that updates itself on each run and closes itself once nothing is left to fix.
- **Drift tests (Pro):** each prompt in `.driftline/prompts.yml` runs on both models. You get a similarity score per prompt, a hard failure if a JSON answer stops parsing, and optional [checks](#checks) for what the answer must say.
Outside CI: `npx -y @aidriftline/driftline .` scans any repository once, an [MCP server](#mcp-server) lets AI coding agents look up model IDs, and every model page at [aidriftline.com/models](https://aidriftline.com/models/) has free alerts by email or to Slack, Discord or any webhook (30 days, 7 days and the day itself, plus date changes).
## Quick start
1. Copy [`examples/driftline.yml`](examples/driftline.yml) to `.github/workflows/driftline.yml`.
2. Optional, for drift tests (Pro): copy [`examples/prompts.yml`](examples/prompts.yml) to `.driftline/prompts.yml` and add your provider API keys as repository secrets.
3. Activate your Pro key once per GitHub account or organization, from inside one of its repositories:
```sh
npx @aidriftline/driftline activate <your-license-key>
```
It prints a license code (your key, a colon, then an id). Save that code as the secret `DRIFTLINE_LICENSE_KEY`: the code it prints, not the plain key. A key works on up to 3 GitHub accounts or organizations; `npx @aidriftline/driftline deactivate <code>` frees one.
## Inputs
| Input | Default | What it does |
|---|---|---|
| `path` | `.` | Directory to scan |
| `warn-days` | `90` | Models retiring within this many days count as "retires soon" (`0` turns this off) |
| `fail-on` | `retired` | Fail the job on `retired`, `at-risk`, or `never` |
| `prompts-file` | `.driftline/prompts.yml` | Prompts for drift tests (YAML or JSON). Looked up from the repository root, then from `path` |
| `license-key` | | Driftline Pro license code from `activate`; without it only the scan runs |
| `create-issue` | `false` | Open or update one issue labelled `driftline`. Model answers are never put in the issue |
| `fix-pr` | `false` | Open one pull request with the safe renames from [`fix`](#fix-the-easy-ones) and keep it up to date. Only from the default branch |
| `show-answers` | `true` | Show model answers in the job summary. In a public repository job summaries are public, so set `false` if your prompts contain private data |
| `sarif-file` | | Also write the findings as SARIF to this file, for [code scanning](#see-findings-in-github-code-scanning-sarif) |
| `registry` | `live` | `live` reads the list at aidriftline.com (falls back to the bundled copy); `bundled` never fetches |
| `github-token` | `github.token` | Needs `issues: write` when `create-issue` is on, `contents: write` and `pull-requests: write` when `fix-pr` is on |
Outputs: `findings` (model references found), `at-risk` (references to retired or soon-to-retire models) and `sarif-file` (when written).
Model IDs written the Amazon Bedrock way (`anthropic.claude-…-v1:0`, including ARNs), the Google Vertex AI way (`claude-…@20240620`, `…-maas`) or with a router prefix (`openrouter/openai/gpt-4`, `vertex_ai/…`, `azure/…`, `groq/…`) are recognized too, and Bedrock, Vertex AI and Azure get their own dates (see [Retirement data](#retirement-data)). Mentions in Markdown and text files, such as a changelog, are reported as notices but never fail the build.
Drift tests make two API calls per prompt: one to the current model, one to the replacement. A prompt without `model` is tested on the model in your code that retires first. Calls time out after two minutes and are retried once if the provider is busy. When a provider names a replacement that is itself being retired, Driftline points to the model at the end of that chain.
API keys are read from `OPENAI_API_KEY`, `ANTHROPIC_API_KEY` and `GEMINI_API_KEY` (or `GOOGLE_API_KEY`).
## How results are scored
| Result | Meaning |
|---|---|
| ✅ Same | Similarity 0.90 or higher, and every check passed |
| 🟡 Changed | Similarity 0.60–0.90; one answer says "not" (or no, never, cannot) where the other doesn't; a check the current model fails too; or the current model is already retired (or your API key can no longer use it) and the new answer needs review |
| 🔴 Broken | Similarity below 0.60; `expect: json` and the new answer is not valid JSON; or the new answer fails a check |
Text is compared with word and word-pair overlap. JSON is compared field by field. Overlap measures wording, not meaning: "is eligible" and "is not eligible" share almost every word. Driftline marks an answer that gains or loses a "not" as changed (English only), and checks let you say what must stay true.
## Checks
Add these to any prompt to test what the answer means, not only how it's worded:
```yaml
prompts:
- id: refund-reply
prompt: ...
must_include: [refund, "5 business days"] # each phrase must appear in the new answer
must_not_include: ["not eligible"] # none of these may appear
- id: invoice-json
expect: json
prompt: ...
same_fields: [status, total, customer.id] # these fields must keep the current model's value
```
Phrases ignore case and spacing. `same_fields` needs `expect: json`; use dots for nested fields. Lists can also be written one item per line (`- refund`). A check the new answer fails makes the prompt 🔴 broken. If the current model fails the same check, it isn't drift, so the prompt is 🟡 changed. In the fix pull request, ✅ reads "safe to merge" only when your prompts have checks; without them it says the wording stayed close.
## Run it locally
No install, no key:
```sh
npx @aidriftline/driftline path/to/your/repo # report
npx @aidriftline/driftline path/to/your/repo --json # same, as JSON
```
Exit code 1 means a retired model is used in code.
### See findings in GitHub code scanning (SARIF)
Add `sarif-file` and upload it; findings then show under **Security → Code scanning**, with retired models as errors, models retiring soon as warnings and other deprecations as notes:
```yaml
permissions: { contents: read, security-events: write }
steps:
- uses: actions/checkout@v4
- uses: AI-Driftline/driftline@v0
with:
sarif-file: driftline.sarif
- uses: github/codeql-action/upload-sarif@v3
if: always()
with:
sarif_file: driftline.sarif
category: driftline
```
Code scanning is free on public repositories; private ones need GitHub Code Security. Locally: `npx @aidriftline/driftline . --sarif driftline.sarif`.
### Fix the easy ones
```sh
npx @aidriftline/driftline fix --dry-run # show what would change
npx @aidriftline/driftline fix # change it
```
`fix` replaces a retired or retiring model ID with its replacement only where Driftline's migration rules say a new name is the whole change, and keeps what's around it (`openai/gpt-4-0613` → `openai/gpt-4.1`). It leaves everything else alone and lists it with the reason: request or API changes, a provider that names two replacements, Bedrock and Azure IDs, models under review, and documentation files. A rename keeps the call working, but answers can still change, so test your prompts on the new model before you ship.
To get the same changes as a pull request from CI, turn on `fix-pr` in a scheduled workflow:
```yaml
on:
schedule: [{ cron: "0 6 * * 1" }] # every Monday
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
driftline:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: AI-Driftline/driftline@v0
with:
fix-pr: true
fail-on: never
```
Driftline keeps one pull request on the branch `driftline/model-updates`: later runs rebuild it from the default branch and update it, and it is closed once nothing is left to rename. Its description lists every change, and a checklist of the lines a rename can't fix, with what to change and the provider's guide (ticks are kept when the pull request is updated). With a Pro license and a prompt file, it also shows your prompts tested on the replacement, with a verdict: safe to merge, read first, or don't merge yet. [See an example](https://aidriftline.com/#pr). Also turn on **Settings → Actions → General → Allow GitHub Actions to create and approve pull requests** (in an organization, turn it on in the organization's settings first). Pull requests opened with the default token don't start your other workflows; pass a personal access token as `github-token` if your checks should run on it.
## For AI coding agents
If you are an agent (Claude Code, Cursor, Copilot, Codex…) changing code that calls OpenAI, Anthropic or Google: run `npx -y @aidriftline/driftline . --json` before you pick or keep a model ID, and do not introduce an ID whose `status` is `retired` or `at-risk`. Without a shell, look the ID up in [`registry/models.json`](registry/models.json) or at `https://aidriftline.com/models/<model-id>/`. More, including a snippet for `AGENTS.md` / `CLAUDE.md`: [aidriftline.com/agents](https://aidriftline.com/agents/).
### MCP server
Driftline also runs as an [MCP](https://modelcontextprotocol.io) server, so your agent can ask it directly. Tools: `check_models` (status, date and replacement for a list of IDs), `scan_project` (retired and retiring IDs in a folder, with file and line) and `upcoming_retirements` (what retires in the next N days). It reads the daily-updated list from aidriftline.com and falls back to the copy in the package when offline.
[](https://cursor.com/en/install-mcp?name=driftline&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBhaWRyaWZ0bGluZS9kcmlmdGxpbmUiLCJtY3AiXX0%3D)
[](https://insiders.vscode.dev/redirect?url=vscode%3Amcp%2Finstall%3F%257B%2522name%2522%253A%2522driftline%2522%252C%2522command%2522%253A%2522npx%2522%252C%2522args%2522%253A%255B%2522-y%2522%252C%2522%2540aidriftline%252Fdriftline%2522%252C%2522mcp%2522%255D%257D)
Claude Code:
```sh
claude mcp add driftline -- npx -y @aidriftline/driftline mcp
```
Cursor, Windsurf, Claude Desktop and other clients (`mcp.json` / `claude_desktop_config.json`):
```json
{
"mcpServers": {
"driftline": { "command": "npx", "args": ["-y", "@aidriftline/driftline", "mcp"] }
}
}
```
Needs Node 20+. Free, no key.
## Retirement data
[`registry/models.json`](registry/models.json) comes from the official pages ([OpenAI](https://developers.openai.com/api/docs/deprecations), [Anthropic](https://platform.claude.com/docs/en/about-claude/model-deprecations), [Google](https://ai.google.dev/gemini-api/docs/deprecations)) and is kept in line with them automatically:
- A script compares every entry with those pages every 6 hours (date, replacement, new models on a page).
- An AI check runs daily, and right away when the script finds a difference. It follows written rules ([`docs/registry-rules.md`](docs/registry-rules.md)), and its changes ship only after they pass the same script and the test suite.
- Until a difference is fixed, the affected models are marked "under review" in reports, MCP answers and model pages, and alerts for them wait, so nobody gets a wrong date.
- You can see it working: [aidriftline.com/status](https://aidriftline.com/status/) shows when each of the 11 sources was last read, whether it matches, what changed recently and what is under review ([status.json](https://aidriftline.com/status.json) for scripts).
Each entry records the date it was last checked. Google publishes only the *earliest* possible shutdown date, so Driftline reports those models as "may stop working" rather than "retired". Anthropic's "not sooner than" dates are informational and never trigger a warning. Audio, image, video and embedding models are scanned and reported too, but only text models are drift-tested. Some Google models are not shut down but *routed*: after the date, requests to the old ID are answered by the replacement model (`routes: true` in the registry). Driftline flags those too, because the call keeps working while the answers change.
Google Vertex AI also sets its own dates, and it uses the Gemini API's model names: `gemini-2.5-pro` was retired on Vertex on 20 October 2026 but keeps answering on the Gemini API until 1 December, when Google routes it to a newer model. In files that show they run on Vertex (`vertexai=True`, `vertexai` / `google.cloud.aiplatform` imports, `@google-cloud/vertexai`, `AnthropicVertex`, `vertex_ai/` model names), Driftline uses Vertex's dates from [Google's own pages](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/model-versions); elsewhere it uses the Gemini API's and adds a note when Vertex's differs. Claude's Vertex spelling (`claude-3-5-sonnet-v2@20241022`) and Vertex's open models (`…-maas`) are always read as Vertex.
Mistral, xAI, Cohere and Groq dates are read by script from each provider's own deprecation page every 6 hours; DeepSeek, which only announces changes in its news, is kept by the daily check. xAI and DeepSeek often redirect a retired model name to a newer model instead of refusing calls; reports say so. IDs that could mean something else (Groq's `qwen/qwen3-32b` is also an OpenRouter name, Cohere has a model called `command`) count only in files that call that provider (`groq` / `cohere` imports, `GROQ_API_KEY`, `api.groq.com`, …).
Microsoft Azure (Azure OpenAI and other Foundry models) sets its own date for each model version, and it differs from OpenAI's in both directions: `o3` retires on Azure on 19 November 2026, three weeks before OpenAI's 11 December; `gpt-5` on Azure lasts until 9 February 2027. In files that show they call Azure (`AzureOpenAI`, `azure_endpoint`, `openai.azure.com`, `AZURE_OPENAI_…`, `azure/` model names, Bicep or Terraform deployments), Driftline uses [Azure's schedule](https://learn.microsoft.com/en-us/azure/foundry/openai/concepts/model-retirement-schedule) and reads the model version from deployment templates (`version: '2024-08-06'`, never `api_version`). Without a visible version it shows the earliest version's date and lists the others. Azure plans an end date for every model, so current ones are flagged only in the last 90 days.
Amazon Bedrock sets its own dates, per model and per region, and they often differ from the model maker's (Claude Opus 4.1 left Anthropic's API on 5 August 2026 but runs on Bedrock until 8 January 2027). Bedrock model IDs such as `us.anthropic.claude-opus-4-1-20250805-v1:0` or `meta.llama3-70b-instruct-v1:0` are checked against [Bedrock's own page](https://docs.aws.amazon.com/bedrock/latest/userguide/model-lifecycle-legacy.html), read by script every 6 hours. Reports show the earliest region's date, how the other regions differ, and when "extended access" (possibly higher prices) starts.
Every model also has its own page with the date, replacement and source: [aidriftline.com/models](https://aidriftline.com/models/).
## Versions
Releases are numbered `0.x.y`. A new `x` means new features; a new `y` means fixes or updated retirement data, which can ship several times a week. `uses: AI-Driftline/driftline@v0` always runs the newest release, and the Action reads the live retirement list at aidriftline.com either way, so a provider's change reaches you without a new version.
## Development
```sh
npm test
```
No dependencies. Node 20 or later.
## License
[Elastic License 2.0](LICENSE). You can use Driftline for free in your own CI. You may not offer it as a hosted service, or remove or work around the Pro license-key check.
TDQS
Scored across 3 tools
Each tool targets a clearly distinct input axis: check_models takes known IDs, scan_project takes a filesystem path, and upcoming_retirements takes a time window. The descriptions explicitly state the boundaries and cross-reference the sibling tools ('for IDs you already know use check_models'), leaving almost no room for misselection.
All three names use consistent snake_case and namespace themselves around the same model-retirement domain. The only deviation is that check_models and scan_project are verb_noun while upcoming_retirements is a noun phrase with no verb, a minor break from the pattern.
Three tools is tightly scoped to a narrow domain (model deprecation tracking) and each covers one non-overlapping query mode rather than fragmenting it. Nothing feels padded or redundant, and no obvious operation is missing that would justify a fourth tool.
The surface covers the core lifecycle: look up specific IDs, audit a codebase, and plan against upcoming dates, all read-only and consistent with the stated purpose. Minor gaps remain, such as listing all models for a given provider or batch-checking multiple project paths in one call, but agents can work around these with the existing tools.