Writing archive

Architecture

Eighty-Seven Hardcoded Model Names Is Self-Inflicted Lock-In

Architecture diagrams often describe replaceable components that remain entangled in code. A more demanding audit measures how many contracts, callers, and tests must change when a model, data source, or business domain is removed. In one platform, callers had learned 87 direct model references. No vendor required that coupling.

April 20266 min
architectureAI gatewaygovernancemodel routing
A layered enterprise AI stack annotated with the cost of replacing each layer

Hardcoding creates self-inflicted lock-in

One platform audit found 87 direct model references across application code. No vendor required that coupling. Callers had learned provider names, parameter conventions, and response shapes, so replacing a model meant editing product logic rather than changing policy.

A gateway only becomes a seam when callers express task intent and the gateway owns provider selection, normalization, telemetry, and failure policy. Wrapping vendor calls without removing vendor knowledge from callers preserves the lock-in behind a new endpoint. The old model name will still appear in a search. It will appear in two places.

Replacement tests reveal the real boundary

A model seam can be tested by routing a representative task to a second provider without editing the caller. A data seam can be tested by changing the source adapter while preserving the semantic contract. A domain seam can be tested by removing domain modules and booting the remaining chassis.

Large deletion counts do not prove value by themselves. The relevant evidence is what still works after the deletion, which contracts remained stable, and how much repair was required. A large deletion is a cleanup story. A chassis that still boots and an eval that still passes is an architecture story.

Composability needs governance

Replaceable components can widen risk if every caller selects any provider or data source. Policy must constrain eligible routes, data classifications, tool groups, and fallback behavior. The seam creates optionality. Governance decides which options are permitted.

This is especially important during outages. A fallback that preserves availability while violating a privacy boundary is not resilience. It is an undeclared policy change, made at the worst possible time.

Keep a replacement ledger

For each strategic dependency, record its contract, known callers, alternative implementation, last replacement test, and maximum tolerated migration effort. The ledger turns a slogan about avoiding lock-in into a set of inspectable claims.

The strongest indicator is time-to-replacement for a real workload. If a second implementation cannot pass the same acceptance suite without caller edits, the architecture remains coupled regardless of how modular the diagram appears. The boxes can be drawn however one likes. The search for hardcoded names is the architecture.