Deploying Local LLMs and an Application Orchestration Platform: A Practical Guide
This guide explains how to deploy a local large language model (LLM) inference service alongside an application orchestration platform. It covers why separating the inference layer from the orchestration layer simplifies troubleshooting, how to deploy the orchestration platform locally with Docker Compose, how to install an inference client and select a model based on hardware, and how to connect the two layers. It also outlines a systematic troubleshooting approach and production recommendations.
1. Why Separate the Inference Service from the Orchestration Platform
When deploying LLM applications, many teams install model inference and application orchestration on a single machine in one pass. The result is that any failure becomes hard to isolate. A more reliable approach is to split the system into two layers:
- Inference layer: Responsible for loading and running the model. This is a compute-intensive component that is sensitive to GPU memory, system memory, and compute capacity.
- Orchestration layer: Responsible for prompt management, knowledge base retrieval, workflow design, and external interfaces. This is a business-logic-intensive component that is sensitive to the container environment and storage.
The direct benefit of this separation is that the inference layer can be scaled independently or have its model swapped out, while the orchestration layer can be upgraded independently. The two communicate through standard interfaces without being tightly coupled. The visual prompt orchestration, retrieval-augmented generation (RAG) engine, AI agent framework, and workflow design capabilities described in the original text all belong to the orchestration layer, whereas downloading and running the model belongs to the inference layer. Understanding this is the prerequisite for all troubleshooting that follows.
2. Deploying the Orchestration Platform Locally
2.1 Obtain the Deployment Package
Get the source package or image package from the platform’s official release channel, extract it, and enter its container orchestration directory. This directory usually contains an orchestration file and a sample environment variable file.
2.2 Prepare the Environment Variables
Copy the sample file and remove the “sample” marker from its extension so that it becomes the active configuration file. This step is the most easily overlooked: if the configuration file name is incorrect, the container will fail and exit at startup. Three categories of parameters in the configuration file deserve particular attention:
# Port the service listens onPORT=80# Connection strings for the dependent database and cacheDB_HOST=dbREDIS_HOST=redis# Object storage and vector database settingsSTORAGE_TYPE=local
2.3 Start and Verify Status
Open a terminal in the directory containing the configuration file and run the container orchestration start command in detached mode:
docker compose up -d
This command brings up all dependent services in the order defined in the orchestration file. The first run needs to download images and takes a while, so do not interrupt it midway. After startup completes, use the status query command to confirm that all services are running:
docker compose ps
If a service keeps restarting, first check for port conflicts and configuration file syntax errors rather than rebuilding the container outright.
2.4 Initialize the Administrator Account
Open a browser and navigate to the corresponding local port to reach the initialization page and create an administrator account. It is advisable to record the account information to avoid repeated account recovery later. Slow first load is normal and is usually caused by database initialization and cache warm-up.
3. Installing the Inference Service and Preparing the Model
3.1 Install the Inference Client
Download the installer that matches your operating system from the inference service’s official channel. After installation, open a terminal and run the version query command to confirm it works:
ollama -v
If the version number is printed normally, the installation succeeded. Note that this terminal window must stay open, as the client runs as a persistent service.
3.2 Choose a Model Size Based on Hardware
Model parameter count correlates positively with GPU memory requirements. When selecting a model, follow the principle of “estimate first, then verify with a real test.” A rough guide is as follows:
| Model size | Recommended GPU memory | Use case |
|---|---|---|
| Small distilled version | Around 8GB | Single-machine validation, lightweight Q&A |
| Medium version | Around 16GB | General conversation and summarization |
| Large full version | 24GB or more | Complex reasoning, code generation |
If GPU memory is insufficient, try a lower-precision quantized version first, or switch to inference that combines memory and the processor, at the cost of slower response speed.
3.3 Pull and Run the Model
ollama pull deepseek-r1:7bollama run deepseek-r1:7b
Pulling is a layered download, and re-running the command after an interruption resumes the transfer. Once the run succeeds, the inference service exposes a compatible interface on a fixed local port by default for upper-layer applications to call.
4. Connecting the Inference Service to the Orchestration Platform
On the orchestration platform’s model provider configuration page, select the “local inference service” type and fill in the base address, model name, and key (a placeholder value is fine for a local service). There are three common failure points here:
- Incorrect address format: Inside a container,
localhostpoints to the container itself, so you need to use the host address or the service name in the container orchestration network. - Port not exposed: Confirm that the inference service’s listening address is not restricted to loopback only; otherwise the container cannot reach it.
- Mismatched model name: The name in the configuration must exactly match the tag actually loaded by the inference service, including the version suffix.
After configuration, run a connectivity test first, then move on to prompt orchestration and the knowledge base.
5. A Systematic Troubleshooting Approach
It is recommended to locate problems in the order of “layer-by-layer verification” to avoid blind reinstallation:
- Orchestration page won’t open: Check container status, port mapping, and configuration file name.
- Model call timeout: First call the inference interface directly on the host to confirm the inference layer itself works.
- GPU memory overflow: Lower the model size or concurrency, and check whether other processes are using the GPU.
- Poor knowledge base retrieval: First adjust chunk size and overlap length, then consider switching the embedding model.
- Data persistence anomalies: Confirm that data volumes are correctly mounted; otherwise data is lost after the container is rebuilt.
6. Additional Recommendations for Production
After local validation passes, if you need to serve external users, deploy the inference layer and orchestration layer separately, place a load balancer and access control in front of the orchestration layer, and connect a unified logging service with monitoring and alerting. Put model files and knowledge base data in object storage or dedicated data volumes so they are not lost with the container lifecycle. If you want to reduce self-built operations costs, you can also evaluate hosting the orchestration layer on a cloud container platform and the model layer on a managed inference service, so you can focus your effort on the business and prompt engineering itself.
