A Practical Guide to Deploying Local LLMs and an Application Orchestration Platform
This guide walks through a two-tier deployment pattern for private AI: a containerized application orchestration platform paired with a local inference service. It covers environment variables, startup and health checks, model size and VRAM selection, connecting an OpenAI-compatible inference endpoint, key knowledge base and workflow parameters, a production hardening checklist, and a troubleshooting table for common failures.
1. Why Separate Inference from Application Orchestration
In real private AI deployments, the common pattern is a two-tier architecture: an inference layer plus an orchestration layer. The inference layer loads model weights, runs inference, and exposes an HTTP-compatible API. The orchestration layer handles prompt management, knowledge base retrieval, workflow orchestration, and the outbound API. Decoupling the two brings three direct benefits:
- Independent scaling: inference is constrained by VRAM and compute, while orchestration is constrained by concurrency and the database, so each tier can be scaled according to its own bottleneck.
- Decoupled technology stacks: upgrading the orchestration layer does not affect the model version, and switching models does not break already-configured applications.
- Fault isolation: when the inference process restarts unexpectedly, the orchestration layer still retains its configuration and historical data.
This article uses neutral wording — “an open-source LLM application development platform + a local model runtime tool + an open-source inference model” — to describe the general approach without pointing to any specific vendor product.
2. Stage One: Running the Application Orchestration Platform in Containers
2.1 Prerequisites
The orchestration platform is usually distributed as a container orchestration file, so the host needs a container runtime and an orchestration tool. After installation, verify the versions and daemon status first:
docker --versiondocker compose versiondocker info | grep -i "server version"
If the daemon is not running, every subsequent orchestration command will fail. This is the first pitfall beginners most often hit.
2.2 Preparing Environment Variables
After extracting the source directory, go into its container orchestration subdirectory, where you will find a templated environment variable file. The correct approach is to copy it and remove the template suffix so it becomes the active configuration file:
cp .env.example .env
The variables that deserve the most attention:
- Port mapping: if the default web port conflicts with another service on the machine, update both the mapping and the access address.
- Database and cache credentials: the defaults are for local evaluation only and must be replaced in any externally exposed scenario.
- Object storage and file upload limits: these affect the size of documents the knowledge base can parse.
- Log level: raise it while troubleshooting, then lower it once stable to control disk usage.
2.3 Startup and Status Verification
Run a detached startup in the directory containing the orchestration file, then confirm with the list command that all services are running:
docker compose up -ddocker compose ps
Note that the orchestration file typically includes several components: a gateway, the application service, a task queue, a relational database, a cache, and a vector retrieval store. The first startup pulls images and takes a while. If a container keeps restarting, check its logs first rather than restarting everything:
docker compose logs -f --tail=100 <service_name>
2.4 Initializing the Administrator and Learning the UI
Open the corresponding port on the machine in a browser to enter the setup wizard and create an administrator account. Remember these credentials, or the only way forward is resetting the data. After logging in, browse the model provider configuration, knowledge base, and application orchestration areas first to build an overall picture before making changes.
3. Stage Two: Installing the Local Inference Service and Obtaining Models
3.1 Installation and Self-Check
Install the local model runtime tool on the host, then confirm the version output from the command line. The key point: by default the tool runs as a persistent local service in the background, and the CLI is only a client — the service itself is the party being called. So after installation, do not close the terminal window’s service process, and do not let the system sleep and interrupt it.
3.2 Model Size and VRAM Selection
Model parameter count and quantization precision together determine VRAM usage. The ranges below are for selection reference only; the official model card is authoritative:
| Scale | Quantization | VRAM Reference | Suitable Scenario |
|---|---|---|---|
| 7B class | 4-bit | 6–8 GB | Single laptop, lightweight Q&A |
| 14B class | 4-bit | 10–14 GB | Medium-complexity reasoning and summarization |
| 32B class | 4-bit | 20–24 GB | Higher-quality generation, coding assistance |
| 70B class | 4-bit | 40 GB+ | Multi-GPU or professional GPU environments |
If VRAM is insufficient, consider lowering quantization precision, shortening the context length, or moving the inference layer to a cloud container instance with more compute.
3.3 Pulling and Verifying
ollama -vollama pull <model_tag>ollama listollama run <model_tag> "Explain vector retrieval in one sentence"
Once verification passes, the inference service exposes a local HTTP endpoint, and the orchestration layer connects to it through that address.
4. Stage Three: Connecting the Inference Service to the Orchestration Platform
In the orchestration platform’s model provider configuration, choose the generic “OpenAI-compatible” integration type and fill in the inference service address, model name, and a placeholder key. There are three common connectivity failures:
- The address is written as a container-internal address. Inside a container, localhost points to the container itself, so use the host address or the service name on the orchestration network.
- The port is not exposed. Confirm the inference service is not listening only on the loopback interface, otherwise containers cannot reach it.
- The model name is spelled inconsistently. It must exactly match the identifier in the inference service list, including case and tag.
After configuring, run a connectivity test with a minimal prompt, then move on to application orchestration.
5. Advanced: Key Knowledge Base and Workflow Parameters
- Chunking strategy: general chunking suits most documents; parent-child chunking suits precise retrieval in long documents; heading-based chunking suits well-structured specification material.
- Embedding model: configure it separately from the inference model, and do not change it casually after the knowledge base is built, or the vector spaces will be inconsistent and retrieval will fail.
- Retrieval settings: TopK determines how many results are recalled, and the similarity threshold determines how aggressively noise is filtered; tune them together.
- Workflow orchestration: split “retrieve — rerank — generate — validate” into separate nodes so each can be replaced individually and rolled out gradually.
6. Production Hardening Checklist
- Access control: enable HTTPS, replace all default credentials, and restrict the source network segments allowed to reach management ports.
- Data persistence: confirm the database and uploaded-file directories are mounted to host volumes so data survives container recreation.
- Resource limits: set VRAM and memory caps on the inference container so a single application cannot take down the whole machine.
- Observability: connect log services and monitoring alerts, with thresholds on API latency, error rate, and VRAM usage.
- Upgrade strategy: validate the new orchestration file and variable differences in a side environment first, then roll out gradually.
7. Quick Troubleshooting Reference
| Symptom | Common Cause | Direction |
|---|---|---|
| Container exits right after start | Missing variable or port in use | Check logs, add variables, change mapping |
| Model list is empty | Unreachable endpoint or wrong name | Test the API from the CLI |
| Generated content is truncated | Context length set too small | Adjust context and chunk length |
| Extremely slow responses | VRAM overflow falling back to memory | Lower quantization or shorten context |
| Empty knowledge base retrieval | Embedding model and threshold mismatch | Rebuild the knowledge base and tune the threshold |
8. Summary
The hard part of private LLM deployment is usually not any single installation but the contracts between layers: reachable addresses, matching names, sufficient resources, and persistent data. Proceeding in the order of containerized orchestration layer, local inference layer, connection configuration, parameter tuning, and hardened operations significantly reduces rework. To reduce self-managed operations overhead, the inference layer can also be moved to a cloud container platform and combined with general capabilities such as object storage, log services, and monitoring alerts to build an elastic architecture.
