Local LLM Deployment Configuration: How to Find API Endpoints, Admin Keys, and Workspace IDs

    This article explains how to resolve the configuration issues that commonly block automation after a locally deployed LLM application appears to be running. It covers how to locate the service access URL across different deployment types, how to enable and verify an admin API key through server-side environment variables, and how to retrieve the workspace identifier. It also outlines a layered troubleshooting order and practical recommendations for managing credentials safely.

    1. Background: Why Automation Fails After a “Successful” Deployment

    When setting up LLM applications locally, the technical stack usually consists of three parts:

    • A local inference service that loads open-source weights and exposes an interface compatible with common calling protocols;
    • An application orchestration platform that packages model capabilities into reusable applications and workflows;
    • Automation scripts or AI coding tools that create, publish, and update applications in bulk.

    The first blocker for many teams is not insufficient VRAM or a failed model download. Instead, it is an authentication error returned by automated calls even though all services are up. The root cause is that the automation interface exposed by the orchestration platform requires a clear set of connection parameters and credentials, and these are scattered across different locations: some come from the runtime address, some are written in server-side environment variable files, and some exist only in the database.

    This article explains, in a generic way, how to locate these three types of parameters, what values to use, and how to verify them.

    2. How to Obtain the Three Core Configuration Items

    2.1 Service Access URL

    The access URL depends on the deployment type and typically falls into three cases:

    • Local development: usually a loopback address on the local machine plus a service port;
    • Self-hosted production: a custom domain plus a reverse proxy path;
    • Managed service: a fixed interface entry provided by the platform, with a version path prefix.

    If you have changed the access entry in a self-hosted environment, a useful technique is to log in to the web UI, look at the address bar, and remove the trailing application list path. What remains is usually the API root address. Note that the API root address and the web access address may differ. Automation should use the API prefix documented in the official documentation rather than treating the page URL as the API URL.

    2.2 Admin API Key

    The admin API key is not something you click out of the UI; it must be configured on the server side. This is the most commonly misunderstood point. The general procedure is:

    1. Locate the environment variable file in the deployment directory. For containerized deployments it is usually in the orchestration directory; for non-container deployments it is usually in the service configuration directory.
    2. Confirm that the “enable admin API key” switch exists and is set to true, and set a sufficiently random key string.
    3. Save the changes and restart the service process that hosts the interface so the configuration takes effect.

    Illustrative configuration (structure only, not fields from any specific product):

    1. ADMIN_API_KEY_ENABLE=true
    2. ADMIN_API_KEY=<your-random-string>

    When restarting, run the orchestration tool’s rebuild command from the command line instead of clicking “Restart” in a visual panel. The reason is that a panel restart often only restarts the container lifecycle and does not re-inject the changed environment variables. A command with a force-rebuild parameter recreates the container instance, ensuring the new variables are read.

    If you get a 401-style authentication failure, check three things in order: whether the switch is enabled, whether the string matches exactly (including spaces and line breaks), and whether the service process was actually rebuilt after the change.

    2.3 Workspace Identifier

    The workspace identifier is the smallest unit of data isolation and usually corresponds to the primary key of the tenant table in the database. There are two ways to obtain it:

    • Browser developer tools (recommended): log in to the web UI, open the developer tools network panel, filter for asynchronous requests, refresh the page, find the workspace list API, and read the identifier field from the response body;
    • Direct database query: enter the database container, start an interactive session, query the primary key and name fields of the tenant table, and take the primary key of the first record as the workspace identifier. Exit the session when done.

    The first method is recommended because it does not require database permissions and will not break due to table schema version differences.

    3. Common Failures and Troubleshooting Order

    It is recommended to narrow down issues layer by layer in this order: connectivity → authentication → resource identifier → model readiness.

    1. Connectivity: confirm the address is reachable and the port and reverse proxy path are correct;
    2. Authentication: confirm all three elements are in place: the key switch, the key value, and the process rebuild;
    3. Resource identifier: confirm the workspace identifier matches the space of the currently logged-in account; cross-space calls will be rejected;
    4. Model readiness: confirm the local inference service has finished loading weights and the interface probe returns normally before creating the application.

    4. Practical Recommendations

    Put the three types of parameters in a separate configuration file or a key management service, and do not commit them to the code repository. Apply least-privilege access to keys and rotate them regularly. Add a self-check step before the automation workflow starts, using a read-only interface to verify that the address and credentials are valid, which can significantly reduce ineffective retries.

    If you use relevant Baidu AI Cloud products to host this type of environment, you can combine common capabilities such as the container platform, log service, and monitoring and alerting to keep a record of configuration changes and trigger alerts on call failures. This moves deployment troubleshooting from after-the-fact investigation to before-the-fact interception.