Your Swiss full-service IT partner. Automation & AI, consulting, software, cloud and security – we advise, build and operate. All from one team.

Follow us

Blog

Straight talk from practice: automation, AI, cloud and IT strategy

Author

gridz editorial team

Published on

Teilen:LinkedInXE-Mail
Featured image for Avoiding lock-in in your AI stack: abstraction, exit costs and a multi-model strategy

Avoiding lock-in in your AI stack: abstraction, exit costs and a multi-model strategy

Betting an entire enterprise AI stack on a single model provider made sense in 2023. In 2026 it is an unnecessary mistake: the model layer is the fastest-moving, most commoditised and most easily replaced part of the stack – and building as though it were permanent quietly hands your roadmap to a vendor.

Three years ago there was effectively one frontier model worth building on, so coupling tightly to it was reasonable. That world is gone. Today there are several providers with comparable capability, prices fall every few months, and the best model for a given task changes from quarter to quarter. Yet most enterprise AI codebases are still written as though their provider were a fixed quantity – vendor-specific SDKs threaded through the business logic, prompts tuned to one model’s quirks, and no way to evaluate an alternative without a rewrite.

This is not a hypothetical risk. We have migrated organisations off models that were deprecated, repriced or simply overtaken by the competition – and the cost of that migration was determined entirely by how the stack had been built beforehand.

The real problem: the most replaceable layer is wired in as though it were permanent

Think of the AI stack in layers: your data and retrieval, your business logic and workflows, your evaluation harness – and at the bottom, the model. The model is the layer that changes fastest and differentiates you least. It is also the one teams couple to most tightly: vendor-specific calls, assumptions about response formats and prompt quirks scattered across the whole application.

The result is an inversion of good architecture: your most durable assets (data, workflows, evals) depend on your least durable component (a particular model version) – in a way that makes the durable parts hostage to the volatile one. When the model changes – and it will – the blast radius is your entire application instead of a single layer.

A framework: isolate the model behind a boundary of your own

The fix is classic software engineering applied to a layer teams treat as special: put an abstraction between your application and the model provider, so that the provider becomes a swappable implementation detail rather than a structural dependency. Concretely:

  1. An internal interface for model calls. Your application talks to your own “completion”, “extraction” or “classification” interface, never directly to a vendor SDK. Vendor specifics live behind that boundary, in a single place you can change.
  2. Normalise inputs and outputs. Define your own request and response structures. Adapters translate to and from each provider. Your business logic never sees a provider’s raw format – so a format change is an adapter change, not an application change.
  3. Treat prompts as versioned assets, not inline strings. Store prompts so they can be tuned and swapped per model, because the same prompt rarely behaves identically across providers.
  4. Make the evaluation harness provider-agnostic. The harness that proves quality is exactly what lets you test a new model in an afternoon. It has to run against any provider through the same interface.

None of this is free – an abstraction is real code that has to be maintained. The goal is therefore the minimal boundary that makes the model swappable, not a sprawling framework supporting every conceivable vendor feature. Abstract the 90% you use in common; allow a documented exception for the rare vendor-specific feature you genuinely need.

The multi-model dividend

Once the model is swappable, three advantages follow that single-provider organisations do not have:

  • Task-appropriate routing. Different models are better and cheaper at different tasks; route each workload to the most suitable model instead of forcing one model to do everything.
  • Negotiating power and resilience. A credible ability to switch changes your commercial position, and a provider outage or deprecation becomes a configuration change rather than a crisis.
  • Adopt improvements immediately. When a better or cheaper model appears, you test it against your evals and adopt it within days – benefiting from the falling price curve instead of being stuck on last year’s model.

A worked example: one forced migration, two trajectories

Two organisations we worked with had to migrate off a model their provider was deprecating within a few months.

Company A had vendor SDK calls and response-format assumptions spread across roughly 40 code paths, inline prompts tuned to that model, and no eval set. The migration became a project of around 14 weeks: find every call site, rewrite it, retune prompts by trial and error, and regression-test by hand – with no ground truth. High risk, high cost, uncertain quality at the end.

