Skip to main content
SDK config propagation allows Zespan to push configuration changes — model overrides, fallback models, retry and timeout policies, and more — to your running application without a code change or redeployment. The mechanism is built into the ingest response and adds no latency to your LLM calls.

How it works

Every time your SDK flushes a batch of events to POST /v1/ingest, the response body includes a cv (config version) integer:
The SDK compares this cv value to the last version it fetched. If the server version is higher, the SDK makes a single background request to GET /v1/sdk/config and applies the returned configuration rules immediately — without blocking any LLM call in progress.
The entire update cycle typically completes within one flush interval (default 2 seconds). From the perspective of your application code, nothing changes — all updates are applied transparently.

What can be propagated

The following SDK behaviors can be updated at runtime via config propagation: Config rules are scoped to a project. Changes you make via ZespanPilot apply to all instances of your application using that project’s API key.

Updating config from ZespanPilot

The only way to push a config change today is through ZespanPilot, the AI copilot accessible via ⌘J in the dashboard. You can ask it in plain English:
  • “Switch all GPT-4o calls to GPT-4o-mini”
  • “Set the sample rate to 20% for the production project”
  • “Add a fallback to GPT-4o-mini if the checkout-agent operation errors”
  • “Enable guardrails on the support-agent project”
ZespanPilot translates your instruction into a config rule and increments the cv counter. Within the next flush cycle, all running SDK instances pick up the change.
Config changes that affect model routing — switching models or enabling an A/B test — are considered high-risk operations. ZespanPilot requires confirmation before applying them. Only users with the admin or owner role can apply config changes — members see a permission error.

Turning config propagation on or off

Config propagation is gated by two init options, and the default differs by language.
Config propagation is active whenever projectId is set — enableZespanPilot defaults to true. Set it to false to opt out even with projectId present:
When config propagation is off, the SDK ignores the cv field in ingest responses and never fetches remote config. All behavior is determined solely by the options passed to init(). See the TypeScript SDK reference or Python SDK reference for the full option list.

Reading config programmatically

Everything above happens automatically — the SDK applies incoming rules to your LLM calls without any code on your part. ConfigClient also exposes a direct read and subscribe API, for cases where you want to inspect the config currently in effect or react to a change yourself (for example, logging which model is active for an operation, or emitting your own metric when a fallback kicks in).

Getting the client instance

In TypeScript, the client exposes configClient as a public property — it’s null if config propagation is disabled (see Turning config propagation on or off above). In Python, the wired instance is held on the client’s _config_client attribute. There’s no public property wrapping it yet, so access it directly on the object returned by get_client().

Accessor methods

All accessors read from the config already applied locally — none of them make a network call.

Subscribing to config changes

Both languages expose on(event, callback) to run code when a specific part of the config changes. Python also exposes off(event, callback) to deregister a listener; TypeScript’s ConfigClient doesn’t currently have an off() method. The callback receives the full updated value for that field — for example, a model_override listener receives the complete map of operation → model, not just the entry that changed.
Guardrail overrides, rate limits, and prompt version pins are applied silently in both languages — they don’t currently emit a change event.

Audit trail

Every config change applied via ZespanPilot is recorded in the audit log. Go to Settings → Audit Log to see who changed what, when, and from where. Each entry includes the rule type, the before and after values, and the user who made the change.
Config propagation is most valuable for emergency interventions: switching a broken model to a fallback, dropping the sample rate during a cost spike, or disabling a guardrail that is blocking legitimate traffic. For planned changes, a code deployment is still preferable because it puts the change in version control.