Skip to main content

Environment Variables

Set these before starting the backend (scripts/run-backend.sh) or export them in your shell/Compose/Helm values. Most have working defaults for local development; production and Model Service gateway deployments typically need to set the auth and gateway groups explicitly.

Auth and security​

VariableDescriptionDefault
PRISM_AUTH_MODEAuth mode (local by default).local
PRISM_ADMIN_USERNAME / PRISM_ADMIN_PASSWORDSeed the initial admin account on first boot.PRISM_ADMIN_USERNAME: admin
PRISM_ADMIN_PASSWORD: ""
PRISM_ADMIN_AUTOSEEDWhether to auto-create the initial admin account (default on).True
LENS_SECRET_KEYMaster key that encrypts stored external-provider secrets. When unset, Lens generates one on first start under <LENS_DATA_DIR>/credentials/master_key.json (mode 600); set it to pin the key or make the Master key page read-only.generated and stored on first start
LENS_SECRET_KEYS_OLDComma-separated previous master keys used as decryption fallback after a rotation.""
LENS_INTERNAL_AUTH_SECRETShared secret for internal service-to-service calls (for example agentic planning callbacks).""
PRISM_EXPOSE_API_DOCSWhether to expose the FastAPI /docs page.True

Database​

VariableDescriptionDefault
LLM_D_BENCH_DB_MODEembedded (bundled Postgres) or external.embedded when LLM_D_BENCH_DATABASE_URL is unset; otherwise external
LLM_D_BENCH_DATABASE_URLConnection string when using an external database.— (required, no default)
LLM_D_BENCH_EMBEDDED_DB_DIR / LLM_D_BENCH_EMBEDDED_DB_PASSWORDData directory and password for the embedded database.LLM_D_BENCH_EMBEDDED_DB_DIR: ~/.llm-d-lens/db/data
LLM_D_BENCH_EMBEDDED_DB_PASSWORD: — (required, no default)
LLM_D_BENCH_DB_BOOTSTRAP_FILEOptional SQL/seed file applied on first bootstrap.~/.llm-d-lens/db-bootstrap.json

Model Service gateway (shared llm-d Gateway)​

Gateway Mode: the cluster installs one shared Gateway (provider-selectable at cluster creation); model services publish HTTPRoute/IPP resources against it. Lens keeps no Edge proxy or tunnel.

VariableDescriptionDefault
LENS_MODEL_GATEWAY_PUBLIC_URLA single public URL callers use for every cluster's Gateway (overrides the per-cluster URL).""
LENS_PUBLIC_HOSTHostname/IP external clients use to reach the Lens host; combined with each cluster's exposed port for the Gateway URL. Defaults to the request host.""
LENS_GATEWAY_SERVICE_TYPESets the Gateway data-plane Service type for clusters without a LoadBalancer (e.g. local kind). LoadBalancer, NodePort, or ClusterIP; unset keeps the provider default. Rendered through the provider's own mechanism: an EnvoyProxy for Envoy AI Gateway, a ConfigMap infrastructure.parametersRef for Istio.unset
LENS_NODE_SYSCTL_IMAGEImage the node-sysctl DaemonSet runs to set fs.inotify.max_user_instances on every node (needs sh/nsenter/sysctl); override when a cluster cannot pull the default.busybox:1.36
LENS_MODEL_HEALTH_INTERVAL_SECONDSHow often published providers are health-checked (each run re-probes HTTPRoute / InferencePool / EPP / model server).10
LENS_MODEL_RECONCILE_INTERVAL_SECONDSHow often the shared Gateway and model routes are reconciled automatically.300
LENS_GATEWAY_EXPOSURE_INTERVAL_SECONDSHow often Lens re-establishes the public 0.0.0.0 tunnel for each cluster's exposed Gateway port.60
LENS_GATEWAY_USAGE_INTERVAL_SECONDSHow often Lens syncs llm-d EPP token counters from each cluster's Prometheus into the usage ledger. Set 0 to disable.60
LENS_WELCOME_CHECK_INTERVAL_SECONDSHow often Lens refreshes and stores the Welcome page issue snapshot. Set 0 to disable the background check.60
LENS_MODEL_GATEWAY_AUTHZ_HOSTFallback Lens ext_authz address when a cluster leaves its per-cluster Lens authz address unset. Prefer the per-cluster value (create/edit cluster form → GET /api/cluster/lens-hosts). When set, the Gateway injects the caller identity (x-llm-d-inference-fairness-id) for per-user usage.(unset)
LENS_MODEL_GATEWAY_AUTHZ_PORTPort of the Lens ext_authz backend used by the Gateway.8081

