Mirror Neuron Documents

Runtime Configuration Reference

Configure MirrorNeuron CLI, API, runtime, blueprint catalog, and local model connections.

Runtime Configuration Reference

Use this page to configure the deployed MirrorNeuron CLI, FastAPI gateway, Web UI, runtime connection, and blueprint catalog. It covers shared operator-facing settings, not every blueprint-specific variable; a blueprint's manifest.json and configuration files define its own inputs, model settings, and permitted environment access.

Before you change configuration

  • Run mn runtime status to record the active endpoints and runtime state.
  • Keep a copy of any deployment-specific configuration and remove secrets before sharing it.
  • Restart or re-check affected services after changing a listener, connection target, model, or catalog source.
  • Use a unique MN_REDIS_NAMESPACE for isolated test runs.

Runtime state and client connection

VariableDefaultPurpose
MN_ENVdevRuntime environment. Use prod only with a reviewed production configuration.
MN_HOME~/.mnLocal state root for runtime metadata, endpoint files, logs, models, and default run records.
MN_GRPC_TARGETlocalhost:55051 for the CLICore gRPC target used by CLI and SDK clients.
MN_GRPC_TIMEOUT_SECONDS10Per-RPC timeout for CLI, SDK, and API clients.
MN_GRPC_AUTH_TOKENunsetBearer token for a protected gRPC gateway. Treat as a secret.
MN_GRPC_ADMIN_TOKENunsetAdministrative gRPC token. Treat as a secret.
MN_REDIS_URLdeployment-specificRedis connection URL used for runtime state.
MN_REDIS_NAMESPACEmirror_neuronRedis key namespace. Use a separate value for tests.
MN_COOKIEdeployment-specificCluster credential. Change it before forming a non-local cluster and treat it as a secret.

The deployed gRPC endpoint is normally published on port 55051; the Core container can use a distinct internal port. Use mn runtime status instead of assuming a port after a custom deployment.

REST API and Web UI

VariableDefaultPurpose
MN_API_HOSTlocalhostFastAPI bind host. Binding beyond localhost changes the network trust boundary.
MN_API_PORT54001FastAPI bind port.
MN_API_BASE_URLunsetExternal API base URL when it differs from the local default.
MN_API_TOKENunsetEnables bearer-token API authentication when configured. Treat as a secret.
MN_API_REQUEST_SIZE_LIMIT_BYTES5242880Maximum API request-body size in bytes.
MN_API_CORS_ALLOW_ORIGINSunsetComma-separated CORS allowlist.
MN_WEB_UI_HOSTlocalhostWeb UI bind host.
MN_WEB_UI_PORT55173Web UI bind port.
MN_WEB_UI_API_BASE_URLunsetWeb UI upstream API URL.
MN_WEB_UI_PROXY_TIMEOUT_SECONDS30Web UI upstream request timeout in seconds.

Warning: MN_API_HOST or MN_WEB_UI_HOST values that expose a listener beyond localhost require a deliberate network and authentication design. Do not rely on CORS as an authentication boundary.

Blueprint catalog source

VariableDefaultPurpose
MN_BLUEPRINT_SOURCEgithubSelects github or local catalog resolution.
MN_BLUEPRINT_REPOSDK default repository when source is githubGit URL for the catalog.
MN_BLUEPRINT_LOCALunsetLocal catalog directory when source is local; it must contain index.json.
MN_BLUEPRINT_REPO_CACHE~/.cache/mirror-neuron/blueprint-reposCache root for checked-out catalog repositories.

Example local catalog configuration:

export MN_BLUEPRINT_SOURCE="local"
export MN_BLUEPRINT_LOCAL="/absolute/path/to/blueprint-catalog"

Verify the source before launching a catalog ID:

mn blueprint list

Use mn blueprint run --folder <folder> for a reviewed local blueprint folder when you do not need catalog resolution.

Local model and launch controls

VariableDefaultPurpose
MN_LLM_PROVIDERblueprint-specificSelected model provider.
MN_LLM_MODELblueprint-specificModel name passed to the worker/provider.
MN_LLM_RUNTIME_MODELblueprint-specificRuntime-managed model reference.
MN_LLM_API_BASEprovider-specificOpenAI-compatible model API base when used by the blueprint.
MN_LLM_API_KEYunsetModel-provider key. Treat as a secret and pass it only to approved workers.
MN_PRE_LAUNCH_TIMEOUT_SECONDS30Pre-launch timeout in seconds.
MN_POST_LAUNCH_TIMEOUT_SECONDS10Post-launch timeout in seconds.
MN_RUN_BACKGROUND_EVENT_RELAY1Enables background event relay for launched runs.

Use mn model doctor <model-id> before launching a blueprint that requires a local Docker Model Runner model. Do not put provider keys in a manifest or a committed configuration file.

Logging and CLI behavior

VariableDefaultPurpose
MN_LOG_LEVELINFOProcess log level.
MN_LOGS_ROOT~/.mn/logsDefault log directory.
MN_LOG_MAX_BYTES1048576Rotating process-log size in bytes.
MN_LOG_BACKUP_COUNT5Rotated process-log files to retain.
MN_CLI_OUTPUTrichSet to plain for non-Rich terminal output.
MN_RUN_DETACH_LOG_SECONDS30How long the CLI follows events after submitting a run.
MN_RUN_LOG_POLL_INTERVAL_SECONDS0.5CLI polling interval while collecting run events.

Verify a configuration change

After changing shared configuration, restart or re-check the affected services:

mn runtime health
mn runtime status

For API configuration, also check:

curl -s http://localhost:54001/api/v1/health

Replace the URL when you changed MN_API_HOST or MN_API_PORT.

On this page