CosmicAC Logo
Configuration reference

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.

VariableDescription
TAGRelease 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_USERGitHub username for GitHub Container Registry (GHCR).
GITHUB_PATGitHub personal access token (PAT) for GHCR. The token needs the read:packages scope.
KUBECONFIG_SRCAbsolute host path to the kubeconfig file. task config-init stops if the path is relative, missing, unreadable, or empty. See Kubeconfig requirements.
K8S_RACK_IDIdentifier for the rack task register-rack registers with the orchestrator, for example rack-0.
K8S_RACK_LOCATIONLocation code reported for the rack, for example PT. The job creation form offers it as a location.
K8S_GPU_PRICEHourly 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.

VariableDescription
REGISTRYRegistry host the CosmicAC images come from. Defaults to ghcr.io.
OWNERRegistry namespace that holds the CosmicAC images. Defaults to tetherto.
APPNODE_TAGImage tag for cosmicac-app-node. When set, it replaces TAG for that service.
WRKORK_TAGImage tag for cosmicac-wrk-ork. When set, it replaces TAG for that service.
PROXY_TAGImage tag for cosmicac-proxy-inference. When set, it replaces TAG for both its HTTP and HRPC containers.
K8S_TAGImage tag for cosmicac-wrk-server-k8s-nvidia. When set, it replaces TAG for that service.
MONITOR_TAGImage tag for cosmicac-wrk-monitor. When set, it replaces TAG for that service.
UI_TAGImage tag for cosmicac-ui. When set, it replaces TAG for that service.
DEV_TAGImage tag that ./compose-deploy.sh --env dev deploys. When blank, the command uses TAG.
STG_TAGImage tag that ./compose-deploy.sh --env stg deploys. When blank, the command uses TAG.
PRD_TAGImage tag that ./compose-deploy.sh --env prd deploys. When blank, the command uses TAG.
DATA_ROOTHost directory that holds each service's config and state. Defaults to ./services.
UI_PORTHost 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_PLATFORMPlatform the deployment pulls images for, for example linux/amd64.
CONTAINER_UIDUser ID the containers run as. Use 0 for rootless Docker, or the host user's ID for rootful Docker.
CONTAINER_GIDGroup ID the containers run as. Use 0 for rootless Docker, or the host group's ID for rootful Docker.
WORKER_ENVDefault 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.

VariableDescription
K8S_NAMESPACENamespace 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_KUBECONFIGPath 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_TYPEWorker process the image runs. The image ships one, wrk-server-rack-kv.
K8S_WORKER_ENVEnvironment name the worker runs under, which selects its config. Overrides WORKER_ENV. .env.example sets development.
K8S_WORKER_ARGSArguments 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_TOPICHyperMQ 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_NODEGPUs 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_NAMEInfiniBand 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_METHODPull 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.

VariableDescription
K8S_VMI_IMAGEKubeVirt image every job's virtual machine boots from. Defaults to ghcr.io/tetherto/kubevirt-image:latest.
K8S_GPU_CONTAINER_IMAGEAgent image for GPU Container Jobs. Defaults to ghcr.io/tetherto/cosmicac-wrk-agent-instance:latest.
K8S_INFERENCE_AGENT_IMAGEAgent 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_IMAGEvLLM 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_IMAGEParakeet 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_SIZERoot 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.

VariableDescription
WRKORK_WORKER_TYPEWorker the cosmicac-wrk-ork image runs. Defaults to wrk-ork-proc-aggr.
WRKORK_WORKER_ENVEnvironment name cosmicac-wrk-ork runs under, which selects its config. Overrides WORKER_ENV. .env.example sets development.
WRKORK_WORKER_ARGSArguments 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_TYPEWorker the cosmicac-app-node image runs. Defaults to wrk-node-http.
APPNODE_WORKER_ENVEnvironment name cosmicac-app-node runs under, which selects its config. Overrides WORKER_ENV, which itself defaults to production.
APPNODE_WORKER_ARGSArguments 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_PORTPort 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_TYPEWorker the cosmicac-proxy-inference HTTP container runs. Defaults to wrk-proxy-http.
PROXY_HTTP_WORKER_ENVEnvironment name the cosmicac-proxy-inference HTTP container runs under, which selects its config. Overrides WORKER_ENV, which itself defaults to production.
PROXY_HTTP_PORTPort the cosmicac-proxy-inference HTTP container listens on. Keep it at 8000, because the Caddyfile proxies /inference to that port.
PROXY_HTTP_EXTRA_ARGSExtra arguments for the cosmicac-proxy-inference HTTP container, appended after the --autobase key. .env.example leaves it empty.
PROXY_HRPC_WORKER_TYPEWorker the cosmicac-proxy-inference HRPC container runs. Defaults to wrk-proxy-hrpc.
PROXY_HRPC_WORKER_ENVEnvironment name the cosmicac-proxy-inference HRPC container runs under, which selects its config. Overrides WORKER_ENV, which itself defaults to production.
PROXY_HRPC_INSTANCE_IDInstance number the HRPC container takes as --instanceId. Defaults to 1.
PROXY_TOPIC_CRYPTO_ALGOAlgorithm 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_TYPEWorker the cosmicac-wrk-monitor image runs. Defaults to wrk-monitor-node.
MONITOR_WORKER_ENVEnvironment name cosmicac-wrk-monitor runs under, which selects its config. Defaults to development.
MONITOR_WORKER_ARGSArguments passed to cosmicac-wrk-monitor. .env.example leaves it empty. The monitor takes its settings from config/common.json.
MONITOR_HTTP_PORTPort 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_HOSTHost 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_PORTPort 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_PASSWORDPassword 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_DBLogical 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.

