Provider control features
This page covers the provider controls that change how the gateway picks, logs, and retries traffic, beyond the target fields in Provider configuration:
model_groupsgive clients a stable model name while you change the targets behind it.loggingkeeps message bodies and keys out of traces and events.max_context_tokenson a target compresses requests that are too long for it.zero_completion_insuranceretries an empty completion on the next target.- The top-level
health_monitorsection probes provider endpoints in the background.
Syntax
For a working target with id: openai-primary, add a group and logging next to targets in the same providers section:
model_groups:
- name: fast
aliases: [default-fast]
targets: [openai-primary]
logging:
redact_message_bodies: trueSend a request with "model": "fast". The runtime event shows that openai-primary served it.
Body redaction changes traces and event payloads only. The upstream model still receives the full content.
Fields
Model group fields
| Field | Type | Description |
|---|---|---|
name | string | Name that a request model can select. Required. |
targets | array of strings | Target IDs of the group, in order. Each must exist in providers.targets. Required. |
aliases | array of strings | Other model names for the group |
description | string | Description |
fallback_group | string | Group whose targets come next. Must exist and must not create a cycle. |
Logging fields
| Field | Type | Default | Description |
|---|---|---|---|
redact_message_bodies | boolean | false | Writes [REDACTED] instead of message content in traces and event payloads |
redact_api_keys | boolean | true | Writes [REDACTED] instead of API keys in traces and event payloads |
Context compression field
| Field | Type | Description |
|---|---|---|
targets[].max_context_tokens | integer | Above this size, the gateway compresses the request from the middle before it sends it to the target. |
Zero-completion insurance fields
| Field | Type | Default | Description |
|---|---|---|---|
enabled | boolean | true | Sends an empty completion to the next eligible target |
Health monitor fields
| Field | Type | Default | Description |
|---|---|---|---|
providers[].name | string | Provider ID that the probe reports. Use the id of a target to make the result change routing for that target. Required. | |
providers[].endpoint | string | URL that the probe calls with a plain GET. Required. | |
providers[].interval_seconds | integer | 60 | Seconds between two probes of this entry |
providers[].timeout_ms | integer | 5000 | Time limit for one probe, in milliseconds |
unhealthy_threshold | integer | 3 | Number of consecutive failed probes that make the provider unhealthy. Must be above 0. |
alert_callback_urls | array of strings | URLs that receive a POST when the health state changes |
Examples
Complete example
Use two models that your account serves, and export both keys in the gateway terminal:
pack:
name: advanced-provider-controls
version: 1.0.0
enabled: true
providers:
targets:
- id: openai-prod
provider: openai
provider_type: openai
format: openai
model: your-openai-model
max_context_tokens: 128000
secret_key_ref:
env: VERDICTAN_OPENAI_API_KEY
- id: openai-secondary
provider: openai
provider_type: openai
format: openai
model: your-secondary-openai-model
secret_key_ref:
env: VERDICTAN_OPENAI_SECONDARY_API_KEY
model_groups:
- name: standard
targets:
- openai-prod
- openai-secondary
logging:
redact_message_bodies: true
zero_completion_insurance:
enabled: true
policies:
chain:
- audit-logger
policy:
audit-logger: {}Health monitor
health_monitor:
providers:
- name: openai-primary
endpoint: https://health.example.com/readyLimits and failure behavior
Model groups
- When the request
modelmatches a group, the group targets go first in the candidate list, followed by the targets of eachfallback_group. - The provider attempt rules decide how the gateway moves through the list.
- An unknown target ID, an unknown
fallback_group, or a cycle of fallback groups is a load error. - A group name or alias that is also the name of a pipeline or of the auto provider is a load error.
Context compression
Compression happens only when the selected target sets max_context_tokens and the request is longer.
Zero-completion insurance
The check is on by default and applies only to buffered POST /v1 responses. Turn it off if a second provider call is not approved.
Health monitor
- The gateway starts one probe task for each entry. Each task uses the
interval_secondsandtimeout_msof its entry. WhenVERDICTAN_HEALTH_PROBE_INTERVAL_SECSis set, its value replacesinterval_secondsfor all entries. The gateway limits that value to the range10to300. - A probe passes when the endpoint returns a 2xx status or
401. A transport error, another status, or no response beforetimeout_msis a failed probe. - After
unhealthy_thresholdconsecutive failed probes, the provider is unhealthy. One passed probe makes it healthy again. - The gateway records each result in the provider metrics under the
nameof the entry. Whennameis theidof a target, the gateway puts an unhealthy target at the end of the candidate list. The route strategy can change this sequence after that. For example,round-robinandrandomchange the sequence. GET /readyzshows the state of each entry inprovider_health_monitor:provider,state(unknown,healthy, orunhealthy),consecutive_failures,last_status_code, andlast_checked_at_unix. The state does not change the/readyzstatus code.- When the state changes, the gateway sends a JSON
POSTwithevent: provider.health_state_changedto eachalert_callback_urlsentry. A change fromunknowntohealthydoes not send an alert. A failed callback writes a warning to the gateway log.
Next steps
- Provider configuration: targets, route strategies, retries, and pipelines.
- Cloud provider configuration: cloud-specific target fields.