CosmicAC Logo
Configuration referenceJob configurationManaged Inference Job

Managed Inference Job environment variables

Environment variables a Managed Inference Job reads, including vLLM flags and Parakeet server settings.

When a Managed Inference Job starts, the inference agent reads the job's environment variables. Each variable either sets a model server option or changes an agent setting, such as the startup timeout. This page lists the variables that each job type reads.

Where to set a variable

The job type determines where you can set a variable.

LocationSettingvLLM Managed Inference JobParakeet Managed Inference Job
Web interfaceEnvironment variables fieldYesNo
CLI--env flag of cosmicac jobs createYesNo
Model masterinference_param_overrides.env listYesYes

For a Parakeet job, cosmicac jobs create ignores the --env flag.

CosmicAC adds each variable in a model master's inference_param_overrides.env list to every new job for that model. If the job already sets a variable with the same name, CosmicAC keeps the job's value.

Startup timeout

When a job starts, CosmicAC waits a set time for the model server to become ready. If the model server isn't ready in that time, CosmicAC restarts it. The following variables set the timeout and the restart limit.

VariableDefaultDescription
DOCKER_STARTUP_TIMEOUT_MS1800000, or 30 minutesThe time, in milliseconds, that the model server has to become ready. On a multi-node vLLM job, the default is 3600000, or 60 minutes. To turn off the timeout, set the value to 0.
DOCKER_MAX_RESTARTS3The number of times CosmicAC restarts the model server before the job fails.

Reserved names

CosmicAC sets the following variables on every Managed Inference Job. The Your value column shows what CosmicAC does with a value you set.

  • Used: your value replaces the value that CosmicAC sets.
  • Discarded: your value has no effect, and CosmicAC keeps its own.
VariableDescriptionYour value
DOCKER_IMAGEThe model server image. On a vLLM job, the Runtime image (CUDA) field also sets this value.Used
DOCKER_GPUWhether the model server can use the job's GPUs. The default is true.Used
DOCKER_TRANSPORTHow the agent connects to the model server. The default is a Unix domain socket, or TCP on a multi-node vLLM job.Used
DOCKER_STARTUP_TIMEOUT_MSThe startup timeout. See Startup timeout.Used
DOCKER_MAX_RESTARTSThe restart limit. See Startup timeout.Used
INFERENCE_MODEThe agent's run mode. The value is always docker.Discarded
MODEL_NAMEThe model to serve. The Model field sets this value.Discarded
ENDPOINT_NAMEThe endpoint name. The Endpoint name field sets this value.Discarded
REQUIRE_AUTH_HEADERWhether callers must send an API key. The Require Authorization header field sets this value.Discarded
COSMICAC_INSTANCE_IDThe job ID that CosmicAC uses to label the job's logs and metrics.Discarded
JOB_IDThe job ID.Discarded
REPLICA_IDThe replica ID.Discarded
HOST_AGENT_DIRThe directory that the agent shares with the host agent.Discarded

vLLM Managed Inference Job

Besides the general variables, a vLLM Managed Inference Job reads vllm serve options and multi-node settings.

vLLM serving options

Each variable in this section sets one vllm serve flag on the model server. The variable name comes from the flag. To get the name, remove the leading --, replace each remaining hyphen with an underscore, and change every letter to uppercase. For example, --enable-prefix-caching becomes ENABLE_PREFIX_CACHING.

The variable's value controls what CosmicAC adds to the vllm serve command.

  • true: the flag with no value. For example, TRUST_REMOTE_CODE set to true adds --trust-remote-code.
  • false or an empty value: nothing. CosmicAC leaves the flag out.
  • Any other value: the flag followed by the value. For example, SWAP_SPACE set to 0 adds --swap-space 0.

The following tables list the 142 supported vllm serve flags and their variables, grouped by area. For details about each flag, see Engine arguments in the vLLM documentation.

Model

