Local LLM Deployment: Connecting an Application Platform to a Local Model
Learn how to connect an open-source LLM application platform to a local inference service, from installing the runtime and configuring Docker networking to registering models, testing connectivity, and preparing for production. The guide also covers embedding models for RAG and common deployment issues.
Many teams build LLM applications by combining an open-source application orchestration platform with a local inference service. This approach provides prompt orchestration, knowledge retrieval, and agent workflows while keeping model inference within the local environment, supporting data security and cost control.
This guide walks through the deployment and integration process from a platform-independent perspective.
1. Why Run LLMs Locally?
Before setting up the environment, consider where local inference is useful:
- Data security and compliance: Sensitive data can remain within the internal network, supporting compliance requirements in sectors such as finance, government, and healthcare.
- Cost control: Local inference avoids per-call model API charges, making it an option for teams with high request volumes and fixed budgets.
- Low latency and offline availability: Inference does not depend on external network access, reducing network-related variability.
- Customization: Teams can choose model versions, quantization options, or privately fine-tuned models.
Local inference still requires suitable hardware. Larger models generally need more GPU memory, system RAM, and disk space. A GPU with substantial VRAM is recommended; alternatively, quantized models can run on a CPU with a speed trade-off.
2. Install the Local Inference Runtime
A common approach is to use a lightweight local model runtime that can launch a model with a single command and expose an HTTP inference interface, often with OpenAI-style API compatibility.
Using Ollama on Windows as an example:
- Download the installer from the official distribution channel and run it. The installer adds the runtime to the system
PATH. - Open a terminal and verify the installation, download a model, and test an interactive conversation:
# Check the version to verify installationollama --version# Download an open-source modelollama pull llama3:7b# List locally downloaded modelsollama list# Test an interactive conversationollama run llama3:7b
The model name and tag must correspond to an available model. Use the exact downloaded identifier throughout the configuration.
When the service is running, Ollama normally listens for HTTP requests on port 11434. Check that the endpoint is reachable:
curl http://localhost:11434/api/tags
A JSON response listing locally available models indicates that the service endpoint is responding.
Networking for Docker-Based Platforms
If the application platform runs in Docker and the inference service runs on the host, the container must be able to reach the host service. Do not use localhost as the host service address: inside a container, it refers to the container itself.
- Linux: Use
http://host.docker.internal:11434where that hostname is configured to resolve to the host, or use the host’s Docker bridge IP address, commonly172.17.0.1. SettingOLLAMA_HOST=0.0.0.0allows the service to listen on all network interfaces. - Windows/macOS with Docker Desktop:
http://host.docker.internal:11434is typically the appropriate host address. Verify that the inference service’s listening configuration allows connections from Docker.
The service’s listening address and the address configured in the application platform must both support container-to-host connectivity.
3. Connect the Model to the LLM Application Platform
The exact interface varies by platform, but the integration process generally follows these steps.
3.1 Sign In and Open Settings
Sign in to the platform’s web console with an administrator account, then open Settings, typically located in the upper-right corner.
3.2 Open Model Providers
Select Model Providers. This section manages the model sources available to the platform, including commercial cloud models and locally hosted models.
3.3 Install the Provider Plugin
Find the provider entry for the local inference runtime or its supported API protocol, then select Install. Once installation is complete, open its configuration form.
3.4 Configure and Save the Connection
The main configuration fields are:
| Setting | Description | Example |
|---|---|---|
| Base URL | Address of the inference service | http://host.docker.internal:11434 |
| Model name | Must exactly match the locally downloaded model identifier | llama3:7b |
| Model type | Chat/language model or embedding model | LLM |
| Context length | Context limit supported by the model | 4096 |
| Maximum output tokens | Maximum tokens generated in a single response | 1024 |
The context length and output limit shown above are example settings; configure them according to the selected model’s supported limits.
After you save the configuration, the platform will typically run a connectivity check. A successful validation indicates that the model connection is configured.
3.5 Add an Embedding Model for RAG
If you plan to use a knowledge base or retrieval-augmented generation (RAG), also connect an embedding model.
Download an embedding model through the local runtime and register it with the platform using the same general process, selecting the appropriate model type. The knowledge base can then use it to convert text into vectors.
4. Validate the Integration and Troubleshoot
Create a minimal chat application and send a test prompt to verify the full path from the application platform to the local model.
If the request fails or performs poorly, check the following:
- Connection timeouts: Start with container-to-host networking. Make sure the configured host service address is not
localhostor127.0.0.1. Usedocker execto enter the relevant container and test the endpoint withcurl. - Model not found: Compare the configured model name with the output of
ollama list. The full identifier, including its tag, must match. - Very slow inference: Check whether inference has fallen back to the CPU and inspect GPU utilization. Consider a smaller model or a more aggressively quantized version.
- Firewall blocking: For deployments across multiple machines, ensure that the firewall permits access to the inference port from the platform host.
5. Production Deployment Recommendations
Before relying on the integration for production workloads:
- Enable automatic startup and recovery: Manage the runtime with
systemdor deploy it in a container so it can start automatically and recover from failures. - Tune runtime settings: Use supported environment variables to configure concurrency and connection keep-alive behavior to match the platform’s request load.
- Add monitoring and alerts: Monitor process availability, GPU memory usage, and request latency, and integrate logs and alerts into your existing operational systems.
- Separate team quotas: Isolate model usage quotas across teams to prevent a high-traffic application from monopolizing inference resources.
With these steps complete, you have a privately hosted model service connected to an LLM application orchestration platform. You can then build on that foundation with workflows, knowledge bases, and agent capabilities to support your team’s LLM applications.