VariableEffect
MONITOR_COMMON_CONFIG__secretKeyThe 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__topicThe 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__metricsScrapeTokenBearer token Prometheus must send to scrape /metrics. A blank value leaves that route open.
APPNODE_FACS_CONFIG__LOGGING__l0__transport__enabledTurns log shipping on for cosmicac-app-node.
APPNODE_FACS_CONFIG__LOGGING__l0__transport__topicTopic cosmicac-app-node publishes its logs to.
APPNODE_FACS_CONFIG__LOGGING__l0__transport__secretKeyShared secret cosmicac-app-node uses for that topic.
WRKORK_FACS_CONFIG__LOGGING__l0__transport__enabledTurns log shipping on for cosmicac-wrk-ork.
WRKORK_FACS_CONFIG__LOGGING__l0__transport__topicTopic cosmicac-wrk-ork publishes its logs to.
WRKORK_FACS_CONFIG__LOGGING__l0__transport__secretKeyShared secret cosmicac-wrk-ork uses for that topic.
K8S_FACS_CONFIG__LOGGING__l0__transport__enabledTurns log shipping on for cosmicac-wrk-server-k8s-nvidia.
K8S_FACS_CONFIG__LOGGING__l0__transport__topicTopic cosmicac-wrk-server-k8s-nvidia publishes its logs to.
K8S_FACS_CONFIG__LOGGING__l0__transport__secretKeyShared secret cosmicac-wrk-server-k8s-nvidia uses for that topic.
PROXY_FACS_CONFIG__LOGGING__l0__transport__enabledTurns log shipping on for cosmicac-proxy-inference.
PROXY_FACS_CONFIG__LOGGING__l0__transport__topicTopic cosmicac-proxy-inference publishes its logs to.
PROXY_FACS_CONFIG__LOGGING__l0__transport__secretKeyShared secret cosmicac-proxy-inference uses for that topic.
PROXY_FACS_CONFIG_METRICS_REPLACE_JSONMetrics 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__enabledTurns telemetry on for every job's inference agent.
WRKORK_FACS_CONFIG__JOBS__j0__telemetry__topicTopic every job's inference agent publishes to.
WRKORK_FACS_CONFIG__JOBS__j0__telemetry__secretKeyShared 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.

VariableDescription
PROXY_AUTOBASE_KEYAutobase key that links cosmicac-proxy-inference to cosmicac-app-node. task wire sets it.
PROXY_AGENT_INFERENCE_TOPICTopic the per-job inference agents publish on.
PROXY_TOPIC_CAPABILITYHandshake secret for that topic.
PROXY_TOPIC_CRYPTO_KEYSigning 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.

VariableDescription
BOOTSTRAP_ADMIN_EMAILSign-in address for the account task seed-admin creates. Set it with BOOTSTRAP_ADMIN_PASSWORD, or leave both blank.
BOOTSTRAP_ADMIN_PASSWORDPassword for that account. Set it with BOOTSTRAP_ADMIN_EMAIL, or leave both blank.
BOOTSTRAP_ADMIN_ROLESComma-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.

An override takes one of these forms.

VariableEffect
<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_JSONSets 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_JSONSets each value in a JSON object, in config/facs/<file>.
<PREFIX>_FACS_CONFIG_<FILE>_REPLACE_JSONReplaces 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.

ServiceFileWhat task wire writes
cosmicac-app-nodeconfig/common.jsonThe orks block, replaced rather than merged, and proxyInferenceRpcKey.
cosmicac-proxy-inferenceconfig/common.jsonapiKeySecret, copied from cosmicac-app-node.
cosmicac-wrk-orkconfig/facs/jobs.config.jsonThe message queue topic and the inference settings.
cosmicac-wrk-server-k8s-nvidiaconfig/common.jsonThe message queue, interconnect, and inference blocks.
cosmicac-wrk-server-k8s-nvidiaconfig/kube.config.jsonThe default namespace.
cosmicac-app-node, cosmicac-wrk-ork, and cosmicac-wrk-server-k8s-nvidiaconfig/facs/net.config.jsonThe RPC keys allowed to connect, and allowLocal.
The deployment.envPROXY_AUTOBASE_KEY.

task bootstrap also runs task wire-monitor, which writes three more values.

  • The monitorService block in the config/common.json of cosmicac-app-node, replaced rather than merged.
  • The RPC keys allowed to connect, in the config/facs/net.config.json of 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.

KeyDescription
checkIntervalMsHow 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.
bucketIntervalMsHow 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.
healthySuccessRatePctMinimum 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.
downThresholdMsHow 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.
periodSampleCountHow 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.
debugPeriodSamplesWhether 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.

ProfileUsed forRequest
textLanguage modelsA one-token chat completion.
visionModels that accept image or video inputA one-token chat completion with a small image attached.
audioSpeech-to-text modelsA transcription request carrying an audio file.

Each profile takes the following keys.

KeyDescription
methodHTTP method CosmicAC uses, such as POST.
pathPath CosmicAC calls on the replica, such as /v1/chat/completions.
payloadJSON body CosmicAC sends for the text and vision profiles.
timeoutMsHow long CosmicAC waits for the replica before the probe fails. Defaults to 60000, or one minute.
successStatusCodesStatus codes that count as a passing probe. Defaults to 200.
imageBase64Image the vision profile attaches, as a base64 string.
audioUrlOptional. URL of the file the audio profile transcribes.
filenameOptional. 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 *-data fields, because task config-init reads this file alone. It can't follow a file reference such as certificate-authority, client-certificate, or client-key.
  • The file stays on your host, and no image contains it.

On this page