VariablevLLM flag
MODEL--model
RUNNER--runner
CONVERT--convert
TASK--task
TOKENIZER--tokenizer
TOKENIZER_MODE--tokenizer-mode
TRUST_REMOTE_CODE--trust-remote-code
DTYPE--dtype
SEED--seed
HF_CONFIG_PATH--hf-config-path
ALLOWED_LOCAL_MEDIA_PATH--allowed-local-media-path
ALLOWED_MEDIA_DOMAINS--allowed-media-domains
REVISION--revision
CODE_REVISION--code-revision
TOKENIZER_REVISION--tokenizer-revision
MAX_MODEL_LEN--max-model-len
QUANTIZATION--quantization
ENFORCE_EAGER--enforce-eager
MAX_LOGPROBS--max-logprobs
LOGPROBS_MODE--logprobs-mode
DISABLE_SLIDING_WINDOW--disable-sliding-window
DISABLE_CASCADE_ATTN--disable-cascade-attn
SKIP_TOKENIZER_INIT--skip-tokenizer-init
ENABLE_PROMPT_EMBEDS--enable-prompt-embeds
SERVED_MODEL_NAME--served-model-name
CONFIG_FORMAT--config-format
HF_TOKEN--hf-token
HF_OVERRIDES--hf-overrides
POOLER_CONFIG--pooler-config
OVERRIDE_POOLER_CONFIG--override-pooler-config
LOGITS_PROCESSOR_PATTERN--logits-processor-pattern
GENERATION_CONFIG--generation-config
OVERRIDE_GENERATION_CONFIG--override-generation-config
ENABLE_SLEEP_MODE--enable-sleep-mode
MODEL_IMPL--model-impl
OVERRIDE_ATTENTION_DTYPE--override-attention-dtype
LOGITS_PROCESSORS--logits-processors
IO_PROCESSOR_PLUGIN--io-processor-plugin

Model loading

VariablevLLM flag
LOAD_FORMAT--load-format
DOWNLOAD_DIR--download-dir
SAFETENSORS_LOAD_STRATEGY--safetensors-load-strategy
MODEL_LOADER_EXTRA_CONFIG--model-loader-extra-config
IGNORE_PATTERNS--ignore-patterns
USE_TQDM_ON_LOAD--use-tqdm-on-load
PT_LOAD_MAP_LOCATION--pt-load-map-location

Structured outputs

VariablevLLM flag
REASONING_PARSER--reasoning-parser
REASONING_PARSER_PLUGIN--reasoning-parser-plugin

Parallelism

VariablevLLM flag
DISTRIBUTED_EXECUTOR_BACKEND--distributed-executor-backend
PIPELINE_PARALLEL_SIZE--pipeline-parallel-size
MASTER_ADDR--master-addr
MASTER_PORT--master-port
NNODES--nnodes
NODE_RANK--node-rank
TENSOR_PARALLEL_SIZE--tensor-parallel-size
DECODE_CONTEXT_PARALLEL_SIZE--decode-context-parallel-size
DCP_KV_CACHE_INTERLEAVE_SIZE--dcp-kv-cache-interleave-size
CP_KV_CACHE_INTERLEAVE_SIZE--cp-kv-cache-interleave-size
PREFILL_CONTEXT_PARALLEL_SIZE--prefill-context-parallel-size
DATA_PARALLEL_SIZE--data-parallel-size
DATA_PARALLEL_RANK--data-parallel-rank
DATA_PARALLEL_START_RANK--data-parallel-start-rank
DATA_PARALLEL_SIZE_LOCAL--data-parallel-size-local
DATA_PARALLEL_ADDRESS--data-parallel-address
DATA_PARALLEL_RPC_PORT--data-parallel-rpc-port
DATA_PARALLEL_BACKEND--data-parallel-backend
DATA_PARALLEL_HYBRID_LB--data-parallel-hybrid-lb
DATA_PARALLEL_EXTERNAL_LB--data-parallel-external-lb
ENABLE_EXPERT_PARALLEL--enable-expert-parallel
ALL2ALL_BACKEND--all2all-backend
ENABLE_DBO--enable-dbo
DBO_DECODE_TOKEN_THRESHOLD--dbo-decode-token-threshold
DBO_PREFILL_TOKEN_THRESHOLD--dbo-prefill-token-threshold
DISABLE_NCCL_FOR_DP_SYNCHRONIZATION--disable-nccl-for-dp-synchronization
ENABLE_EPLB--enable-eplb
EPLB_CONFIG--eplb-config
EXPERT_PLACEMENT_STRATEGY--expert-placement-strategy
MAX_PARALLEL_LOADING_WORKERS--max-parallel-loading-workers
RAY_WORKERS_USE_NSIGHT--ray-workers-use-nsight
DISABLE_CUSTOM_ALL_REDUCE--disable-custom-all-reduce
WORKER_CLS--worker-cls
WORKER_EXTENSION_CLS--worker-extension-cls

