Running LLMs Locally: A Practical Guide to Building a Containerized LLM App Platform and Troubleshooting Common Issues

    When teams want to build AI applications with prompt orchestration, RAG, and agent capabilities—but cannot send data to the cloud and have limited budgets—combining a local LLM runtime tool with an open-source LLM app development platform is a popular private deployment approach. This article walks through a complete local deployment process: choosing the architecture, preparing the container environment, deploying the app platform, running a local model, and debugging the integration between the platform and the model. It also covers common pitfalls such as container startup failures, port conflicts, hardware resource constraints, and container-to-host network isolation, along with practical troubleshooting steps.

    Running LLMs Locally: A Practical Guide to Building a Containerized LLM App Platform and Troubleshooting Common Issues

    When bringing generative AI applications into production, many teams face the same challenge: their data cannot easily move to the cloud, budgets are tight, yet they want to quickly build AI applications with prompt orchestration, RAG retrieval, and agent capabilities. In this situation, the combination of a local LLM runtime tool and an open-source LLM application development platform has become a common on-premises solution. This article follows a complete local deployment process from start to finish, outlining the deployment workflow, common issues, and troubleshooting approaches.

    1. Solution Selection and Overall Architecture

    This type of solution typically consists of two parts:

    • Model runtime layer: Loads and runs open-source LLMs locally, abstracts away underlying hardware differences, and provides a unified model management interface.
    • Application development layer: Built around an open-source LLM application development platform, typically combining backend-as-a-service and LLMOps concepts. It provides visual prompt orchestration, a RAG engine, an agent framework, and workflow design capabilities, allowing both technical and non-technical users to participate in building AI applications.

    The two layers connect through a standardized model service interface. The overall architecture is: application platform → model service interface → local inference engine → GPU/CPU hardware.

    When selecting a solution, three factors deserve priority: whether the platform supports multiple models, whether it offers a complete API, and whether its community documentation is active.

    2. Preparing the Container Environment

    2.1 Installing a Container Runtime

    Most open-source LLM application platforms are delivered as containers, so the first step is installing a container runtime. Download the appropriate installer for your operating system from the official website and follow the installation prompts.

    To verify the installation, run the following in a terminal:

    1. docker -v
    2. docker compose version

    If both version numbers print correctly, your environment is ready. Note that some platforms depend on relatively new container orchestration features—if your version is too old, upgrade first, otherwise you may encounter errors about unrecognized configuration options when starting the services later.

    2.2 Common Issues

    • Virtualization not enabled: On Windows, if the runtime fails to start after installation, virtualization is usually disabled in the BIOS. Enter the BIOS settings and enable the relevant option.
    • Proxy interference: If image pulls hang for a long time, check your system proxy settings. If necessary, configure a mirror registry or a dedicated proxy for the container runtime.
    • Insufficient disk space: Models and application components take up significant space. Reserve at least 50GB of free space and, if possible, install on a non-system drive.

    3. Getting the Source Code and Starting the Application Platform

    3.2 Downloading and Initializing the Configuration

    After downloading the source package from the platform’s official release page, navigate to the container deployment directory. The directory usually contains a sample environment configuration file (often a template ending with .example). This is the step beginners most often overlook:

    1. Copy the sample file.
    2. Rename the copy to the actual environment configuration file (remove the .example suffix).
    3. Adjust parameters such as ports and secrets as needed. If a port conflicts with an existing local service, change it before starting, or you may not be able to access the platform afterward.

    3.2 Starting the Services

    Open a terminal in the deployment directory and run the container orchestration startup command in detached mode:

    1. docker compose up -d

    This command pulls and starts all service components defined in the compose file, including the application frontend, backend API, database, cache, and message queue. The first launch downloads a large number of images—be patient and do not close the window midway.

    Once startup completes, check the status of all containers:

    1. docker compose ps

    Normally, all services should be in the running state. If a container keeps restarting, the cause is usually a configuration error or a dependent service that is not yet ready. Inspect the container logs to locate the problem:

    1. docker logs <container-name>

    3.3 Initializing the Administrator Account

    Open a browser and visit the local address (by default, http://127.0.0.1/ or the corresponding mapped port). The first visit may take a while as the system initializes. Once the page loads, follow the prompts to create an administrator account and password—make sure to save these credentials securely, or you will have to go through a password recovery process later, which is a hassle. After logging in, take some time to explore the feature modules before connecting any models.

    4. Downloading and Running a Local LLM

    4.1 Installing the Model Runtime Tool

    Download the client from the official website of your chosen tool, select the installer for your operating system, and install it. Once installed, run the following in a terminal:

    1. ollama -v # example command; refer to your chosen tool's documentation

    If a version number prints, the installation succeeded. Keep the service running in the background, otherwise the application platform cannot connect to the model.

    4.2 Choosing the Right Model Size

    When selecting a target model from the model library, you must take your local hardware into account. The following guidelines may help:

    Model parameter size Recommended VRAM/RAM Typical use cases
    1.5B–7B 8GB–16GB Lightweight chat, feature validation
    14B–32B 24GB+ Higher-quality reasoning tasks
    70B and above Multi-GPU or large-memory servers Production-grade, high-quality scenarios

    Beginners should start with a small model to validate the full workflow before scaling up, avoiding startup failures caused by insufficient resources at the outset. Run the pull command, wait for the download to finish, and then test inference by chatting with the model from the command line.

    5. Integrating the Platform with the Model and Troubleshooting Typical Issues

    In the application platform’s model settings, enter the local model service’s endpoint URL and the model name to complete the integration. Typical issues during this stage include:

    • Connection refused: Usually caused by the model service not running, or an incorrect endpoint URL or port. First verify that the model responds correctly from the command line, then check the platform configuration.
    • Extremely slow responses or timeouts: Caused by insufficient hardware resources. Consider using a smaller model, enabling a quantized version, or closing other resource-heavy programs.
    • Garbled Chinese responses: Confirm that the model version supports Chinese-language corpora; replace the model if necessary.
    • Container cannot reach the host service: Container networking is isolated from the host network, so the endpoint URL should use the host’s reachable address rather than the loopback address. This is the most common hidden pitfall during integration.

    6. Summary

    The core pipeline of a local LLM deployment can be summarized as: container environment → platform deployment → model service → interface integration. Each step has its typical pitfalls, but the troubleshooting approach is the same: verify the infrastructure first, then check the configuration, and finally examine network connectivity. For teams that want to quickly validate AI application ideas, once this local solution is up and running, you can later migrate smoothly to a cloud solution (such as Baidu AI Cloud’s container platform and model services) for elastic compute, higher concurrency, and managed services—completing the journey from validation to production.