Skip to content

Environment configuration

GPTNT reads paths, runtime endpoints, game settings, instrumentation flags, and service timeouts from environment variables. This page groups each value by the object or command that owns it.

Paths and command inputs

Variable Default Owner and effect
CONFIGS configs/ in a checkout, then packaged gptnt/_configs Overrides the complete configuration root.
EXPERIMENT_SPECS_DIR output/experiment_specs/ Default specification root for generate and submit. generate appends the manifest stem when no explicit output is supplied.
EXPERIMENT_RECORDER_OUTPUTS Unset Pins one run recorder directory. Unset runs create a timestamp under output/experiment_recorder_outputs/.
EXPERIMENT_RECORDER Command-specific Supplies a local player-record or completion directory to submit, status, and build-db.
EXPERIMENTS_DB output/experiments.duckdb Supplies the DuckDB path to database and submission commands.
STATICS_OUTPUTS output/ Supplies the root containing <task>_predictions/<model>/ to submission commands.
SUBMISSIONS_DIR output/submissions/ Supplies the destination for built submission bundles.
SUBMITTER Unset Supplies the submission identity aggregate where the command accepts it.

EXPERIMENT_RECORDER_OUTPUTS selects the directory written by child recorder processes. EXPERIMENT_RECORDER selects an existing directory read by a command. They are different boundaries.

Runtime endpoints

Variable Type and default Effect
GPTNT_EM_HOST String, localhost Experiment-manager host used by health, submission, and status clients.
GPTNT_EM_PORT Integer, 8085 Experiment-manager HTTP port.
REDIS_DSN Redis DSN, redis://localhost:6379 Redis endpoint used by the experiment manager, game services, player services, heartbeats, and RPC.

GPTNT_MANUAL_ARTIFACTS is not user-authored configuration. gptnt run serialises doctor-validated manual paths into it for player child processes, keyed by profile-and-rule-seed requirement.

Display

On Linux, DISPLAY identifies the X display inherited by a game process. A manifest displays list overrides it per room by assigning :<number> round-robin. Omitting displays leaves the ambient value unchanged.

A local display commonly uses a value such as DISPLAY=:0. Doctor also checks the matching /tmp/.X11-unix/X0 socket. A missing socket produces a warning because remote TCP displays can still be valid.

GPTNT does not require an X display. KTANE uses the desktop application environment.

GPTNT does not require an X display. KTANE uses the desktop application environment.

KTANE settings

KtaneSettings uses the KTANE_ prefix.

Variable Default Effect
KTANE_PLAYER_SETTINGS_FILE_NAME playerSettings.xml Saved player-settings filename.
KTANE_PROGRESSION_FILE_NAME progression.xml Saved progression filename.
KTANE_WINDOWS %APPDATA%/../LocalLow/Steel Crate Games/Keep Talking and Nobody Explodes Windows settings directory.
KTANE_MAC ~/Library/Application Support/com.steelcrategames.keeptalkingandnobodyexplodes macOS settings directory.
KTANE_LINUX ~/.config/unity3d/Steel Crate Games/Keep Talking and Nobody Explodes Linux settings directory.
KTANE_GAME_WIDTH 640 Game-render width in pixels.
KTANE_GAME_HEIGHT 480 Game-render height in pixels.
KTANE_GAME_SPEED 1 Game-speed multiplier.
KTANE_MUSIC_VOLUME 0 Music volume from 0 to 100.
KTANE_SFX_VOLUME 0 Sound-effect volume from 0 to 100.
KTANE_LANGUAGE_CODE en One of the language codes supported by KTANE.

GPTNT sets child-process GAME_WIDTH and GAME_HEIGHT from the configured dimensions. Configure the KTANE_ values rather than setting those child variables directly.

Observability

ObservabilitySettings uses the OBSERVABILITY_ prefix except for the standard OTLP endpoint.

Variable Default Effect
OBSERVABILITY_ENABLE_METRICS true Enables runtime metrics.
OBSERVABILITY_INSTRUMENT_FASTAPI true Instruments FastAPI.
OBSERVABILITY_INSTRUMENT_FASTSTREAM true Instruments FastStream.
OBSERVABILITY_INSTRUMENT_HTTPX true Instruments HTTPX requests.
OBSERVABILITY_INSTRUMENT_PYDANTIC_AI true Instruments Pydantic AI model calls.
OBSERVABILITY_INSTRUMENT_REDIS false Instruments Redis operations.
OBSERVABILITY_CAPTURE_SPAN_TIMINGS false Writes per-step timing JSONL beside experiment records.
OTEL_EXPORTER_OTLP_ENDPOINT http://localhost:4318/ OTLP collector endpoint.
OTEL_RESOURCE_ATTRIBUTES Existing environment value Adds resource attributes. The limited run preset adds sampling.aggressive=true.

The run-manifest presets have these effects:

Preset Instrumentation
full Leaves the environment unchanged, so the settings defaults apply.
limited Keeps Pydantic AI instrumentation and requests aggressive tail sampling. Disables other listed instrumentation and metrics.
off Disables metrics and every listed instrumentation flag.

Instrumentation is not log verbosity

These settings control metrics and tracing hooks. Child process logs are still written by the run orchestrator.

Service timeouts

ServiceTimeouts has no environment prefix. Pydantic Settings accepts the uppercase field name. All values are seconds.

