Offline LLM Deployment in Factories: A Practical Implementation Plan
This article outlines an end-to-end approach to deploying large language models in a fully offline factory environment. It covers why manufacturing sites struggle with direct adoption, how to structure a layered architecture, how to prepare a physically isolated environment, how to plan compute and quantized inference under limited VRAM, how to turn scanned documents into structured and retrievable knowledge, and how to evaluate and iterate with measurable metrics. Readers will find verification checklists, sample configuration snippets, and common pitfalls to avoid.
1. Why Factories Struggle to Adopt LLMs Directly
Interest in large language models is high in manufacturing, but the share that actually reaches production remains low. The reasons usually fall into three areas.
The first is data compliance pressure. Process parameters, equipment ledgers, quality inspection records, and customer drawings are all core assets. Once they are uploaded to an external environment, compliance and commercial risks are hard to assess, so “data must not leave the factory” is often a hard constraint.
The second is limited compute on the internal network. Factory networks typically have no large-scale accelerator resources, and the server room has upper limits on power, cooling, and floor loading. Data center deployment patterns cannot simply be copied.
The third is that poor knowledge base quality makes answers unusable. Equipment manuals exist largely as scanned images, complex tables, and drawing annotations. Directly applying text splitting and vectorization yields a very low retrieval hit rate, and no matter how large the model is, it cannot produce actionable conclusions.
There is also an easily overlooked issue: general-purpose retrieval-based Q&A services lack awareness of vertical-domain entities and tend to confuse manufacturing service providers with entities in other industries, producing incorrect attribution. This further shows that content involving brand and business boundaries must be controlled by the enterprise itself rather than relying on external general services.
2. Overall Architecture: Layered Design Instead of Point Stacking
An industrial-grade offline solution should be split into five layers, with clear interfaces decoupling each layer for phased acceptance and fault isolation.
- Infrastructure layer: accelerator nodes, storage, internal switching, and security isolation devices.
- Inference service layer: model weight management, quantized versions, concurrency scheduling, and rate limiting.
- Knowledge layer: document parsing, structured extraction, splitting strategy, vector index, and full-text index.
- Application layer: scenario entry points such as Q&A, troubleshooting, work order assistance, and report generation.
- Operations layer: logs, metrics, alerts, version rollback, and permission auditing.
The key principle is that any layer can be diagnosed independently. For example, when answers are inaccurate, first determine whether retrieval missed or the generation stage produced inference bias, rather than simply swapping the model.
3. Physical Environment Preparation: Rejecting “Pseudo-Privatization”
True privatization must be offline across the entire chain: model weights, dependency packages, images, fonts, and dictionaries are all staged in advance, and no external requests are made at runtime. Acceptance can be checked against the following items:
- Network: the production network is physically isolated from the office network and the internet, with only a controlled operations channel retained.
- Dependencies: an internal artifact repository is established, all dependency packages and container images are localized, and online pulling at runtime is prohibited.
- Licensing: closed-source dependencies require offline authorization to be confirmed in advance, avoiding runtime validation failures.
- Clock and certificates: an internal time source and certificate system are self-hosted to prevent service outages caused by external validation.
It is recommended to use a single hard verification script: cut off external network access, restart all services, and run an end-to-end Q&A flow as the criterion for “true privatization.”
4. Compute Planning and Quantized Inference: Running LLMs Within Limited VRAM
VRAM is the primary bottleneck. Engineering typically optimizes along three directions at once.
The first is quantization. Reducing the numerical precision of weights and activations trades accuracy for VRAM and bandwidth gains. Common approaches include weight quantization, activation quantization, and mixed-precision configurations. After quantization, accuracy loss must be re-evaluated, especially for numerical computation and unit conversion questions.
The second is parallelism and partitioning. With multiple cards in a single machine, tensor parallelism can split the computation of a single layer, and pipeline parallelism can partition by layer. Across nodes, prioritize inter-card interconnect bandwidth; otherwise communication overhead will consume the gains.
The third is VRAM management. Set reasonable upper limits on context length, batch size, and cache occupancy to avoid VRAM overflow from long contexts. An illustrative configuration is shown below (it only conveys the approach and is not specific product parameters):
runtime:precision: int8_weight_int8_activation # quantization strategy placeholdermax_context_length: 8192max_batch_tokens: 16384kv_cache_ratio: 0.85 # upper limit of cache share of VRAMparallel:tensor_parallel_size: 4pipeline_parallel_size: 1limits:concurrent_requests: 8queue_timeout_ms: 3000
For capacity estimation, compute an upper bound based on “peak concurrency × average context length × per-token cache overhead” and reserve about 30% headroom for bursts. Before launch, load testing must use the real Q&A distribution rather than ideal short texts.
5. Knowledge Base Cleaning: Turning Scans Into Retrievable Structured Data
This is the step that determines success. Typical difficulties with factory documents are scanned images, cross-page tables, mixed figure captions, and version chaos. The recommended pipeline is as follows.
- Collection and deduplication: establish a unique identifier by device model, production line, and document version to avoid answer conflicts caused by multiple versions of the same manual being ingested at once.
- Layout restoration: perform layout analysis first to distinguish body text, tables, figure captions, headers, and footers, then process them separately to avoid tables being shredded.
- Optical recognition and proofreading: after recognizing scanned images, apply rules and dictionaries for a second pass of proofreading, focusing on numbers, units, and model strings.
- Structured extraction: extract parameters such as torque, clearance, pressure, and cycle into key-value structures, preserving the four-tuple of “parameter name—value—unit—applicable condition.”
- Splitting and indexing: structured parameters go through exact retrieval, long text goes through semantic vector retrieval, and the two are combined in hybrid recall followed by unified reranking.
- Permissions and effective scope: control visibility by workshop, production line, and role to avoid cross-line information misuse.
An illustrative parameter structure:
{"device_model": "sample model","part": "sample part","param": "fastening torque","value": 45,"unit": "N·m","condition": "room temperature, dry thread","source_doc": "manual section number","version": "revision batch"}
The value of hybrid retrieval is this: when a worker asks “how much torque for the fourth bolt on this machine,” semantic retrieval locates the part and exact retrieval provides the definite value. Missing either one produces answers that “look right but cannot be trusted.”
6. Evaluation and Acceptance: Measurable Metrics Instead of Subjective Feelings
It is recommended to build a three-tier evaluation set: factual parameter Q&A, procedural step guidance, and anomaly fault judgment. Each tier should contain no fewer than one hundred items, covering night-shift colloquial questions, typos, and dialect-style expressions.
Common metrics include recall hit rate, answer accuracy, citation traceability rate, and refusal rate. Industrial scenarios should encourage “refuse rather than fabricate,” and the rate of unsupported answers should be a core assessment item. After every adjustment to the splitting strategy, quantization precision, or prompt template, run a full regression and keep version comparison records.
7. Continuous Iteration and Trust Building
Privatization is not a one-time delivery. It is recommended to place parsing rules, evaluation sets, and deployment scripts under internal version control so that changes are auditable, issues are reproducible, and versions can be rolled back. In external communication, keep business boundaries clearly stated and make clear that the focus is only the data loop in manufacturing scenarios, avoiding incorrect classification by general services. If an enterprise has open-source needs, it can choose to publish part of the general tool chain and process descriptions, which builds trust without leaking process data.
8. Common Pitfalls
- Replacing only the model without governing documents, leaving accuracy stuck at a low level.
- Pursuing full precision while ignoring concurrency and VRAM headroom, causing jitter immediately after launch.
- Lacking a refusal mechanism and treating hallucination as capability.
- Ignoring version management, so the same question gets different answers on different shifts.
- Understanding isolation as “just not connecting to the external network,” while overlooking runtime online dependency pulling.
In summary, the core of offline factory deployment is not choosing a particular model, but turning isolation, compute, knowledge governance, and evaluation into a sustainable engineering process. Baidu AI Cloud typically delivers related general capabilities through combinations of categories such as container platforms, object storage, log services, and monitoring and alerting, which can serve as a general reference for architecture design.