Cache

VariablevLLM flag
BLOCK_SIZE--block-size
GPU_MEMORY_UTILIZATION--gpu-memory-utilization
KV_CACHE_MEMORY_BYTES--kv-cache-memory-bytes
SWAP_SPACE--swap-space
KV_CACHE_DTYPE--kv-cache-dtype
NUM_GPU_BLOCKS_OVERRIDE--num-gpu-blocks-override
ENABLE_PREFIX_CACHING--enable-prefix-caching
PREFIX_CACHING_HASH_ALGO--prefix-caching-hash-algo
CPU_OFFLOAD_GB--cpu-offload-gb
CALCULATE_KV_SCALES--calculate-kv-scales
KV_SHARING_FAST_PREFILL--kv-sharing-fast-prefill
MAMBA_CACHE_DTYPE--mamba-cache-dtype
MAMBA_SSM_CACHE_DTYPE--mamba-ssm-cache-dtype
MAMBA_BLOCK_SIZE--mamba-block-size
KV_OFFLOADING_SIZE--kv-offloading-size
KV_OFFLOADING_BACKEND--kv-offloading-backend

Multimodal

VariablevLLM flag
LIMIT_MM_PER_PROMPT--limit-mm-per-prompt
ENABLE_MM_EMBEDS--enable-mm-embeds
MEDIA_IO_KWARGS--media-io-kwargs
MM_PROCESSOR_KWARGS--mm-processor-kwargs
MM_PROCESSOR_CACHE_GB--mm-processor-cache-gb
MM_PROCESSOR_CACHE_TYPE--mm-processor-cache-type
MM_SHM_CACHE_MAX_OBJECT_SIZE_MB--mm-shm-cache-max-object-size-mb
MM_ENCODER_TP_MODE--mm-encoder-tp-mode
MM_ENCODER_ATTN_BACKEND--mm-encoder-attn-backend
INTERLEAVE_MM_STRINGS--interleave-mm-strings
SKIP_MM_PROFILING--skip-mm-profiling
VIDEO_PRUNING_RATE--video-pruning-rate

Low-rank adapters

VariablevLLM flag
ENABLE_LORA--enable-lora
MAX_LORAS--max-loras
MAX_LORA_RANK--max-lora-rank
LORA_DTYPE--lora-dtype
MAX_CPU_LORAS--max-cpu-loras
FULLY_SHARDED_LORAS--fully-sharded-loras
DEFAULT_MM_LORAS--default-mm-loras

Observability

VariablevLLM flag
SHOW_HIDDEN_METRICS_FOR_VERSION--show-hidden-metrics-for-version
OTLP_TRACES_ENDPOINT--otlp-traces-endpoint
COLLECT_DETAILED_TRACES--collect-detailed-traces

Scheduler

