Local LLM Deployment with a Low-Code AI Platform: Configuration and API Key Troubleshooting
This article explains a practical three-tier deployment pattern that combines local LLM inference with a low-code application orchestration platform. It covers how to determine the service base URL, configure and activate the admin API key, retrieve the workspace ID, troubleshoot common integration errors such as 401 Invalid Token, and validate the setup end to end.
In LLM application deployment, an increasing number of developers are choosing a combination of local model inference services and a low-code application orchestration platform. This architecture helps keep data within the environment while enabling teams to build business applications quickly through visual workflow orchestration. During deployment and integration, however, configuration items such as the service address, API key, and workspace identifier often become blockers. This article takes an engineering-practice approach and systematically explains how to obtain these key configurations and troubleshoot common issues.
1. Overall Architecture and Deployment Approach
A typical deployment architecture has three layers:
- Model inference layer: Run open-source large language models on local or private servers and expose them through a unified inference interface. A common approach is containerized deployment with GPU-accelerated inference.
- Application orchestration layer: Deploy a low-code platform that supports workflow orchestration and is responsible for prompt management, knowledge base retrieval, workflow orchestration, and application publishing.
- Access layer: Frontend pages or business systems call the APIs exposed by the orchestration layer to complete the final business loop.
For deployment, it is recommended to use a container orchestration tool to manage all components uniformly. Containerize the model service, platform service, database, and middleware separately, and let them communicate through network aliases. This avoids port conflicts and messy environment dependencies.
2. Determining the Service Base URL
The orchestration platform usually requires an API base URL to identify the location of the service instance. This address depends on your deployment model:
- Local development environment: Usually
http://localhost. If the platform listens on a specific port by default, such as 80 or 5001, include the port number. - Self-hosted online environment: For example,
https://ai.example.com. This requires domain resolution, certificate configuration, and a reverse proxy. - Public cloud managed version: The service provider supplies a fixed API domain name. Enter it directly.
Practical tip: If you have customized the access address in a local deployment, open the platform workspace in your browser and inspect the URL in the address bar. Usually, you remove trailing route paths such as /apps, and the remaining part is the base URL. This is one of the most error-prone configuration items. After configuration, verify connectivity with curl or an API debugging tool:
curl -I http://localhost/v1/models
If a normal status code is returned, the address and port are correct.
3. Configuring and Activating the Admin API Key
To allow automation scripts or external tools to call the platform’s admin APIs, you must configure an admin-level API key. This key is not an ordinary application key generated in the web UI. It must be set manually in the server-side .env environment configuration file.
3.1 Configuration Steps
- Locate the
.envfile in the deployment directory. For containerized deployments, it is usually underdocker/.env; for source-code deployments, it may be underapi/.env. - Confirm or add the following two items:
ADMIN_API_KEY_ENABLE=trueADMIN_API_KEY=sk-admin-your-custom-string
- Create a sufficiently complex and hard-to-guess key string. Avoid default values or weak random values.
- After making the changes, restart the API service process so the configuration takes effect:
cd /path/to/your/platform/dockerdocker compose up -d --force-recreate api
3.2 Common Error: 401 Invalid Token
This is the most frequent issue. Recommended troubleshooting order:
- Is the configuration item enabled?
ADMIN_API_KEY_ENABLEmust betrue. A key value without the switch will not take effect. - Is the key value correct? Check spelling, spaces, and quotes. The environment variable file should not contain extra characters.
- Was the service actually restarted? Many developers click the restart button in a container dashboard, but environment variable loading depends on the container recreation process. The correct approach is to use
--force-recreateto recreate the container, not a simple restart. - Was the correct file edited? Confirm that you modified the
.envfile actually loaded by the API service, not a configuration file for the frontend or database component.
4. Obtaining the Workspace ID
The workspace ID is the primary key of records in the platform database’s tenants table. Some admin APIs require it. There are two ways to obtain it:
4.1 Method 1: Browser Developer Tools (Recommended)
- Log in to the platform web UI, press F12 to open developer tools, and switch to the Network tab.
- Select Fetch/XHR in the filter.
- Refresh the page with F5 and find the API request whose name contains
workspaces. - In the Preview panel on the right, inspect the response body. The
idfield is the workspace ID:
{"workspaces": [{"id": "d4e26a01-162f-4366-9a25-1c2c1bdd15dz","name": "admin's Workspace","current": true}]}
This method does not require database permissions and is the safest and quickest approach.
4.2 Method 2: Query the Database Directly
If you have database access permissions, you can connect to the database directly from the deployment directory:
docker exec -it <platform-database-container-name> psql -U postgres -d <database-name>
Run the query:
SELECT id, name FROM tenants;
The UUID in the first column of the result is the workspace ID. Note that if multiple workspaces exist, confirm that you use the ID corresponding to the target workspace, not the default administrator’s workspace.
5. End-to-End Validation and Operational Recommendations
Once all three configuration items are ready, validate the setup end to end in the following order:
- First verify connectivity to the model inference layer and confirm that the model service can return inference results normally.
- Then verify the orchestration platform’s admin APIs. Use the configured admin key to send a read-only request, such as querying workspace information, and confirm that authentication passes.
- Finally, run a minimal workflow from trigger to model call to result return.
At the operations level, keep three points in mind: First, all keys should be stored securely and must not be committed to code repositories. Second, after modifying .env, always recreate the container rather than performing a simple restart. This is the most common root cause of environment-variable configuration failures. Third, in production environments, add network-layer access control to admin APIs and allow calls only from trusted network segments.
After completing these configurations, you can further integrate automation scripts to batch-create, deploy, and update applications, truly unlocking the efficiency benefits of the workflow platform.