Company B had a model boundary and a provider-agnostic evaluation harness. Its migration: implement a new adapter, run the eval set across three candidate models, pick the best one, retune two prompts behind the interface. About four days – with evidence that the new model matched or beat the old one. The same external event, two completely different outcomes – decided entirely by an architecture decision taken long before the deprecation.

Company B even turned the forced migration into an upgrade, because the evaluation harness let it pick, with confidence, a model that was both cheaper and slightly better. The same abstraction that protected it from the downside also collected the upside.

Lock-in hides above and below the model too

Cleaning up the model layer is the obvious win, but the same trap exists on two further layers that teams overlook. Below the model, your vector database and your choice of embedding model can be just as sticky: embeddings are model-specific – so changing embedding model means re-embedding your entire corpus – and some managed vector stores make exporting your vectors deliberately awkward. Above the model, the agent or orchestration framework you adopt can bind your business logic so tightly to one vendor’s abstractions that “changing model” is easy but “changing framework” requires rewriting your workflows. A multi-model strategy that ignores this solves only the most visible third of the problem.

The principle generalises: identify every layer of the AI stack where a provider’s format becomes load-bearing in your application, and draw a boundary there. For the vector store, keep your source documents and your chunking pipeline so that you can re-embed without data loss and re-index into a different store. For orchestration, keep the actual business logic in your own code and use the framework as a thin convenience layer, not as the place where your workflows live. The test is the same on every layer: if this provider doubles its prices or shuts down tomorrow – is switching a configuration change, a project or a rewrite? Anywhere the answer is “rewrite”, you have an undiagnosed lock-in.

None of this means forgoing managed services – building everything yourself to avoid lock-in is its own expensive mistake, and usually the wrong call under build vs buy logic. It means using managed services behind boundaries you control, so that the convenience is real and the dependency is dissolvable. The goal is not vendor independence as ideology, but keeping the cost of changing your mind low in the parts of the stack that move fastest. In 2026 the whole AI stack moves quickly, which is why those boundaries are worth more than they would be with a stable technology – the option to switch is a real, valuable asset, including in the quarters when you do not exercise it.

Pitfalls

  • Over-abstraction. A boundary so generic that it supports every vendor feature is its own lock-in – to your framework. Abstract the normal case and make exceptions for the rest.
  • Abstraction without evals. Swappability only helps if you can prove that a switch preserves quality. The evaluation harness is the other half of the strategy.
  • Prompts coupled to one model. Treating prompts as permanent inline strings reintroduces the lock-in above the boundary.
  • Premature multi-model complexity. You do not have to run five models from day one. You need the architecture that lets you, as soon as it is worth doing.
  • Ignoring lock-in at the data layer. The model is the most easily replaced layer, but check your vector store and your data contracts for the same trap.

Decision checklist

  1. Does our application call providers directly, or through a single internal interface?
  2. Are request and response structures normalised, so that the business logic is provider-agnostic?
  3. Are prompts versioned, swappable assets rather than inline strings?
  4. Can our evaluation harness run against any provider through the same interface?
  5. How long would a forced model migration cost us today – days or a quarter?
  6. Do we route tasks to the most suitable model in each case, or force one to do everything?
  7. Have we checked the data layer for the same lock-in we fixed at the model layer?

The gridz view

The model layer is the component in your AI stack that loses value fastest, and coupling tightly to it inverts good architecture – it makes your durable assets hostage to your most volatile component. A thin model boundary plus a provider-agnostic evaluation harness turns a forced migration from a quarter-long crisis into a four-day upgrade – and a falling price curve from something you watch into something you benefit from. We design enterprise AI architectures so that the model is a swappable detail rather than a structural bet – because in 2026 the only safe assumption about the best model is that it will change. If you want to know how fast you could switch today, talk to us.

discussion

Comments

  1. Loading comments …

Comments are briefly reviewed before publication. Details in our privacy policy.