Deploying Local LLMs and a Visual Orchestration Platform: A Practical Guide
This guide explains how to deploy local large language models alongside a visual application orchestration platform. It covers why separating the inference engine from the orchestration layer is beneficial, how to plan hardware and software resources, how to containerize the orchestration platform, how to run and tune a local inference service, how to connect models and embedding providers, how to build RAG knowledge bases and agent workflows, and a troubleshooting checklist for common failures.
1. Why Separate the Inference Engine from the Orchestration Platform
In real-world AI deployments, many teams start by writing model calls, prompt management, knowledge base retrieval, and business logic directly into application code. This usually leads to three problems: every model version upgrade forces changes to business code; prompts are scattered across the codebase and cannot be governed centrally; and retrieval logic is tightly coupled with business logic, making regression testing extremely costly.
A more sensible approach is to split the system into two layers:
- The lower layer is the model inference service, responsible only for loading weights, scheduling GPU memory, and exposing unified text generation and embedding APIs.
- The upper layer is a visual application orchestration platform, responsible for multi-model integration, visual prompt orchestration, retrieval-augmented generation (RAG) flows, AI agent and branching workflow design, and exposing capabilities through a friendly interface and open APIs.
The value of this separation is clear module boundaries. Engineers focus on compute and inference performance, while business users focus on prompts and workflows. Both roles can work in parallel and spend their energy on business innovation rather than repetitive environment setup. In addition, models become replaceable and workflows become versionable, significantly shortening the path from validation to launch for AI products.
2. Environment Preparation and Resource Planning
2.1 Hardware and System Baseline
When deploying LLMs locally, the first thing to calculate is the GPU memory and system memory budget. A rough formula is: model parameter count × bytes per parameter ≈ weight footprint, plus context cache (KV Cache) and runtime overhead. Taking quantized formats as an example, a 7B model at 4-bit quantization takes roughly 4GB of weights, 14B takes about 8–9GB, 32B takes about 18–20GB, and 70B requires multiple GPUs or much larger GPU memory. If GPU memory is insufficient, inference automatically falls back to system memory and CPU, and response latency increases several times over.
Recommended baseline configurations:
- Entry-level validation: 16GB RAM + 8GB GPU memory, running 7B–14B quantized models;
- Standard production: 32–64GB RAM + 24GB GPU memory, running 14B–32B models;
- High-concurrency scenarios: multi-GPU parallelism or elastic compute from a cloud container platform, combined with load balancing.
2.2 Software Dependencies
Three things need to be confirmed in advance: whether the container runtime is available (typically a container engine plus an orchestration tool), whether the required ports are occupied, and whether the disk is an SSD with 2–3 times the model size reserved. Model files can easily reach tens of gigabytes, and loading times on mechanical drives are painfully slow.
3. Containerizing the Visual Orchestration Platform
3.1 Get the Source Code and Configuration Template
Obtain the source package from the platform’s official code repository, extract it, and enter its container orchestration directory. This directory usually contains an orchestration file and an environment variable example file. The standard procedure is to copy the example file, rename it to the active environment file, and then adjust ports, secrets, storage directories, and other items as needed:
# Enter the orchestration directorycd deploy/docker# Copy the environment variable template and activate itcp .env.example .env# Modify ports and secrets as needed (example)# APP_PORT=80# SECRET_KEY=replace with a random long string
The most common pitfall here is editing the example file directly, which causes your configuration to be overwritten during later version updates. Also, never carry the default secret into production.
3.2 Start the Services and Verify
# Start all services in the backgrounddocker compose up -d# Check container statusdocker compose ps# Follow logs (the first stop for troubleshooting)docker compose logs -f
Normally, you will see a group of containers running, including the gateway, application service, task queue, database, vector store, and cache. If a container keeps restarting, check its logs first rather than restarting the entire stack. The first startup needs to pull images and takes a while, so do not interrupt it midway.
3.3 Initialize the Administrator and Basic Settings
Open the corresponding port on the local machine in a browser. The first visit shows an initialization wizard where you create the administrator account and password. Be sure to set your own credentials and keep them safe; avoid weak or default passwords. After logging in, browse the workspace, model provider configuration, knowledge base, and application orchestration sections to build an overall understanding before making changes.
4. Deploying the Local Inference Service and Pulling Models
4.1 Installation and Self-Check
On the machine that will host inference, install a local model runtime tool (either a graphical installer or a command-line script). After installation, open a terminal and run the version query command. If the version number prints correctly, the tool is ready:
ollama -v
Note: do not close this terminal window during subsequent use, as the local inference service typically runs as a persistent process.
4.2 Pulling and Running Models
# Pull a specific model (the tag determines parameter size and quantization level)ollama pull <model-name>:<size># Run it and enter interactive modeollama run <model-name>:<size># List locally available models and running statusollama listollama ps
Do not simply choose the largest model. Selection guidance: for tasks centered on Chinese comprehension and information extraction, a 14B quantized model is usually sufficient; move to 32B when stronger reasoning and coding capabilities are needed; 70B models sharply increase GPU memory and concurrency requirements, so evaluate the return on investment.
4.3 Key Tuning Parameters
OLLAMA_HOST: the listen address. Change it to0.0.0.0:11434when the containerized platform needs cross-host access;OLLAMA_NUM_PARALLEL: the number of concurrency slots. Increasing it improves throughput but amplifies GPU memory usage;OLLAMA_MAX_LOADED_MODELS: the maximum number of resident models. Increase it appropriately when switching between models frequently;OLLAMA_KEEP_ALIVE: the wait time before unloading a model. Reduce it when GPU memory is tight to avoid models occupying memory unnecessarily.
Security note: before exposing the inference port to 0.0.0.0, make sure the network is a trusted internal network, or add authentication through a reverse proxy and restrict sources with security groups. Otherwise, you are effectively opening an unauthenticated compute endpoint.
5. Connecting Models in the Orchestration Platform
On the platform’s model provider configuration page, select the local inference type and enter the service address and model name. If the orchestration platform and the inference service run in different container networks, you cannot use 127.0.0.1. Use the host address, the LAN IP, or connect both to the same custom network and reach each other by service name:
# Example: make the orchestration platform join the inference service networkservices:app:networks: [default, inference]networks:inference:external: true
The embedding model also needs separate configuration, as it determines knowledge base retrieval quality. A common mistake is changing the generation model but not the embedding model, which places historical vectors and new vectors in different semantic spaces and noticeably degrades retrieval results. After changing the embedding model, you must rebuild the index.
6. Building RAG Knowledge Bases and Agent Workflows
- Document ingestion: supports local files, web links, structured text, and other sources. Pay attention to per-file size and parsing format limits;
- Chunking strategy: a general range is 300–800 characters with 10%–20% overlap. Enlarge chunks appropriately for tables and clause-style documents, and split Q&A documents by question-answer pairs;
- Retrieval configuration: hybrid retrieval (keyword + vector) usually outperforms vector-only retrieval, and adding reranking can significantly improve hit rate;
- Prompt orchestration: clearly separate role definition, constraints, output format, and fallback phrasing in layers, rather than piling all requirements into one block;
- Workflow and evaluation: use the platform’s workflow orchestration to draw branches and conditional logic. Before launch, prepare 20–50 real questions for regression testing and record hit rate and hallucination rate.
7. Troubleshooting Checklist
| Symptom | Common Cause | Resolution |
|---|---|---|
| Container exits immediately after start | Missing environment variables, port conflict | Check logs, verify .env, change port |
| Platform cannot connect to the model | Address set to loopback | Use host IP or same-network service name |
| Extremely slow responses | Insufficient GPU memory falling back to CPU, excessive concurrency | Use smaller quantization, reduce concurrency |
| Answers do not cite the knowledge base | Inconsistent embedding model, oversized chunks | Rebuild index, adjust chunking |
| Chinese quality suddenly drops | Context truncated | Increase context length and compress prompts |
8. Conclusion
Combining a local inference service with a visual orchestration platform essentially decouples “compute” from “application logic”: models are replaceable, workflows are versionable, and data stays on the internal network. By following the sequence above—resource planning, container startup, model pulling, platform integration, knowledge base tuning, and troubleshooting—most teams can build a usable prototype environment within a day. If higher concurrency and elasticity are needed later, the inference layer can be smoothly migrated to managed compute on a container platform, with little to no change required to the orchestration layer configuration.
