pub struct GatewayServerConfig {
pub seats: Option<u32>,
pub org_label: Option<String>,
pub admin_url: Option<String>,
pub pseudonymize_persons: Option<bool>,
pub mcp_servers: Vec<McpServerEntry>,
}Expand description
Semantic-embedding engine settings.
model selects which local embedding model lean-ctx downloads and uses for
ctx_semantic_search. Unset, it is minilm where ONNX Runtime is installed and
potion-code otherwise (see model_registry::default_model). Accepts the same
aliases as the LEAN_CTX_EMBEDDING_MODEL env var: minilm (all-MiniLM-L6-v2,
384d), potion-code (potion-code-16M, 256d static, pure Rust), 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).
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).
mcp_servers: Vec<McpServerEntry>MCP upstream registry (GL#91/#99, Doc 15 §7 — the observe stage of MCP
context governance). Each entry publishes a governed reverse-proxy
route /mcp/{id} on the enterprise gateway server’s port (the local
proxy mounts no /mcp/{id} routes): same per-person key auth as the
LLM channel, tool calls metered into mcp_events, tool definitions
inventoried + hash-tracked (rug-pull detection). Observe-only: the
gateway never blocks or rewrites MCP traffic in this stage.
Implementations§
Source§impl GatewayServerConfig
impl GatewayServerConfig
Sourcepub fn resolve_mcp_servers(
&self,
allow_insecure_http: bool,
) -> Vec<ResolvedMcpServer>
pub fn resolve_mcp_servers( &self, allow_insecure_http: bool, ) -> Vec<ResolvedMcpServer>
Validate + resolve the [[gateway_server.mcp_servers]] registry.
Same resilience contract as [[proxy.providers]]: invalid entries are
logged and skipped (one typo never takes the gateway down), duplicates
keep the first occurrence. allow_insecure_http mirrors the proxy’s
plaintext-HTTP opt-in so the two registries share one security posture.
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<GatewayServerConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<GatewayServerConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for GatewayServerConfig
impl PartialEq for GatewayServerConfig
Source§impl Serialize for GatewayServerConfig
impl Serialize for GatewayServerConfig
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for GatewayServerConfig
Auto Trait Implementations§
impl Forget for GatewayServerConfig
impl Freeze for GatewayServerConfig
impl Move for GatewayServerConfig
impl RefUnwindSafe for GatewayServerConfig
impl Send for GatewayServerConfigwhere
RawVecInner: Send,
impl Sync for GatewayServerConfigwhere
RawVecInner: Sync,
impl Unpin for GatewayServerConfig
impl UnsafeUnpin for GatewayServerConfigwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<McpServerEntry>: UnsafeUnpin,
impl UnwindSafe for GatewayServerConfigwhere
RawVecInner: UnwindSafe,
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>,
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