Variable Default Operation
HEARTBEAT_REPEAT_INTERVAL 3 Send heartbeat hashes.
HEARTBEAT_CHECK_INTERVAL 2 Scan Redis for heartbeats.
HEARTBEAT_EXPIRATION 10 Expire a heartbeat and its service.
TOMBSTONE_EXPIRATION 120 Retain graceful-shutdown diagnostics.
GAME_STATE_INTERVAL 2 Poll game state.
GET_BOMB_STATE_TIMEOUT 10 Wait for bomb state.
GET_OBSERVATION_TIMEOUT 60 Wait for game frames and observations.
UPDATE_METRICS_INTERVAL 5 Refresh runtime metrics.
CONFIGURE_SERVICES_TIMEOUT 60 Configure a matched game and players.
RUN_FORWARD_PASS_TIMEOUT 600 Wait for one player model pass.
REDIS_RPC_TIMEOUT 600 Default Redis request/response timeout.
MAXIMUM_EXPERIMENT_DURATION 12000 Stop an experiment that exceeds the runtime limit.
SESSION_STATE_WATCHER_INTERVAL 1 Check session service states.
GAME_REQUEST_TIMEOUT 5 Wait for a short game-control request.

Changing a timeout changes failure detection and can alter resource retention. Use the default unless the deployment has a measured need for another value.

Generated settings

These generated models document values accepted by the current runtime. Their module paths are not supported Python extension interfaces.

RuntimeSettings

Bases: BaseSettings

Runtime service endpoints and prepared manual references supplied to player processes.

Each field keeps its own env-var name via validation_alias, so the EM vars (GPTNT_EM_*) and the conventional REDIS_DSN coexist without a forced prefix. Manual artifact references are populated by gptnt run and are not user-authored configuration.

Attributes

em_host class-attribute instance-attribute

em_host: str = Field(default='localhost', validation_alias='GPTNT_EM_HOST')

Experiment-manager host read from GPTNT_EM_HOST by runtime clients.

em_port class-attribute instance-attribute

em_port: int = Field(default=8085, validation_alias='GPTNT_EM_PORT')

Experiment-manager HTTP port read from GPTNT_EM_PORT by runtime clients.

redis_dsn class-attribute instance-attribute

redis_dsn: RedisDsn = Field(default=RedisDsn('redis://localhost:6379'), validation_alias='REDIS_DSN')

Redis connection string read from REDIS_DSN by runtime services.

em_base_url property

em_base_url: str

Base URL of the experiment manager.

em_health_url property

em_health_url: str

Health-check URL of the experiment manager.

ObservabilitySettings

Bases: BaseSettings

Settings for observability and instrumentation.

This allows us to control whether we enable/disable instrumentation across the codebase from a single place. We don't always need everything when we are doing the big throws because that is just waaaay too many spans and is just entirely unmanageable/costly/unnecessary.

Attributes

instrument_httpx class-attribute instance-attribute

instrument_httpx: bool = True

Capture HTTPX request headers and bodies, but not response bodies.

Methods:

limited classmethod

limited() -> Self

Minimal instrumentation for big throws: pydantic-ai spans only.

off classmethod

off() -> Self

All instrumentation disabled.

ServiceTimeouts

Bases: BaseSettings

Configuration for service timeouts.

Attributes

heartbeat_repeat_interval class-attribute instance-attribute

heartbeat_repeat_interval: float = 3

Seconds between heartbeats emitted by each service.

heartbeat_check_interval class-attribute instance-attribute

heartbeat_check_interval: float = 2

Seconds between registry scans for expired service heartbeats.

heartbeat_expiration class-attribute instance-attribute

heartbeat_expiration: float = 10

Seconds after a heartbeat timestamp before the registry expires the service.

tombstone_expiration class-attribute instance-attribute

tombstone_expiration: float = 120

Seconds for which a shutdown tombstone remains in Redis.

game_state_interval class-attribute instance-attribute

game_state_interval: float = 2

Seconds between game-state polls.

get_bomb_state_timeout class-attribute instance-attribute

get_bomb_state_timeout: float = 10

Seconds allowed for one get_bomb_state RPC.

get_observation_timeout class-attribute instance-attribute

get_observation_timeout: float = 60

Seconds allowed for one get_frames RPC.

update_metrics_interval class-attribute instance-attribute

update_metrics_interval: float = 5

Seconds between service-metric updates.

configure_services_timeout class-attribute instance-attribute

configure_services_timeout: float = 60

Seconds allowed to configure the services assigned to an execution.

run_forward_pass_timeout class-attribute instance-attribute

run_forward_pass_timeout: float = 600

Reserved forward-pass timeout in seconds.

Player RPC currently uses redis_rpc_timeout instead.

redis_rpc_timeout class-attribute instance-attribute

redis_rpc_timeout: float = 600

Seconds allowed for one Redis RPC response unless a client supplies another timeout.

maximum_experiment_duration class-attribute instance-attribute

maximum_experiment_duration: float = 12000

Seconds allowed for each lights-off, lights-on, or game-over wait.

session_state_watcher_interval class-attribute instance-attribute

session_state_watcher_interval: float = 1

Seconds between session-watcher polls of service state.

game_request_timeout class-attribute instance-attribute

game_request_timeout: float = 5

Seconds allowed for the stop_game RPC.

External integrations

GPTNT passes provider, W&B, OpenTelemetry, and submission variables to the external library that owns them. Common local boundaries include:

  • WANDB_ENTITY, WANDB_PROJECT, and WANDB_MODE for W&B completion and recording.
  • Provider credentials such as ANTHROPIC_API_KEY, AZURE_OPENAI_API_KEY, ANTHROPIC_FOUNDRY_API_KEY, and VLLM_API_KEY.
  • LOGFIRE_TOKEN for the production collector deployment.
  • GITHUB_TOKEN for remote submission operations.

Use the provider's documentation for its complete variable set. The provider configuration and provider troubleshooting pages cover the GPTNT boundary. Do not place credentials in a tracked run, player, or provider configuration.