QUAL017infoPro

hardcoded-model-id

Hardcoded AI model IDs go stale when models are retired

Applies to: JavaScript, Python, TypeScript

Why this matters

AI model IDs like 'gpt-4o' or 'claude-3-opus' change frequently. When they're hardcoded across multiple files, upgrading requires a tedious find-and-replace that invariably misses call sites. Centralize model IDs in a config constant with an env var override.

Catch it before it ships

pip install stablestack # or: npx stablestackstablestack # scans your project, QUAL017 includedstablestack explain QUAL017

QUAL017 is part of the Pro rule set. See pricing — the free tier ships 24 checks with no signup.

False positive in your codebase? Suppress a single line with # noqa: QUAL017