The Inference Payload Processor's Helm chart and version are not environment-configurable — they're fixed constants in llm_d_lens/versions/__init__.py (oci://ghcr.io/llm-d/charts/payload-processor) and the pinned version in llm_d_lens/versions/llm_d_stack.yaml.

Storage and cache paths​

VariableDescriptionDefault
MODEL_CACHE_DIRWhere downloaded model weights are cached per cluster.~/.llm-d-bench/model-cache (legacy import fallback)
STORAGE_VOLUME_DIRRoot for managed storage volumes.~/.cache/llm-d-bench/storage (legacy import fallback)
AI_PROVIDER_DIRWhere external-provider configuration is persisted.~/.cache/llm-d-bench/ai-providers (legacy import fallback)
LENS_RUNTIME_DIR / LENS_SCRATCH_DIRRuntime/scratch directories for backend-managed processes (port-forwards, temp files).LENS_RUNTIME_DIR: $XDG_RUNTIME_DIR/lens if XDG_RUNTIME_DIR is set; otherwise ~/.cache/lens/tmp/runtime
LENS_SCRATCH_DIR: ~/.cache/lens/tmp
HF_TOKENHugging Face token used to download gated models.— (required, no default)

Evaluation, simulation and agentic planning​

VariableDescriptionDefault
LLM_D_BENCH_EVALUATE_STORERoot directory for evaluation task artifacts.~/.llm_d_lens/run_store/evaluate (legacy import fallback)
CONFIGURATION_ARTIFACT_DIR / CONFIGURATION_OUTPUT_DIRWhere rendered evaluation configurations are written.CONFIGURATION_ARTIFACT_DIR: ~/.cache/llm-d-bench/configurations/.artifacts (legacy import fallback)
CONFIGURATION_OUTPUT_DIR: ~/.cache/llm-d-bench/configurations (legacy import fallback)
SIMULATION_TASK_ROOTRoot directory for simulation task state and traces.~/.cache/llm-d-bench/simulations (legacy import fallback)
SIMULATION_MAX_CONCURRENT_DOWNLOADSCaps concurrent trace/asset downloads during simulation.1
AGENTIC_OPENAI_BASE_URL / AGENTIC_OPENAI_API_KEY / AGENTIC_OPENAI_MODEL / AGENTIC_OPENAI_TIMEOUT_SECONDSDefault chat model used by agentic deployment planning when no per-request provider is chosen.AGENTIC_OPENAI_BASE_URL: ""
AGENTIC_OPENAI_API_KEY: ""
AGENTIC_OPENAI_MODEL: ""
AGENTIC_OPENAI_TIMEOUT_SECONDS: 30
LLM_D_BENCHMARK_ROOT / LLM_D_BENCH_SPECIFICATION_FILELocation of the llm-d-benchmark checkout and its specification file used to drive benchmark runs.LLM_D_BENCHMARK_ROOT: ""
LLM_D_BENCH_SPECIFICATION_FILE: guides/optimized-baseline for baseline/default runs; otherwise computed from the selected guide when unset

Kubernetes and networking​

VariableDescriptionDefault
TARGET_NODEOptional node constraint for scripts/lens-local.sh check/start/restart; overridden by --target-node. Exported to backend/Node as PRISM_K8S_TARGET_NODE.unset; falls back to PRISM_K8S_TARGET_NODE
KUBECONFIGFallback kubeconfig when a cluster-specific one isn't registered. The local launcher accepts --kubeconfig FILE as an override.Kubernetes configuration lookup, normally $HOME/.kube/config
PRISM_GPU_PCI_ALLOWLISTOptional explicit comma-separated PCI restriction. The local launcher preserves it; hardware discovery remains in the backend.unset
PRISM_KUBERNETES_BACKEND / PRISM_KUBERNETES_READ_BACKENDSelects which Kubernetes client implementation serves writes/reads.PRISM_KUBERNETES_BACKEND: sdk
PRISM_KUBERNETES_READ_BACKEND: sdk
LLM_D_BENCH_DEPLOY_RUNTIME_ENABLEDEnables local deployment resource creation. Set to false for a read-only process.true
LLM_D_ROOTLocal llm-d checkout containing guides/.$LENS_CACHE_DIR/llm-d in local development
LLM_D_BENCH_KUBECTL_PATH / LLM_D_BENCH_HELM_PATH / LLM_D_BENCH_DOCKER_PATHOptional explicit executable paths for deployment tooling.discovered from PATH
LLM_D_BENCH_NAMESPACE_PREFIXPrefix for namespaces created by the deployment runtime.llmd-
LLM_D_BENCH_READINESS_TIMEOUT_SECONDS / LLM_D_BENCH_KUBECTL_TIMEOUT_SECONDSDeployment readiness and command timeouts.900 / 300
LLM_D_BENCH_RETAIN_NAMESPACE_ON_FAILURERetains failed deployment namespaces for troubleshooting.true
PRISM_MODEL_API_PUBLIC_HOSTOptional externally reachable host for Model API port-forward listeners."" (localhost only)
HTTP_PROXY / HTTPS_PROXY / NO_PROXYStandard proxy variables; the backend always adds each cluster's own API server host to NO_PROXY regardless of what's inherited, to avoid tunneling cluster-local traffic through an outbound proxy.HTTP_PROXY: ""
HTTPS_PROXY: ""
NO_PROXY: ""
LENS_TRUSTED_AI_PROVIDER_PROXYOptional exact HTTPS proxy URL for external AI providers. When unset, an inherited HTTPS_PROXY/ALL_PROXY is trusted by default so the original hostname and SNI are sent through it. A mismatched value keeps application-side IP pinning.unset

The local launcher does not load a target-node configuration file or inject LLM_D_BENCH_* defaults. These deployment defaults belong to the backend; explicit environment overrides still work. See CLI Reference for target-node preflight and argument precedence.

Kubernetes backend selection​

ConfigurationRecognized readsSupported writes
Neither backend variable setSDKSDK
PRISM_KUBERNETES_BACKEND=sdkSDKSDK
PRISM_KUBERNETES_BACKEND=cliCLICLI
Only PRISM_KUBERNETES_READ_BACKEND=sdkSDKCLI
Only PRISM_KUBERNETES_READ_BACKEND=cliCLICLI

The full backend variable overrides the legacy read-only variable. Invalid values fail. Restart the backend after changing its environment. Dependencies come from apps/backend/pyproject.toml; from the repository root install them in the backend environment with pip install -e apps/backend.

Unsupported command forms choose CLI before execution; an SDK request failure never retries through CLI. Keep kubectl installed: client-side apply, Helm/Kustomize, exec, port-forward, streaming/workload-selector logs, unsupported rollout/wait and advanced flags retain CLI behavior. SDK mode does not eliminate those tools or guarantee remote API reachability.

Grep os.environ.get(...)/os.getenv(...) under apps/backend/src/llm_d_lens/ for the full, authoritative list — this page covers the ones you're most likely to need to set.