Opinion

Why Claude should stay replaceable

Anthropic, the company behind Claude, has started the process of going public. If the listing is completed, its shares will trade on Nasdaq and the company will have to publish regular financial and operational disclosures. The timing, number of shares and initial price have not been finalised.

The listing does not change Claude by itself. It does underline that every AI model sits behind a business that can change its prices, usage limits or available models. As a developer, I am therefore interested in what happens to an application built on Claude if it later needs to switch AI providers.

I put an interface between the application and the provider. Claude, OpenAI, Gemini or a locally hosted model can sit behind it. LangChain is an obvious tool for this because it offers a common model interface, but the principle matters more than the library.

Own the interface, not another dependency

Provider independence does not mean scattering each provider's SDK across the codebase and hoping an environment variable will take care of the rest. The application should describe its own jobs, such as extractEvent(), classifyTicket() or draftReply(). An adapter behind that boundary translates each job into the provider's format.

LangChain can be a good foundation. It is an open-source Python library, with JavaScript and TypeScript support as well. In a Python backend, the same init_chat_model() function can create a Claude or OpenAI model depending on its configuration:

python
from langchain.chat_models import init_chat_model

model = init_chat_model("anthropic:claude-sonnet-4-5")
answer = model.invoke(prompt)

Changing provider then starts with the model configuration and API key rather than a rewrite of the business logic. I would still put LangChain behind my own application interface. If I later want to replace the library itself, I should not have to pull the same dependency back out of every piece of business logic.

I would not hand these responsibilities to the provider:

  • the internal schema for business data;
  • validation and authorization decisions;
  • cost and usage limits;
  • logs and evaluation results;
  • error handling and fallback rules.

That keeps an Anthropic Message object or an OpenAI response type from travelling through the whole system. The provider adapter returns a small, validated type that the rest of the application owns.

A model swap is not a switch

This is where the abstraction can promise too much. Once the interface exists, changing from Claude to another model may technically take one environment variable. It does not follow that the result will be equivalent.

Providers handle system prompts, tool calls, structured output, images, streaming and token limits differently. The same prompt can be longer, less accurate or simply sound different on another model. LangChain's own provider documentation uses feature tables because support still varies by integration. A common method name does not erase those differences.

Real replaceability needs three things:

  1. Application-owned input and output schemas with no provider-specific objects.
  2. An evaluation set made from real examples and run against every candidate model.
  3. Explicit acceptance thresholds for accuracy, latency and cost per request.

Without those, I have a neat abstraction but no evidence that the other model works behind it. That is only better-organised vendor lock-in.

Not every project needs two live providers

I would not pay for and operate two providers just to draw a backup arrow on an architecture diagram. For a small internal tool, a clean adapter boundary, versioned prompts and evaluation cases, plus an occasional test run against a second provider may be enough.

A feature whose failure stops orders, support work or publishing needs a working fallback. The fallback can also be a path that skips AI and lets a person fill the field manually. Provider independence does not mean another model must answer at any cost. It means one external API does not get to decide whether my application still works.

I use Claude myself, and it has worked well for me. I still check from time to time whether it remains a replaceable component or has quietly become the system's foundation.

Need a hand?

If you want an LLM inside an existing PHP or Python system without letting one provider dictate the architecture, that is the AI integration work I do. Tell me what you're building.


Sources