- Duale AI
- Documentation
- Python SDK
- SDK configuration
SDK configuration: variables, egress, and telemetry
Configure the application process embedding the Duale AI SDK: environment variables, egress destinations, logging, telemetry export, and local health.
This page covers environment variables, outbound destinations, logging, telemetry export, local health, and submission back-pressure for the embedded SDK.
- DUALEAI_ environment variables and their defaults.
- Outbound destinations required by the egress policy.
- Logging behavior and handler replacement on construction.
- Telemetry export via observability endpoint and token.
- Local health status and submission back-pressure.
Summaries were generated by AI.
Configure the application process that embeds the SDK: its environment variables, the outbound destinations your egress policy must allow, logging, telemetry export, and local health.
Environment variables
DualeAIConfig reads DUALEAI_ environment variables. Explicit configuration values override the environment.
Nested observability keys use a double underscore. For installed applications, export these variables or pass
configuration explicitly; do not depend on the SDK finding your application’s .env file.
create_sdk accepts the same settings as keyword arguments.
Allow outbound destinations
Your application process opens every connection, and nothing connects to it from outside. Allow these destinations in your egress policy:
- Destination
- Duale AI API origin,
DUALEAI_ENDPOINT - When the SDK uses it
- Always: credential exchange, Tasks, Tool Host publication and heartbeats, Tool Results, Libraries
- Protection
- HTTPS; Task, Tool Host, Tool Result, and Library requests also use end-to-end encryption
- Destination
- File storage host, named in each upload response
- When the SDK uses it
- Attachment and Library uploads
- Protection
- HTTPS through signed, time-limited upload URLs
- Destination
- Your collector,
DUALEAI_OBSERVABILITY__ENDPOINT - When the SDK uses it
- Only when telemetry export is on
- Protection
- Your collector’s transport; use an
https://endpoint off the host
- Destination
- Your Redis,
DUALEAI_REDIS_URL - When the SDK uses it
- Only when your code uses
@activity - Protection
rediss://for TLS
Duale AI, not your process, reaches the model endpoints in your pool. Plan the deployment explains that separate network path, and End-to-end encryption explains which exchanges that encryption covers.
Logging
Constructing the SDK replaces the process’s root logging handlers with its console handler. The default level is
ERROR; DUALEAI_DEBUG=true selects DEBUG. Cleanup does not restore previous handlers. If your application owns
logging, configure its handlers after constructing the SDK.
Telemetry export
Set the observability endpoint and its separate token to export traces and metrics to your collector. The SDK appends
/v1/traces and /v1/metrics to that endpoint. It does not configure OTLP log export. Install the telemetry extra to
add automatic instrumentation for aiohttp, Redis, SQLite, and system metrics:
python -m pip install 'dualeai[telemetry]'Export requires the observability token. Core trace and metric exporters are already installed with the base package. Providers and automatic instrumentation affect the whole process; coordinate them with any existing OpenTelemetry setup. SDK cleanup does not flush or shut down global providers.
Local health
sdk.get_health_status() returns local status, components, uptime_seconds, inflight_tasks, and
registered_tools. It checks neither remote readiness nor the activity cache. Uninitialized components report healthy,
so use separate checks for connectivity and Tool publication.
Submission back-pressure
Task submissions use no local queue. A process-local circuit breaker blocks new submissions after repeated failures; Circuit breaker states when it opens and closes. To tune it, or to bound how many cached activities run and wait at once, pass a BackpressureConfig.