Building a Local Deployment Experiment Platform for Domestically Produced Large Language Models
This article explains how to build a local deployment experiment platform for domestically produced large language models in university labs. It covers a five-layer architecture, hardware and operator adaptation, deployment strategies for hundred-billion-parameter models, AI agent integration, data security, multi-tenant scheduling, observability, an eight-week rollout roadmap, and common pitfalls to avoid.
1. Background and Problem Definition
Since 2025, general AI capabilities represented by open-source large models with hundreds of billions of parameters have rapidly expanded into research and teaching. University labs commonly face three conflicts: compute supply does not match model scale, as a single card’s memory cannot hold ultra-large parameter counts; rising data compliance pressure, since research and experimental data are often sensitive and unsuitable for off-domain processing; and large differences between teaching and research workloads, which require elastic, multi-tenant, reusable experiment environments.
The core goals of a “local deployment experiment platform” can therefore be abstracted into four points: autonomous and controllable compute, data staying within domain, reproducible environments, and extensible capabilities. These four points are also the evaluation criteria for all technology choices later in this article.
2. Layered Overall Architecture
A deployable experiment platform is typically divided into five layers:
- Hardware and compute layer: compute nodes built from domestic general-purpose processors and domestic AI accelerator cards, paired with high-speed interconnect networks and a parallel file system.
- Base software layer: drivers, runtimes, communication libraries, container runtimes, and container orchestration systems.
- Model serving layer: model weight management, quantization, parallel partitioning, inference service encapsulation, and batch scheduling.
- Agent and tool layer: task orchestration, retrieval augmentation, tool invocation, and workflow templates.
- Platform service layer: unified authentication, multi-tenant quotas, experiment spaces, data encryption and sharing, and logging with monitoring and alerting.
The key value of layering is fault domain isolation: a model serving failure should not make experiment spaces unavailable, and a compute node failure should not cause metadata loss.
3. Compute Foundation and Domestic Hardware Adaptation
The difficulty of fully domestic deployment lies not in “whether it can run” but in operator coverage and numerical consistency. In practice, it is recommended to proceed in this order:
- First, perform an operator checklist review: export the target model’s computation graph, compare layer by layer the operators and data types supported by the accelerator card, and flag unsupported or precision-limited operators.
- Next, perform small-scale numerical alignment: use fixed inputs to compare the output distribution against a reference implementation, focusing on maximum absolute error and cosine similarity rather than whether a single point “looks correct.”
- Finally, perform end-to-end stress testing: observe throughput, first-token latency, and memory growth curves under long contexts.
An illustrative environment self-check script (pseudocode, expressing the flow only):
# 1. Environment probingreport = probe(devices="accelerator", check=["driver", "runtime", "collective_comm"])# 2. Operator coverage checkcoverage = compare_operators(model_graph, device_capability)# 3. Numerical consistencymetrics = numerical_align(reference_output, device_output,metrics=["max_abs_err", "cosine_sim"])assert metrics["cosine_sim"] > 0.999, "Numerical deviation exceeds threshold; roll back precision configuration"
4. Deployment Strategy for Ultra-Large Models
Hundred-billion-parameter models cannot be loaded on a single card and must combine three techniques:
- Tensor parallelism: split a single layer’s matrices across multiple cards; communication is frequent and requires high-bandwidth inter-card interconnect.
- Pipeline parallelism: split by layer across different nodes to reduce per-node memory pressure, but it introduces bubbles and requires reasonable split points.
- Expert parallelism: for mixture-of-experts structures, distribute experts across different devices and use a capacity factor to control load balancing.
Memory budget can be estimated in advance with a rough formula:
Memory ≈ parameters × bytes per parameter × (1 + optimizer and activation overhead factor) + KV cacheKV cache ≈ 2 × layers × hidden dimension × sequence length × batch size × bytes per element
Engineering practice favors the combination of weight quantization + KV cache quantization: reducing weights to low bits significantly cuts loading pressure, while KV cache quantization determines the concurrency ceiling in long-context scenarios. Note that quantization changes the numerical distribution, so quality regression must be performed on the target task set rather than only looking at general leaderboards.
5. Integrating AI Agent Capabilities with Teaching and Research
When the platform targets university scenarios, the value of agents lies in packaging “model capabilities” into “reusable experiment units”:
- Literature and material assistant: combined with retrieval augmentation, use the campus knowledge base as external memory, with answers accompanied by source snippets for academic verification.
- Experiment workflow orchestration: break data preprocessing, training, and evaluation into tool nodes, scheduled by the agent according to dependencies.
- Code and script assistance: executed within a controlled sandbox, with external network access prohibited to avoid uncontrollable side effects.
- Teaching evaluation: use unified prompt templates and scoring dimensions to ensure consistent evaluation standards across different classes in the same course.
A minimal orchestration example:
{"workflow": "experiment_pipeline","nodes": [{"id": "load", "tool": "dataset_loader", "args": {"scope": "tenant_a"}},{"id": "train", "tool": "trainer", "deps": ["load"]},{"id": "eval", "tool": "evaluator", "deps": ["train"]}],"policy": {"network": "deny", "log": "audit"}}
6. Data Security: Full-Process Encryption and Cross-Team Sharing
Protecting research data must cover four stages: storage, transmission, use, and sharing.
- Storage side: use block storage with transparent encryption or an encrypted file system, with keys managed by an independent key management service that supports rotation and revocation.
- Transmission side: services and clients uniformly use encrypted channels, with internal calls being no exception, avoiding the wrong assumption that “the intranet is trustworthy.”
- Use side: decouple experiment spaces from data spaces; compute tasks read data through controlled mounts, and writing raw data directly to disk is prohibited.
- Sharing side: cross-team sharing does not copy plaintext but uses “authorized views + watermarking + access auditing,” so who read which field and when can be traced to a person.
Sharing authorization should follow the principle of least privilege:
grant(role=researcher, resource=dataset_x, actions=[read], fields=[...], ttl=7d)grant(role=auditor, resource=dataset_x, actions=[read_meta], ttl=30d)deny(all, resource=dataset_x, condition="export_to_external")
7. Multi-Tenant Scheduling and Cost Control
University platform users have a special structure: course assignments are short-lived with high concurrency, while research projects involve long-term occupation. Recommendations:
- Use queues + priority + preemption to distinguish workload types, with priority given to teaching during peak periods;
- Set quotas and timeout reclamation to prevent zombie tasks from occupying accelerator cards long-term;
- Enable dynamic batching and instance scaling on the inference service side to merge fragmented requests and improve card utilization;
- Provide sleep and resume capabilities for interactive experiments, releasing memory when idle.
8. Observability and Operations
Three layers of observability must be established: metrics (throughput, latency, memory, temperature), logs (structured, with request identifiers), and traces (time spent in queuing, inference, and tool invocation for a single request). On this basis, configure alert thresholds and capacity trend forecasting to turn “discovering a broken card too late” into “scaling up in advance.”
9. Recommended Rollout Roadmap
- Weeks 1–2: assess compute and operators, and determine the upper limit of runnable model scale;
- Weeks 3–4: build a single-tenant inference service and complete numerical and quality regression;
- Weeks 5–6: integrate authentication, quotas, encrypted storage, and auditing;
- Weeks 7–8: launch agent orchestration and course/project templates;
- Ongoing: capacity assessment, quantization strategy iteration, and tightening sharing policies.
10. Common Pitfalls
- Only checking whether it can start, without looking at memory and latency performance under long contexts;
- Skipping business-set regression after quantization, causing hidden quality degradation;
- Treating the intranet as a security boundary while ignoring internal lateral access;
- Relying on copying for sharing, ultimately creating large numbers of uncontrollable data copies;
- Lacking quota and reclamation mechanisms, so the platform is quickly filled by a few long-running tasks.
Overall, the competitiveness of a domestically produced local deployment experiment platform comes not from single-point hardware parameters but from the product of three factors: adaptation depth, scheduling efficiency, and data governance maturity. Only by solidly building these three areas can the platform simultaneously support the high concurrency of teaching and the long cycles of research.
