A document or ticket pipeline built on a language model can pass every demo and still never ship, because production asks for what a demo does not: a labelled set to accept it against, a data path that stays inside your infrastructure, a place for the wrong answer, and an owner after launch. This is what each gap looks like, what closes it, and how to tell which engineering firms actually ship this work inside your own perimeter.
The pilot worked. On a set of hand-picked documents, the model pulled out the fields, sorted the tickets and convinced the people who asked for it. Months later it still runs in a sandbox on sample data, and nobody can say what it would take to switch it on for the real queue.
That gap is not closed by swapping the model. A demo answers whether a model can read a document. Production asks what happens to every document, including the scanned one, the forwarded thread and the one the model gets wrong, on data that may never have been allowed to reach the service the pilot used.
The short answer is structural. Before changing the model, build four things the pilot skipped: an acceptance set drawn from real traffic and scored per field, a data path where weights, indexes, logs and evaluation data all stay inside your infrastructure, validators and a review queue for outputs that fail, and an operating owner with capacity, a fallback and monitoring. What amBrain can substantiate publicly about its own LLM work, in full: We have taken an LLM integration to production inside a client's FinTech perimeter: extracting and normalising unstructured broker and venue notices — corporate actions, instrument and margin changes — into structured records the trading system consumes. The client is not named, this article is not a case study of that project, and no number below is measured on a system of ours.
In 2015, Sculley and colleagues at Google wrote that only a small fraction of real-world machine learning systems is composed of the machine learning code, and that the required surrounding infrastructure is vast and complex. A language model pipeline has the same shape, and a pilot built from the small part alone has nothing around it to run in production.
Put what the pilot had next to what the production queue needs, and the missing work becomes a list:
The first missing artefact is a labelled set of real documents with the answer each one should produce. Without it, every change of prompt or model is judged by whoever reads the output that day, and the pilot cannot pass a gate that was never written down.
Google's Rules of Machine Learning put measurement before the model: Rule #2 is first, design and implement metrics. For extraction and ticket routing, the metric is not one score for the whole document:
When the pilot was built on a hosted model with samples, synthetic data or documents someone cleared by hand, and the real data may not reach an external provider, the pilot's result does not transfer: the model inside may be a different model, or the same open-weight model with different quantisation and serving settings, and either way its quality has to be measured again on the acceptance set.
The model is the obvious component to bring inside. It is not the only one, because a language model pipeline copies the data into more places than the model call:
Masking helps where logs have to leave a restricted zone. Presidio, an open-source framework started at Microsoft, detects and anonymises personal data in text, and its documentation states that, because detection is automated, there is no guarantee it will find all sensitive information. Masking narrows the exposure; it does not replace keeping the data inside.
A pilot receives documents; production receives whatever senders produce. Before any model call, the pipeline has to turn that into text it can point back to:
Long inputs need their own care. In Lost in the Middle, published in TACL in 2024, Liu and colleagues showed that, for the models they tested, performance is often highest when the relevant information sits at the beginning or end of the input context, and degrades significantly when it sits in the middle of a long context. Splitting a long document by section, with the source kept on every chunk, is a safer default than assuming the model reads the whole context evenly, and the acceptance set shows which holds for your documents.
Constrained decoding restricts the model to JSON that matches a schema: vLLM supports it as structured outputs, and llama.cpp through grammars. It fixes the shape of the record, within the schema features the backend supports and as long as generation is not cut off by the token limit, but not its truth: a well-formed record can still carry the wrong date.
Truth is checked after the model, by code the business already trusts:
The model's own confidence is a weak gate. OpenAI's GPT-4 Technical Report, published in 2023, shows that on a multiple-choice benchmark the pre-trained model was highly calibrated and that post-training reduced calibration. A self-reported certainty or a token probability is a signal to test against the acceptance set, not a threshold to trust by default.
A record that fails any check goes to a review queue, not to the downstream system. The queue is a product in its own right: it needs an owner, a capacity plan in reviewer hours, the source span shown next to each field, and corrections that flow back into the acceptance set.
A support ticket is text written by someone outside the company, and a document can carry instructions its sender placed on purpose. The OWASP Top 10 for LLM Applications 2025 lists prompt injection first, including indirect injection, where the instructions arrive inside external content the model processes, such as a website or a file.
Three entries of the same list translate into design rules for a document pipeline:
OWASP also notes that it is unclear whether fool-proof prevention of prompt injection exists. The output checks and the privilege limit carry the weight, not the wording of the prompt.
A pipeline's behaviour is the product of several artefacts that change independently. Treat them as one release, and store its identifier on every record it produces:
Pinning does not make outputs identical. Thinking Machines Lab showed in September 2025 that an inference server can return different completions for the same prompt at temperature zero, because the result of a request depends on how many other requests share its batch; the same post shows that batch-invariant kernels remove this at a cost in speed. Unless the server runs such kernels, reproducibility means re-running the acceptance set on every release and comparing scores, not expecting identical text.
Capacity is planned in tokens, not documents. Measure the distribution of input and output length on real traffic, because one long attachment can cost as much as many short tickets, and generation time grows with the length of the output.
Serving systems batch requests to keep the accelerator busy. In the vLLM paper, presented at SOSP 2023, Kwon and colleagues reported that paging the attention key-value cache improved throughput by 2 to 4 times at the same level of latency compared with the systems they evaluated. Larger batches raise throughput and also raise the latency of each request, which a back-office queue can absorb and an interactive step cannot, so the two are separated:
The fallback is what makes switching the pipeline on reversible. The manual process that exists today stays the floor, and the pipeline takes work off it field by field rather than replacing it on a single date.
Server dashboards say whether the pipeline answered. They do not say whether the answers were right, and a model that degrades on a new template keeps its latency. Monitoring an extraction or ticket pipeline covers both:
NIST's Generative AI Profile, NIST AI 600-1, published in July 2024, organises this work under the four functions of its AI Risk Management Framework: govern, map, measure and manage. The names matter less than the consequence: measuring after launch is a named and staffed activity, not something the pilot team does when it has time.
Switching the pipeline on for everything on one date couples every risk into one event. A staged rollout keeps them apart:
A pilot that reads documents well and still never reaches production has not failed at reading. It was never given an acceptance set to pass, a data path it was allowed to use, a place for its wrong answers or an owner for the day after launch.
The question behind this article, who can put an LLM pipeline inside your own infrastructure and actually ship it, has a test that needs no vendor list. A firm that does this work asks about acceptance and operations before it recommends a model:
Each item is something you can ask about in the first conversation, and a vague answer means the pilot's missing work has not been scoped yet.
So the first question is not which model to run inside your perimeter. It is which fields, on which documents, you would accept automated, measured against what, and who picks up the records that fail validation.
What amBrain can substantiate publicly beyond the production integration described in the summary above: amBrain has been building software since 2019. We work in three formats: full delivery, a dedicated team, or engineers embedded in your team.
Bring your current architecture and the failure mode that worries you, and we will go through it together in half an hour.