Back home

After the open source model is restricted, the first thing that needs to be independent is the model neutral layer.

It doesn't matter if the model can be changed. What's really troublesome is the default behavior that is hard-coded in the code.

Once an open source model begins to be restricted, the first thing exposed is often not the download entry, but the default assumptions in the code. The model name has been changed, but the interface is still there, but the business process is no longer in sync with the old behavior: output format, function call sequence, rejection tone, context length, sampling parameters, any one of them can be viewed individually, but stacking them together will drag the entire link.

This kind of problem is usually difficult to be regarded as an architectural problem. During the development stage, I only saw “can run”. After going online, I discovered that the model selection had already been written into the business logic. Some fields only adapt to one return format, some retries only recognize one rejection method, and some exception fallback defaults to the original model to give a longer explanation. Once the restrictions were imposed, all these hidden piles were exposed.

The default behavior will tie the model to the business

In the access stage, the model is often regarded as adding an SDK, connecting an API, and adding a prompt word. After being connected, the most difficult thing to clean up is not the call itself, but the branches that have grown around the default behavior. Whether the output should be strictly JSON, whether the tool call should be tried again after failure, where to truncate overlong input, and which layer to place risk control prompts on. These issues often fall into the business code.

Once an open source model is restricted or removed from the shelves, or the local image and the upstream version begin to fork, these default behaviors are no longer reliable. On the surface, it is just changing the model, but underneath it is necessary to change the parsing, monitoring, rollback and testing at the same time. The most difficult part is not to write a few more lines of adaptation, but that the original set of assumptions is not explicitly marked from beginning to end.

The role of the neutral layer is to spread out the implicit assumptions

Model-neutral layers are not abstract for the sake of abstraction. Its function is very simple: put prompt words, schema verification, routing, retry, downgrade, logs and evaluation in one place, so that model differences first pass through the same set of boundaries. In this way, even if the model is replaced by cloud, open source, local inference or other providers, the business will still see a unified input and output contract.

Once this layer is established, many things that were originally unclear will suddenly become clear. Which fields are required values, which fields are just model preferences, which failures can be retried, which failures must be rolled back, which contexts will be truncated, and which indicators can really be compared will all change from “remembered by experience” to “restricted by interfaces.” The impact caused by the limited model is no longer directly entered into the business code, but first into the neutral layer.

Not all scenes are worthy of this layer

Some scenes don’t need the layers to be so thick at all. One-time summaries, temporary generation, internal experiments, and completely single-model locked tool chains, it is enough to connect the model in these places. Building a complete neutral layer for a short-lived process will only overdraw the cost in advance.

This layer is needed where the model will really participate in business judgment. Such as extraction, routing, tool execution, customer service response, review assistance, and batch rewriting. In these scenarios, the model is not a toy, but a part of the process. As long as the model may change, or external constraints may destabilize a certain entrance, the neutral layer is not decoration but a wall that keeps change within the boundaries.

What really forces the open source model to be restricted is not the alternative of a specific supplier, but whether the team treats “model differences” as first-class citizens. The earlier the default behavior in the code is spread out, the less passive it will be when changing models later. The model can change, but the boundaries cannot follow.