Michael Feathers defines legacy code bluntly as code without tests, and his rule of thumb is that behavior is the thing users depend on: add it and they are happy, change it by accident and they stop trusting you (BSSw). A model API dependency has the same property. Nobody signs up for your request builder or your chunk parser, but the moment a provider renames a field or changes the error body, the wrapper you built becomes legacy code in the Feathers sense: untested behavior that other code trusts.
The useful image here is a seam. In Fowler's account of the Strangler Fig, teams move behavior out of an old system piece by piece, and that only works because they first find the seams where a component can be split off (martinfowler.com). Microsoft's architecture guide describes the same mechanics with a facade in front of the old backend that routes traffic while components migrate (Microsoft Learn). Applied to an inference dependency, the facade is the seam: one small module that owns the request shape and the response shape, and nothing else.
Branch by Abstraction gives you the operational version of that idea. You introduce an abstraction over the part you need to change, move callers onto it, and can then add a new implementation underneath while the rest of the code keeps compiling and shipping (continuousdelivery.com). Harness summarizes the same five steps and notes the payoff: both implementations coexist, so you can switch between them without a merge event (Harness). That is exactly the property you want when a provider announces a deprecation or when you begin dating a second provider.
Contract testing is what makes the seam trustworthy. An API contract is the formal agreement covering endpoints, methods, request bodies, response bodies, status codes, headers and error representation, and contract testing verifies on every change that both sides still honor it (Total Shift Left). The stats in that same write-up are worth internalizing: the World Quality Report cited there found 71% of organizations run more than 100 internal APIs, and DORA data cited by the same author puts elite performers at 2.6 times more likely to practice systematic contract testing than low performers (Total Shift Left). Whether or not you trust the exact figures, the direction is not controversial.
The decision rule at this point in the article is simple. If you call one model provider from one place, a thin adapter plus a handful of shape assertions costs an afternoon and buys you every future provider swap. If you call three providers from five places with no adapter, contract tests are not your first move; extracting the adapter is.