VariablevLLM flag
MAX_NUM_BATCHED_TOKENS--max-num-batched-tokens
MAX_NUM_SEQS--max-num-seqs
MAX_NUM_PARTIAL_PREFILLS--max-num-partial-prefills
MAX_LONG_PARTIAL_PREFILLS--max-long-partial-prefills
LONG_PREFILL_TOKEN_THRESHOLD--long-prefill-token-threshold
SCHEDULING_POLICY--scheduling-policy
ENABLE_CHUNKED_PREFILL--enable-chunked-prefill
DISABLE_CHUNKED_MM_INPUT--disable-chunked-mm-input
SCHEDULER_CLS--scheduler-cls
DISABLE_HYBRID_KV_CACHE_MANAGER--disable-hybrid-kv-cache-manager
ASYNC_SCHEDULING--async-scheduling
STREAM_INTERVAL--stream-interval

Compilation

VariablevLLM flag
CUDAGRAPH_CAPTURE_SIZES--cudagraph-capture-sizes
MAX_CUDAGRAPH_CAPTURE_SIZE--max-cudagraph-capture-size

Engine configuration

VariablevLLM flag
SPECULATIVE_CONFIG--speculative-config
KV_TRANSFER_CONFIG--kv-transfer-config
KV_EVENTS_CONFIG--kv-events-config
EC_TRANSFER_CONFIG--ec-transfer-config
COMPILATION_CONFIG--compilation-config
ADDITIONAL_CONFIG--additional-config
STRUCTURED_OUTPUTS_CONFIG--structured-outputs-config

Logging

VariablevLLM flag
DISABLE_LOG_STATS--disable-log-stats
AGGREGATE_ENGINE_LOGGING--aggregate-engine-logging

Multi-node reserved names

On a multi-node vLLM job, CosmicAC also sets the following variables. For what Used and Discarded mean, see Reserved names.

VariableDescriptionYour value
DOCKER_SHM_SIZEThe shared memory size for the model server. The default is 10.24g.Used
RAY_PORTThe Ray port. The default is 6379.Used
EXPECTED_GPUSThe number of GPUs that the replica waits for before it serves requests. CosmicAC sets this value from the job's GPU count.Discarded
VMI_NAMEThe name that identifies the virtual machine instance (VMI) to its peers.Discarded
NODE_INDEXThe node's position in the replica.Discarded
NODE_COUNTThe number of nodes in the replica.Discarded
OVERLAY_IFACEThe overlay network interface, which CosmicAC discovers when the VMI starts.Discarded
MOUNT_INFINIBANDWhether to mount the InfiniBand devices. CosmicAC always sets this value on a multi-node job.Discarded

Parakeet Managed Inference Job

Besides the general variables, a Parakeet Managed Inference Job reads Parakeet server settings. You set these variables in the model master. See Where to set a variable.

Parakeet server settings

The inference agent passes each variable in this section to the Parakeet server.

VariableDescription
BATCH_SIZEThe number of audio chunks the Parakeet server transcribes in one batch.
NUM_WORKERSThe number of worker processes the Parakeet server runs.
SAMPLE_RATEThe audio sample rate, in hertz, that the Parakeet server uses.
LOG_LEVELThe Parakeet server's log level.

Parakeet reserved names

On a Parakeet job, CosmicAC also sets the following variables. Most of them come from the job fields, listed in Parakeet Managed Inference Job configuration. For what Used and Discarded mean, see Reserved names.

VariableDescriptionYour value
INFERENCE_BACKENDThe inference backend. The value is always the Parakeet backend.Discarded
PORTThe Parakeet server port. The value is always 8777.Discarded
TRANSCRIBE_CHUNK_LENThe audio chunk length. The Chunk duration field sets this value.Discarded
TRANSCRIBE_OVERLAPThe overlap between chunks. The Chunk overlap field sets this value.Discarded
MAX_FILE_SIZE_MBThe maximum upload size. The Max file size field sets this value.Discarded

On this page