pub struct ProxyConfig {Show 28 fields
pub listen: Option<String>,
pub http_listen: Option<String>,
pub fresh_duration_secs: Option<u64>,
pub stale_duration_secs: Option<u64>,
pub max_entries: Option<usize>,
pub upstream_url: Option<String>,
pub upstream_timeout_secs: Option<u64>,
pub ttl_jitter_percent: Option<f32>,
pub refresh_interval_secs: Option<u64>,
pub scope: ProxyScopeConfig,
pub cache: ProxyCacheConfig,
pub distill: DistillConfig,
pub api_key: Option<String>,
pub rate_limit: ProxyRateLimitConfig,
pub retry: ProxyRetryConfig,
pub upstreams: Vec<UpstreamEndpointConfig>,
pub federated: FederatedConfig,
pub security: SecurityConfig,
pub cascade: CascadeConfig,
pub pool: ConnectionPoolConfig,
pub circuit_breaker: ProxyCircuitBreakerConfig,
pub agents: Vec<AgentConfig>,
pub cdc: CdcConfig,
pub peer: PeerConfig,
pub socket_tuning: SocketTuningConfig,
pub shutdown_timeout_secs: Option<u64>,
pub max_global_connections: Option<usize>,
pub web_ui: WebUiConfig,
}Expand description
Proxy server configuration.
Fields§
§listen: Option<String>Listen address for gRPC (e.g., “127.0.0.1:9999”).
http_listen: Option<String>Listen address for HTTP health/prometheus endpoints (e.g., “127.0.0.1:9998”). If not set, defaults to the gRPC listen port + 1.
fresh_duration_secs: Option<u64>Duration in seconds before a cached entry becomes stale.
stale_duration_secs: Option<u64>Duration in seconds before a stale entry expires completely.
max_entries: Option<usize>Maximum number of entries in the cache.
upstream_url: Option<String>URL of the upstream RAG service.
Deprecated: Use [[proxy.upstreams]] with id and url instead.
This field is auto-converted via normalize_upstreams().
upstream_timeout_secs: Option<u64>Timeout for upstream requests in seconds.
ttl_jitter_percent: Option<f32>TTL jitter percentage to prevent thundering herd (0.0 to 1.0, default: 0.1 = 10%).
refresh_interval_secs: Option<u64>Interval for background refresh worker in seconds (default: 60).
scope: ProxyScopeConfigScope configuration for seed phrase filtering.
cache: ProxyCacheConfigCache configuration with limits and eviction.
distill: DistillConfigDistill feature configuration (output dir, post-process, format).
api_key: Option<String>API key for authenticating clients (optional).
rate_limit: ProxyRateLimitConfigRate limiting configuration.
retry: ProxyRetryConfigRetry policy configuration for upstream requests.
upstreams: Vec<UpstreamEndpointConfig>Multiple upstream endpoints (alternative to single upstream_url).
federated: FederatedConfigFederated search configuration for local+remote merging.
security: SecurityConfigUnified security configuration (API key, rate limiting, advanced).
cascade: CascadeConfigCascade query configuration (priority-based upstream fallback).
pool: ConnectionPoolConfigConnection pool configuration (pgbouncer-style concurrency control).
circuit_breaker: ProxyCircuitBreakerConfigCircuit breaker configuration (upstream failure protection).
agents: Vec<AgentConfig>Per-agent multi-tenancy configuration.
When non-empty, each agent gets its own API key, rate limit,
and context restrictions. When empty, behavior is identical
to the single-key api_key field (backward-compatible).
cdc: CdcConfigCDC (Change Data Capture) event stream configuration.
peer: PeerConfigPeer-to-peer cache replication configuration.
socket_tuning: SocketTuningConfigSocket tuning configuration for listeners and upstream clients.
shutdown_timeout_secs: Option<u64>Graceful shutdown timeout in seconds (default: 30). After receiving a shutdown signal, the proxy will wait this long for in-flight requests to complete before forcing exit.
max_global_connections: Option<usize>Maximum global concurrent upstream connections across all upstreams (default: 1000). Uses try_acquire for fail-fast 503 instead of queueing.
web_ui: WebUiConfigWeb UI configuration (read-only status dashboard).
Implementations§
Source§impl ProxyConfig
impl ProxyConfig
Sourcepub fn http_listen_addr(&self) -> String
pub fn http_listen_addr(&self) -> String
Get the HTTP listen address for health/prometheus (defaults to gRPC port + 1).
Sourcepub fn fresh_duration_secs(&self) -> u64
pub fn fresh_duration_secs(&self) -> u64
Get the fresh duration in seconds.
Sourcepub fn stale_duration_secs(&self) -> u64
pub fn stale_duration_secs(&self) -> u64
Get the stale duration in seconds.
Sourcepub fn max_entries(&self) -> usize
pub fn max_entries(&self) -> usize
Get the maximum number of cache entries.
Sourcepub fn upstream_url(&self) -> Option<&str>
pub fn upstream_url(&self) -> Option<&str>
Get the upstream URL (if configured).
Sourcepub fn upstream_timeout_secs(&self) -> u64
pub fn upstream_timeout_secs(&self) -> u64
Get the upstream timeout in seconds.
Sourcepub fn ttl_jitter_percent(&self) -> f32
pub fn ttl_jitter_percent(&self) -> f32
Get the TTL jitter percentage (default: 0.1 = 10%).
Sourcepub fn refresh_interval_secs(&self) -> u64
pub fn refresh_interval_secs(&self) -> u64
Get the refresh interval in seconds (default: 60).
Sourcepub fn scope_seeds(&self) -> Vec<String>
pub fn scope_seeds(&self) -> Vec<String>
Phrase texts for scope filtering (from weighted_phrases or legacy seeds).
Sourcepub fn scope_seeds_mut(&mut self) -> &mut Vec<String>
pub fn scope_seeds_mut(&mut self) -> &mut Vec<String>
Mutable legacy seeds list (CLI mutate path). Prefer editing weighted_phrases in config.
Sourcepub fn requires_auth(&self) -> bool
pub fn requires_auth(&self) -> bool
Check if authentication is required.
Sourcepub fn rate_limit(&self) -> &ProxyRateLimitConfig
pub fn rate_limit(&self) -> &ProxyRateLimitConfig
Get the rate limit configuration.
Sourcepub fn retry(&self) -> &ProxyRetryConfig
pub fn retry(&self) -> &ProxyRetryConfig
Get the retry policy configuration.
Sourcepub fn upstreams(&self) -> &[UpstreamEndpointConfig]
pub fn upstreams(&self) -> &[UpstreamEndpointConfig]
Get the configured upstreams.
Sourcepub fn enabled_upstreams(&self) -> Vec<&UpstreamEndpointConfig>
pub fn enabled_upstreams(&self) -> Vec<&UpstreamEndpointConfig>
Get enabled upstreams only.
Sourcepub fn has_multiple_upstreams(&self) -> bool
pub fn has_multiple_upstreams(&self) -> bool
Check if multiple upstreams are configured.
Sourcepub fn agents(&self) -> &[AgentConfig]
pub fn agents(&self) -> &[AgentConfig]
Get the configured agents.
Sourcepub fn has_agents(&self) -> bool
pub fn has_agents(&self) -> bool
Check if multi-tenancy is enabled (at least one agent configured).
Sourcepub fn enabled_agents(&self) -> Vec<&AgentConfig>
pub fn enabled_agents(&self) -> Vec<&AgentConfig>
Get enabled agents only.
Sourcepub fn normalize_upstreams(&mut self) -> bool
pub fn normalize_upstreams(&mut self) -> bool
Normalize legacy upstream_url into the upstreams array.
If upstream_url is set and upstreams is empty, creates a single upstream
entry with id “default”. Returns true if a conversion was performed.
Sourcepub fn apply_env_overrides(&mut self) -> usize
pub fn apply_env_overrides(&mut self) -> usize
Apply environment variable overrides for deployment.
Supported env vars:
CONPROXY_HOST— Override listen hostCONPROXY_PORT— Override listen portCONPROXY_API_KEY— Override API keyCONPROXY_CACHE_MAX_ENTRIES— Override max cache entriesCONPROXY_UPSTREAM_{ID}_URL— Override URL for upstream with matching id (case-insensitive)
Returns the number of overrides applied.
Sourcepub fn peer(&self) -> &PeerConfig
pub fn peer(&self) -> &PeerConfig
Get the peer replication configuration.
Sourcepub fn cdc_enabled(&self) -> bool
pub fn cdc_enabled(&self) -> bool
Check if CDC is effectively enabled (explicit or via peer replication).
Sourcepub fn shutdown_timeout_secs(&self) -> u64
pub fn shutdown_timeout_secs(&self) -> u64
Get the graceful shutdown timeout in seconds (default: 30).
Sourcepub fn max_global_connections(&self) -> usize
pub fn max_global_connections(&self) -> usize
Get the maximum global concurrent connections (default: 1000).
Trait Implementations§
Source§impl Clone for ProxyConfig
impl Clone for ProxyConfig
Source§fn clone(&self) -> ProxyConfig
fn clone(&self) -> ProxyConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ProxyConfig
impl Debug for ProxyConfig
Source§impl Default for ProxyConfig
impl Default for ProxyConfig
Source§fn default() -> ProxyConfig
fn default() -> ProxyConfig
Source§impl<'de> Deserialize<'de> for ProxyConfig
impl<'de> Deserialize<'de> for ProxyConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for ProxyConfig
impl RefUnwindSafe for ProxyConfig
impl Send for ProxyConfig
impl Sync for ProxyConfig
impl Unpin for ProxyConfig
impl UnsafeUnpin for ProxyConfig
impl UnwindSafe for ProxyConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request