Deployment configuration
Deployment environment variables and kubeconfig requirements for CosmicAC.
Configure a CosmicAC deployment with environment variables in .env and a kubeconfig file. For the deployment steps, see Deploy CosmicAC.
Copy .env.example to .env in the deployment directory, then set the variables your deployment needs. The values on this page are the ones .env.example ships.
A default deployment runs without authentication
.env.example starts cosmicac-app-node with --noauth true, and the web interface ships with its login routes turned off. Every API request succeeds without a token, and the interface opens without a sign-in. Restrict network access to the deployment.
Required before the first deployment
Set these before you run task bootstrap for the first time. It uses them to pull the service images, build the worker's Kubernetes config, and register your rack.
| Variable | Description |
|---|---|
| TAG | Release image tag for every CosmicAC service image, for example release-1.1.0. A per-service tag such as APPNODE_TAG overrides it for that service. |
| GITHUB_USER | GitHub username for GitHub Container Registry (GHCR). |
| GITHUB_PAT | GitHub personal access token (PAT) for GHCR. The token needs the read:packages scope. |
| KUBECONFIG_SRC | Absolute host path to the kubeconfig file. task config-init stops if the path is relative, missing, unreadable, or empty. See Kubeconfig requirements. |
| K8S_RACK_ID | Identifier for the rack task register-rack registers with the orchestrator, for example rack-0. |
| K8S_RACK_LOCATION | Location code reported for the rack, for example PT. The job creation form offers it as a location. |
| K8S_GPU_PRICE | Hourly price per GPU. task register-rack and task migrate-pricing read it. Defaults to 1. |
Deployment layout
These settings decide where the deployment pulls its images from, where it keeps state on your host, and which port it serves on. Each one has a default, so set only what your host needs.
| Variable | Description |
|---|---|
| REGISTRY | Registry host the CosmicAC images come from. Defaults to ghcr.io. |
| OWNER | Registry namespace that holds the CosmicAC images. Defaults to tetherto. |
| APPNODE_TAG | Image tag for cosmicac-app-node. When set, it replaces TAG for that service. |
| WRKORK_TAG | Image tag for cosmicac-wrk-ork. When set, it replaces TAG for that service. |
| PROXY_TAG | Image tag for cosmicac-proxy-inference. When set, it replaces TAG for both its HTTP and HRPC containers. |
| K8S_TAG | Image tag for cosmicac-wrk-server-k8s-nvidia. When set, it replaces TAG for that service. |
| MONITOR_TAG | Image tag for cosmicac-wrk-monitor. When set, it replaces TAG for that service. |
| UI_TAG | Image tag for cosmicac-ui. When set, it replaces TAG for that service. |
| DEV_TAG | Image tag that ./compose-deploy.sh --env dev deploys. When blank, the command uses TAG. |
| STG_TAG | Image tag that ./compose-deploy.sh --env stg deploys. When blank, the command uses TAG. |
| PRD_TAG | Image tag that ./compose-deploy.sh --env prd deploys. When blank, the command uses TAG. |
| DATA_ROOT | Host directory that holds each service's config and state. Defaults to ./services. |
| UI_PORT | Host port for the whole deployment. Caddy serves the web interface there. It proxies /api to cosmicac-app-node, /inference to cosmicac-proxy-inference, and /monitor to cosmicac-wrk-monitor. Defaults to 5173. |
| DOCKER_PLATFORM | Platform the deployment pulls images for, for example linux/amd64. |
| CONTAINER_UID | User ID the containers run as. Use 0 for rootless Docker, or the host user's ID for rootful Docker. |
| CONTAINER_GID | Group ID the containers run as. Use 0 for rootless Docker, or the host group's ID for rootful Docker. |
| WORKER_ENV | Default environment name for services that don't set their own. Defaults to production. |
If you pass a tag on the command line, as in task update TAG=release-1.2.0, that run clears APPNODE_TAG, WRKORK_TAG, PROXY_TAG, K8S_TAG, and UI_TAG.
./compose-deploy.sh --env dev, --env stg, and --env prd read DEV_TAG, STG_TAG, or PRD_TAG instead, and leave the per-service tags in place. Any other value stops the command. The task commands pass no environment, so they always read TAG.
Kubernetes worker
The Kubernetes worker, cosmicac-wrk-server-k8s-nvidia, connects to your cluster's Kubernetes API and creates the resources each job needs. This section calls it the worker.
| Variable | Description |
|---|---|
| K8S_NAMESPACE | Namespace the worker creates job resources in. task wire writes it into config/kube.config.json. The namespace must already exist in the cluster. .env.example sets cosmic-ac. |
| K8S_KUBECONFIG | Path inside the worker container where task config-init copies KUBECONFIG_SRC, then converts it into the config/kube.config.json the worker reads. The directory is always the read-only /app/kube mount, so only the filename varies. Defaults to /app/kube/config. .env.example sets /app/kube/dev. |
| K8S_WORKER_TYPE | Worker process the image runs. The image ships one, wrk-server-rack-kv. |
| K8S_WORKER_ENV | Environment name the worker runs under, which selects its config. Overrides WORKER_ENV. .env.example sets development. |
| K8S_WORKER_ARGS | Arguments appended to the worker's command. "--rack rack-0" names the rack the worker serves. The name also appears in the status file that task bootstrap waits for, wrk-server-rack-kv-rack-0.json. |
| K8S_MQ_TOPIC | HyperMQ topic that carries job workflow messages between cosmicac-wrk-ork and the worker. task wire writes it into both configs, in the form job-workflow-<env>. .env.example sets job-workflow-dev. |
| K8S_GPU_PER_NODE | GPUs each node in the rack holds, which sets how many nodes a replica spans. At 8, a 16-GPU replica takes two nodes. CosmicAC rejects a larger count that doesn't fill whole nodes. .env.example sets 8. |
| K8S_IB_NAME | InfiniBand resource a multi-node replica requests as mellanox.com/<name>, one for each GPU on every node the replica spans. The name must match what your nodes advertise. A single-node replica requests none. .env.example sets cx7_ib_pf. |
| K8S_DV_PULL_METHOD | Pull method CDI uses for a job's root disk image, either pod or node. With node, the import reads from the kubelet cache and starts sooner, but it needs an image every candidate node can pull anonymously or already holds. Any other value stops the worker from starting. .env.example sets pod. |
Job images and defaults
These settings are the image and disk defaults for jobs on your cluster. TAG applies only to the CosmicAC services on your host, so upgrading the stack doesn't change the images in this table. task wire writes these values into config/common.json for cosmicac-wrk-server-k8s-nvidia. task bootstrap and task update both run task wire.
| Variable | Description |
|---|---|
| K8S_VMI_IMAGE | KubeVirt image every job's virtual machine boots from. Defaults to ghcr.io/tetherto/kubevirt-image:latest. |
| K8S_GPU_CONTAINER_IMAGE | Agent image for GPU Container Jobs. Defaults to ghcr.io/tetherto/cosmicac-wrk-agent-instance:latest. |
| K8S_INFERENCE_AGENT_IMAGE | Agent image for every Managed Inference Job. One image serves vLLM and Parakeet. Defaults to ghcr.io/tetherto/cosmicac-wrk-agent-inference-agent:latest. |
| K8S_NESTED_VLLM_IMAGE | vLLM runtime image the inference agent runs inside the job's virtual machine. A job that carries its own runtime image overrides it. .env.example sets vllm/vllm-openai:v0.15.0. |
| K8S_NESTED_PARAKEET_IMAGE | Parakeet runtime image the inference agent runs inside the job's virtual machine. A job that carries its own runtime image overrides it. .env.example sets ghcr.io/tetherto/cosmicac-asr-image:latest. |
| K8S_DEFAULT_ROOT_DISK_SIZE | Root disk size for a job that requests none. Use a binary unit, for example 100Gi. |
Service settings
These variables configure the CosmicAC services on your host. .env.example sets a working value for each one. If a value doesn't suit your deployment, change it in .env.
| Variable | Description |
|---|---|
| WRKORK_WORKER_TYPE | Worker the cosmicac-wrk-ork image runs. Defaults to wrk-ork-proc-aggr. |
| WRKORK_WORKER_ENV | Environment name cosmicac-wrk-ork runs under, which selects its config. Overrides WORKER_ENV. .env.example sets development. |
| WRKORK_WORKER_ARGS | Arguments passed to cosmicac-wrk-ork. .env.example sets "--cluster cluster-0". That value names the cluster the service serves and its directory under store/. It also appears in the status file that task bootstrap waits for, wrk-ork-proc-aggr-cluster-0.json. |
| APPNODE_WORKER_TYPE | Worker the cosmicac-app-node image runs. Defaults to wrk-node-http. |
| APPNODE_WORKER_ENV | Environment name cosmicac-app-node runs under, which selects its config. Overrides WORKER_ENV, which itself defaults to production. |
| APPNODE_WORKER_ARGS | Arguments passed to cosmicac-app-node. Defaults to "--host 0.0.0.0 --noauth true". That binds the API to every interface in the container and turns authentication off. |
| APPNODE_PORT | Port cosmicac-app-node listens on. Keep it at 3000. The Caddyfile proxies /api to that port, and task wire, task seed-admin, and task autobase-connect read status/wrk-node-http-3000.json. |
| PROXY_HTTP_WORKER_TYPE | Worker the cosmicac-proxy-inference HTTP container runs. Defaults to wrk-proxy-http. |
| PROXY_HTTP_WORKER_ENV | Environment name the cosmicac-proxy-inference HTTP container runs under, which selects its config. Overrides WORKER_ENV, which itself defaults to production. |
| PROXY_HTTP_PORT | Port the cosmicac-proxy-inference HTTP container listens on. Keep it at 8000, because the Caddyfile proxies /inference to that port. |
| PROXY_HTTP_EXTRA_ARGS | Extra arguments for the cosmicac-proxy-inference HTTP container, appended after the --autobase key. .env.example leaves it empty. |
| PROXY_HRPC_WORKER_TYPE | Worker the cosmicac-proxy-inference HRPC container runs. Defaults to wrk-proxy-hrpc. |
| PROXY_HRPC_WORKER_ENV | Environment name the cosmicac-proxy-inference HRPC container runs under, which selects its config. Overrides WORKER_ENV, which itself defaults to production. |
| PROXY_HRPC_INSTANCE_ID | Instance number the HRPC container takes as --instanceId. Defaults to 1. |
| PROXY_TOPIC_CRYPTO_ALGO | Algorithm that signs the agent inference topic. task config-init writes it into the cosmicac-proxy-inference config/common.json. Defaults to hmac-sha384. |
| MONITOR_WORKER_TYPE | Worker the cosmicac-wrk-monitor image runs. Defaults to wrk-monitor-node. |
| MONITOR_WORKER_ENV | Environment name cosmicac-wrk-monitor runs under, which selects its config. Defaults to development. |
| MONITOR_WORKER_ARGS | Arguments passed to cosmicac-wrk-monitor. .env.example leaves it empty. The monitor takes its settings from config/common.json. |
| MONITOR_HTTP_PORT | Port cosmicac-wrk-monitor listens on for metrics and log endpoints, and the host port Compose publishes. Keep it at 9110, because the Caddyfile proxies /monitor to that port. |
| REDIS_HOST | Host of the Redis instance. .env.example sets it to the bundled redis service. cosmicac-app-node takes the host from the redis block of its config/common.json, so change it with APPNODE_COMMON_CONFIG__redis__host. |
| REDIS_PORT | Port of the Redis instance. .env.example sets it to 6379. cosmicac-app-node takes the port from the same config block, so change it with APPNODE_COMMON_CONFIG__redis__port. |
| REDIS_PASSWORD | Password the bundled redis requires. .env.example leaves it empty. cosmicac-app-node sends the password from its own config, so set APPNODE_COMMON_CONFIG__redis__password to match. |
| REDIS_DB | Logical database number cosmicac-app-node selects. .env.example sets it to 0. The number comes from the same config block, so change it with APPNODE_COMMON_CONFIG__redis__db. |
Telemetry
cosmicac-wrk-monitor collects logs and metrics from the other services. Each service that sends them is a producer, and every producer starts switched off. All producers share one topic, and a shared secret protects it.
| Variable | Effect |
|---|---|
| MONITOR_COMMON_CONFIG__secretKey | The cosmicac-wrk-monitor copy of the shared secret. task bootstrap and task config-init generate it when you leave it blank, then write it into .env. |
| MONITOR_COMMON_CONFIG__topic | The cosmicac-wrk-monitor copy of the shared topic. The same two commands generate it when you leave it blank, then write it into .env. |
| MONITOR_COMMON_CONFIG__metricsScrapeToken | Bearer token Prometheus must send to scrape /metrics. A blank value leaves that route open. |
| APPNODE_FACS_CONFIG__LOGGING__l0__transport__enabled | Turns log shipping on for cosmicac-app-node. |
| APPNODE_FACS_CONFIG__LOGGING__l0__transport__topic | Topic cosmicac-app-node publishes its logs to. |
| APPNODE_FACS_CONFIG__LOGGING__l0__transport__secretKey | Shared secret cosmicac-app-node uses for that topic. |
| WRKORK_FACS_CONFIG__LOGGING__l0__transport__enabled | Turns log shipping on for cosmicac-wrk-ork. |
| WRKORK_FACS_CONFIG__LOGGING__l0__transport__topic | Topic cosmicac-wrk-ork publishes its logs to. |
| WRKORK_FACS_CONFIG__LOGGING__l0__transport__secretKey | Shared secret cosmicac-wrk-ork uses for that topic. |
| K8S_FACS_CONFIG__LOGGING__l0__transport__enabled | Turns log shipping on for cosmicac-wrk-server-k8s-nvidia. |
| K8S_FACS_CONFIG__LOGGING__l0__transport__topic | Topic cosmicac-wrk-server-k8s-nvidia publishes its logs to. |
| K8S_FACS_CONFIG__LOGGING__l0__transport__secretKey | Shared secret cosmicac-wrk-server-k8s-nvidia uses for that topic. |
| PROXY_FACS_CONFIG__LOGGING__l0__transport__enabled | Turns log shipping on for cosmicac-proxy-inference. |
| PROXY_FACS_CONFIG__LOGGING__l0__transport__topic | Topic cosmicac-proxy-inference publishes its logs to. |
| PROXY_FACS_CONFIG__LOGGING__l0__transport__secretKey | Shared secret cosmicac-proxy-inference uses for that topic. |
| PROXY_FACS_CONFIG_METRICS_REPLACE_JSON | Metrics settings for cosmicac-proxy-inference, which live in their own facility file. Give the whole file as JSON, including enabled, topic, and secretKey. |
| WRKORK_FACS_CONFIG__JOBS__j0__telemetry__enabled | Turns telemetry on for every job's inference agent. |
| WRKORK_FACS_CONFIG__JOBS__j0__telemetry__topic | Topic every job's inference agent publishes to. |
| WRKORK_FACS_CONFIG__JOBS__j0__telemetry__secretKey | Shared secret every job's inference agent uses for that topic. |
Every producer must use the same secret and topic as cosmicac-wrk-monitor. If one differs, that producer keeps running, but its logs and metrics never reach the monitor.
An inference agent has no telemetry variable of its own. The WRKORK_FACS_CONFIG__JOBS__j0__telemetry variables are the only way to switch its telemetry on. cosmicac-wrk-ork passes the three values into each job as TELEMETRY_ENABLED, TELEMETRY_TOPIC, and TELEMETRY_SECRET_KEY.
After you change any of these, apply the service's config and restart the service. See Task deployment commands for the apply command each service takes.
task bootstrap also runs task wire-monitor, which gives cosmicac-app-node and cosmicac-wrk-monitor each other's RPC keys. If bootstrap reported that the monitor wasn't ready, run task wire-monitor yourself.
Generated values
Leave these blank on a first deployment.
task config-init reads the three topic variables in this section. If one is blank, the command generates a value, writes it into the config/common.json of cosmicac-proxy-inference, and leaves .env unchanged. If you set one yourself, the command keeps your value.
PROXY_AUTOBASE_KEY is the exception. task wire reads it from the running cosmicac-app-node and writes it into .env.
| Variable | Description |
|---|---|
| PROXY_AUTOBASE_KEY | Autobase key that links cosmicac-proxy-inference to cosmicac-app-node. task wire sets it. |
| PROXY_AGENT_INFERENCE_TOPIC | Topic the per-job inference agents publish on. |
| PROXY_TOPIC_CAPABILITY | Handshake secret for that topic. |
| PROXY_TOPIC_CRYPTO_KEY | Signing key for that topic. |
Optional administrator account
A default deployment needs no administrator, because it runs with authentication turned off. These variables take effect only when you run task seed-admin, which task bootstrap doesn't run.
| Variable | Description |
|---|---|
| BOOTSTRAP_ADMIN_EMAIL | Sign-in address for the account task seed-admin creates. Set it with BOOTSTRAP_ADMIN_PASSWORD, or leave both blank. |
| BOOTSTRAP_ADMIN_PASSWORD | Password for that account. Set it with BOOTSTRAP_ADMIN_EMAIL, or leave both blank. |
| BOOTSTRAP_ADMIN_ROLES | Comma-separated roles for that account. Defaults to *, which grants full access. |
Config overrides
Each service reads its runtime config from the generated JSON files under services/<service>/config/, not from .env. An override variable in .env names one of those files and the values to set in it. Each service has its own apply command, such as task apply-app-node-common-config, and that command writes the values into the file. See Task deployment commands for all five.
Each service has its own prefix.
| Prefix | Service |
|---|---|
| APPNODE_ | cosmicac-app-node |
| PROXY_ | cosmicac-proxy-inference |
| WRKORK_ | cosmicac-wrk-ork |
| K8S_ | cosmicac-wrk-server-k8s-nvidia |
| MONITOR_ | cosmicac-wrk-monitor |
An override takes one of these forms.
| Variable | Effect |
|---|---|
| <PREFIX>_COMMON_CONFIG__<path> | Sets one value in common.json, with a double underscore for each level down, such as APPNODE_COMMON_CONFIG__pagination__limit=100. |
| <PREFIX>_COMMON_CONFIG_OVERRIDES_JSON | Sets each value in a JSON object, in common.json. |
| <PREFIX>_FACS_CONFIG__<FILE>__<path> | Sets one value in config/facs/<file>. |
| <PREFIX>_FACS_CONFIG_<FILE>_OVERRIDES_JSON | Sets each value in a JSON object, in config/facs/<file>. |
| <PREFIX>_FACS_CONFIG_<FILE>_REPLACE_JSON | Replaces the entire contents of config/facs/<file> with a JSON object. |
<FILE> names a file under config/facs/ in capitals, such as HTTPD_OAUTH2. The apply command converts that name to lowercase, turns each underscore into a hyphen, and adds .config.json, which gives config/facs/httpd-oauth2.config.json.
The apply command reads a value as JSON when the value is valid JSON, and as a string otherwise. A value of 100 writes a number and true writes a boolean, while cluster-0 writes a string. The command skips an empty variable, and that key keeps its current value.
task wire rewrites the values in the following table, and task bootstrap and task update both run it. If you overrode one of those values, the rewrite discards it. Run that service's apply command again to put it back, because .env still holds your variable. A K8S_COMMON_CONFIG override is the one exception, because task wire re-applies it after its own writes.
task wire writes the values in this table. An override on any other path survives.
| Service | File | What task wire writes |
|---|---|---|
| cosmicac-app-node | config/common.json | The orks block, replaced rather than merged, and proxyInferenceRpcKey. |
| cosmicac-proxy-inference | config/common.json | apiKeySecret, copied from cosmicac-app-node. |
| cosmicac-wrk-ork | config/facs/jobs.config.json | The message queue topic and the inference settings. |
| cosmicac-wrk-server-k8s-nvidia | config/common.json | The message queue, interconnect, and inference blocks. |
| cosmicac-wrk-server-k8s-nvidia | config/kube.config.json | The default namespace. |
| cosmicac-app-node, cosmicac-wrk-ork, and cosmicac-wrk-server-k8s-nvidia | config/facs/net.config.json | The RPC keys allowed to connect, and allowLocal. |
| The deployment | .env | PROXY_AUTOBASE_KEY. |
task bootstrap also runs task wire-monitor, which writes three more values.
- The
monitorServiceblock in theconfig/common.jsonof cosmicac-app-node, replaced rather than merged. - The RPC keys allowed to connect, in the
config/facs/net.config.jsonof cosmicac-wrk-monitor. - APPNODE_COMMON_CONFIG__monitorService__rpcPublicKey in .env.
Model health settings
cosmicac-proxy-inference measures the health of every Managed Inference endpoint and stores the results on disk. These settings live in the modelHealth block of its config/common.json, not in .env. To override one, use PROXY_COMMON_CONFIG__modelHealth__<key>, as described in Config overrides. task wire writes only apiKeySecret into that file, so an override on this block survives.
| Key | Description |
|---|---|
| checkIntervalMs | How often the proxy probes each replica. Defaults to 300000, or five minutes. Each probe is a small inference request, so it counts toward the endpoint's traffic, failures, and latency figures. |
| bucketIntervalMs | How wide each stored interval is, and how often the proxy writes the open interval to disk. Defaults to 300000, or five minutes. A wider interval writes less often and coarsens every chart. |
| healthySuccessRatePct | Minimum success rate a replica needs to stay Healthy, measured over the time range you select. Defaults to 95. A replica below that rate reports Degraded, and a replica at zero reports Down. |
| downThresholdMs | How long a replica must keep failing before it reports Down. It reports Degraded on the first failed probe. The shipped config sets 600000, or ten minutes, and without the key CosmicAC falls back to 300000. |
| periodSampleCount | How many points each chart series returns for a time range. Defaults to 12. For a short time range, CosmicAC returns every stored interval instead, so the points stay one interval apart. |
| debugPeriodSamples | Whether the model stats API returns each replica's raw sample timestamps and intervals. Turn it on to debug a chart. Defaults to false. |
healthySuccessRatePct and downThresholdMs set the thresholds that decide each replica's health. An endpoint reports Down only when every replica is down, and Degraded while at least one replica still serves requests. For the full status model, see Model health.
Every interval and threshold in this table is in milliseconds. A value of 0, or one that isn't a number, leaves the default in place. For example, setting checkIntervalMs to 0 doesn't turn probing off.
For what these metrics mean and where to read them, see Check Managed Inference endpoint health.
Health check probes
Each health check sends a real inference request to a replica. The request comes from a profile in the config/health-check-probes.json of cosmicac-proxy-inference. CosmicAC picks the profile from the model's input modalities.
| Profile | Used for | Request |
|---|---|---|
| text | Language models | A one-token chat completion. |
| vision | Models that accept image or video input | A one-token chat completion with a small image attached. |
| audio | Speech-to-text models | A transcription request carrying an audio file. |
Each profile takes the following keys.
| Key | Description |
|---|---|
| method | HTTP method CosmicAC uses, such as POST. |
| path | Path CosmicAC calls on the replica, such as /v1/chat/completions. |
| payload | JSON body CosmicAC sends for the text and vision profiles. |
| timeoutMs | How long CosmicAC waits for the replica before the probe fails. Defaults to 60000, or one minute. |
| successStatusCodes | Status codes that count as a passing probe. Defaults to 200. |
| imageBase64 | Image the vision profile attaches, as a base64 string. |
| audioUrl | Optional. URL of the file the audio profile transcribes. |
| filename | Optional. Filename CosmicAC sends with the generated audio file. |
CosmicAC uses audioUrl only when the value is a valid HTTP or HTTPS URL. For anything else, including an empty value, it generates a short silent audio file and uploads that instead. It logs a warning when you set a value it can't use.
No .env override reaches this file, because Config overrides write only to common.json and config/facs, and this file sits at the config root. Edit it directly, then restart the service, which reads the profiles at startup.
Kubeconfig requirements
The kubeconfig is a standard Kubernetes YAML file. You pass it to the deployment through KUBECONFIG_SRC. It must set current-context and contain clusters, users, and contexts.
apiVersion: v1
kind: Config
current-context: <context-name>
clusters:
- name: <cluster-name>
cluster:
server: https://<kubernetes-api>
certificate-authority-data: <base64-ca>
users:
- name: <user-name>
user:
client-certificate-data: <base64-certificate>
client-key-data: <base64-private-key>
contexts:
- name: <context-name>
context:
cluster: <cluster-name>
user: <user-name>Ask your cluster administrator for the file, or export one with kubectl config view --raw --flatten. That command writes the credentials in full instead of as file references.
- CosmicAC accepts certificate-based and token-based user credentials.
- Credentials must use the inline
*-datafields, becausetask config-initreads this file alone. It can't follow a file reference such ascertificate-authority,client-certificate, orclient-key. - The file stays on your host, and no image contains it.