pub struct GatewayServerConfig {
pub seats: Option<u32>,
pub org_label: Option<String>,
pub admin_url: Option<String>,
pub admin_bind_host: Option<String>,
pub usage_retention_days: Option<u32>,
pub pseudonymize_persons: Option<bool>,
}Expand description
Semantic-embedding engine settings.
model selects which local ONNX embedding model lean-ctx downloads and uses for
ctx_semantic_search. Accepts the same aliases as the LEAN_CTX_EMBEDDING_MODEL env
var: minilm (all-MiniLM-L6-v2, 384d — the default), nomic (768d) — or any
HuggingFace repo with an ONNX export via hf:org/repo[@revision] (GL #397), e.g.
hf:jinaai/jina-embeddings-v2-base-code for code-specialized embeddings. When the
env var is set it takes precedence; an
unset/None value uses the default model. Switching models triggers a one-time
re-index on the next semantic search (vector dimensions follow from the model).
dimensions is only consulted for hf: custom models as the declared fallback
width; the real width is probed from the ONNX graph at load time. Built-ins ignore it.
[gateway_server] — deployment parameters of the self-hosted org gateway
(enterprise#20). Distinct from [gateway] (the MCP tool-catalog gateway):
this section describes the LLM-proxy server deployment and its cockpit.
All fields optional; an empty section keeps every local behavior unchanged.
Fields§
§seats: Option<u32>Seats the org-wide projection extrapolates to (e.g. 800). None
disables the projection — the cockpit never invents a seat count.
org_label: Option<String>Display label for the cockpit header (e.g. "Zühlke AI Gateway").
admin_url: Option<String>Central admin API base URL (e.g. https://ai-gateway.example.com).
When set, the local cockpit’s usage breakdown reads the org-wide
GET /api/admin/usage instead of the machine-local snapshot. The
bearer token comes from LEAN_CTX_GATEWAY_ADMIN_TOKEN (never config).
admin_bind_host: Option<String>Bind address of the admin listener (dashboard + /api/admin/* +
/metrics). Defaults to loopback — secure by default (#54/#56):
exposing the console is an explicit decision. Container deployments set
"0.0.0.0" here (the pod/compose port mapping stays the outer guard).
LEAN_CTX_GATEWAY_ADMIN_BIND_HOST overrides. Invalid values fall back
to loopback: a typo can only ever narrow exposure, never open it.
usage_retention_days: Option<u32>Days to keep usage_events rows (enterprise#36). None/0 = keep
forever (the local-free default — retention is a deployment decision).
A running gateway purges older rows periodically; typical compliance
values are 365 or 3650 (EU AI Act evidence horizon).
pseudonymize_persons: Option<bool>Replace person with a stable keyed pseudonym (p:<hash>) before it
reaches metering, budgets, dashboards and logs (enterprise#39, GDPR).
The salt lives in <data_dir>/gateway_pii_salt; gateway gdpr
re-derives pseudonyms from e-mail input, so DSGVO delete/export keep
working. Default false (cleartext person tags).
Implementations§
Source§impl GatewayServerConfig
impl GatewayServerConfig
Sourcepub fn resolved_admin_bind_host(&self) -> IpAddr
pub fn resolved_admin_bind_host(&self) -> IpAddr
Effective admin bind address (see admin_bind_host). Precedence:
LEAN_CTX_GATEWAY_ADMIN_BIND_HOST env > config > 127.0.0.1.
Trait Implementations§
Source§impl Clone for GatewayServerConfig
impl Clone for GatewayServerConfig
Source§fn clone(&self) -> GatewayServerConfig
fn clone(&self) -> GatewayServerConfig
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 GatewayServerConfig
impl Debug for GatewayServerConfig
Source§impl Default for GatewayServerConfig
impl Default for GatewayServerConfig
Source§fn default() -> GatewayServerConfig
fn default() -> GatewayServerConfig
Source§impl<'de> Deserialize<'de> for GatewayServerConfigwhere
GatewayServerConfig: Default,
impl<'de> Deserialize<'de> for GatewayServerConfigwhere
GatewayServerConfig: Default,
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>,
Source§impl PartialEq for GatewayServerConfig
impl PartialEq for GatewayServerConfig
Source§fn eq(&self, other: &GatewayServerConfig) -> bool
fn eq(&self, other: &GatewayServerConfig) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for GatewayServerConfig
impl Serialize for GatewayServerConfig
impl StructuralPartialEq for GatewayServerConfig
Auto Trait Implementations§
impl Freeze for GatewayServerConfig
impl RefUnwindSafe for GatewayServerConfig
impl Send for GatewayServerConfig
impl Sync for GatewayServerConfig
impl Unpin for GatewayServerConfig
impl UnsafeUnpin for GatewayServerConfig
impl UnwindSafe for GatewayServerConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more