pub struct HyprConfig {Show 35 fields
pub server: ServerConfig,
pub model: ModelConfig,
pub inference: InferenceServerConfig,
pub runtime: RuntimeConfig,
pub generation: GenerationConfig,
pub lora: LoraAppConfig,
pub storage: StorageConfig,
pub git2db: Git2DBConfig,
pub worker: Option<WorkerConfig>,
pub services: ServicesConfig,
pub token: TokenConfig,
pub oai: OAIConfig,
pub xet: XetConfig,
pub flight: FlightConfig,
pub mcp: MCPConfig,
pub oauth: OAuthConfig,
pub credentials: CredentialsConfig,
pub streaming: StreamingConfig,
pub rpc: RpcServerConfig,
pub tls: TlsConfig,
pub account: AccountZoneConfig,
pub quic: QuicConfig,
pub event: EventServiceConfig,
pub registry: RegistryServiceConfig,
pub policy: PolicyServiceConfig,
pub discovery: DiscoveryServiceConfig,
pub tui: TuiServiceConfig,
pub metrics: MetricsConfig,
pub signing_key: Option<String>,
pub secrets: SecretsConfig,
pub cluster_at9p_did: Option<String>,
pub cluster_did_web: Option<String>,
pub cluster_anchor_root_cert: Option<PathBuf>,
pub cluster_remote_node: bool,
pub rds: RdsConfig,
}Expand description
Unified configuration for the Hyprstream system
Fields§
§server: ServerConfigHTTP server configuration
model: ModelConfigModel configuration
inference: InferenceServerConfigStandalone CPU inference service configuration (#1236/#1247).
runtime: RuntimeConfigRuntime execution settings
generation: GenerationConfigText generation parameters
lora: LoraAppConfigLoRA adapter settings
storage: StorageConfigStorage paths configuration
git2db: Git2DBConfigGit storage and P2P transport configuration
worker: Option<WorkerConfig>Worker service configuration (optional)
When present, the WorkerService will be started for container/sandbox management. This enables Kata-based isolated workload execution.
services: ServicesConfigService management configuration
Controls which services are started at startup in ipc-systemd mode.
token: TokenConfigJWT token configuration
oai: OAIConfigOpenAI-compatible HTTP API configuration
xet: XetConfigHuggingFace-XET CAS HTTP face configuration (epic #654)
flight: FlightConfigArrow Flight SQL server configuration
mcp: MCPConfigMCP service configuration (HTTP/SSE for Model Context Protocol)
oauth: OAuthConfigOAuth 2.1 authorization server configuration
credentials: CredentialsConfigCredentials storage backend (user profiles, pubkeys, refresh tokens).
streaming: StreamingConfigStreamService configuration (buffer sizes, TTL, etc.)
rpc: RpcServerConfigRPC transport server tunables (stream cap, connection cap, timeouts).
All values default to the process-wide constants in hyprstream-rpc
(DEFAULT_STREAM_LIMIT=64, DEFAULT_CONNECTION_LIMIT=256, etc.).
Override via [rpc] in the config file or HYPRSTREAM__RPC__* env vars.
tls: TlsConfigTLS configuration for HTTP services (OAI, OAuth, MCP)
Enabled by default. Auto-generates self-signed cert when paths are unset.
Per-service tls_cert/tls_key overrides take precedence.
account: AccountZoneConfigAccount identity configuration (epic #1158, A3 / #1162).
Names the deployment-chosen account zone, the zone-scoped DNS-01
credential, and the wildcard address targets. Default is the
unconfigured state — when the operator sets no [account] section,
did:web minting and DNS-01 wildcard TLS issuance degrade sanely (clear
error, no panic, no synthesized default zone name).
quic: QuicConfigQUIC/WebTransport configuration
Enabled by default. Services expose a WebTransport endpoint alongside ZMQ,
allowing browsers to connect directly via HTTP/3 + QUIC.
Set enabled = false to disable.
event: EventServiceConfigEvent proxy service configuration
registry: RegistryServiceConfigRegistry service configuration
policy: PolicyServiceConfigPolicy service configuration
discovery: DiscoveryServiceConfigDiscovery service configuration
tui: TuiServiceConfigTUI display server configuration
metrics: MetricsConfigMetrics service configuration (DuckDB/DataFusion ingest + query)
signing_key: Option<String>Hex-encoded Ed25519 node signing key bytes (bypasses OS keyring lookup).
TEST USE ONLY. Set via HYPRSTREAM__SIGNING_KEY env var to inject a
pre-generated key in isolated test environments where a keyring daemon is
unavailable. Never set this in production config files.
secrets: SecretsConfigPersistent secrets storage configuration.
Controls where signing keys and TLS materials are read from and written to.
On systemd, overridden at runtime by
HYPRSTREAM__SECRETS__PATH=%d in the service unit (pointing to the
systemd credentials directory).
cluster_at9p_did: Option<String>Public self-certifying cluster identity pin used by the explicit
DID-anchored deployment trust source (#1136).
Must be configured together with cluster_did_web.
cluster_did_web: Option<String>Public did:web alias/discovery anchor paired with cluster_at9p_did.
cluster_anchor_root_cert: Option<PathBuf>Optional extra TLS root certificate (PEM file) for private-PKI deployments whose did:web host terminates TLS with an internal CA (#1137). ADDITIVE — public WebPKI roots remain enabled; an unreadable or malformed file fails the bootstrap rather than degrading.
cluster_remote_node: boolWhen true, this node is REMOTE from the cluster’s Discovery service:
the DID-anchored bootstrap dials the did:web-advertised network
transport and requires a signed liveness ping before installing the
resolver (#1137). When false (default — same-node fabric, e.g. the
metal stack’s containers sharing the IPC volume), a lazy local
discovery client is used, matching the OS-owned path’s posture.
rds: RdsConfigRecords/repository RDS (Multi-AZ Postgres) configuration (#1257).
This is the records role’s TOML-only binding. It is not a generic or
shared credential interface: deployment renders this role’s explicit
URL and CA paths into [rds]. When unset, the record store falls back
to its local backend (RocksDB); when set, the Postgres backend is
selected and is FATAL-on-unavailable — never a silent local fallback.
D2 invariant (ARCH-recursive-federation-verdict-fable.md): the
signed, content-addressed record/op-log bytes remain the authoritative
source of truth; the RDS rows are a projection-free KV shell over those
exact signed bytes, never a normalization of them.
Implementations§
Source§impl HyprConfig
impl HyprConfig
Sourcepub fn builder() -> HyprConfigBuilder
pub fn builder() -> HyprConfigBuilder
Create a builder for the application configuration
Sourcepub fn load() -> Result<Self, ConfigError>
pub fn load() -> Result<Self, ConfigError>
Load configuration using the config crate with XDG directories and environment variables
When binary startup pinned a validated snapshot (install_pinned_config),
that snapshot IS the process configuration: the XDG/env re-derivation is
skipped so factory and service-module reloads can never diverge from the
--config file main already loaded and validated.
Sourcepub fn models_dir(&self) -> &PathBuf
pub fn models_dir(&self) -> &PathBuf
Get the models directory path
Sourcepub fn config_dir(&self) -> &PathBuf
pub fn config_dir(&self) -> &PathBuf
Get the config directory path
Sourcepub fn ensure_directories(&self) -> Result<(), Error>
pub fn ensure_directories(&self) -> Result<(), Error>
Ensure all configured directories exist
Sourcepub fn set_model(
&mut self,
model_path: PathBuf,
model_name: String,
architecture: String,
)
pub fn set_model( &mut self, model_path: PathBuf, model_name: String, architecture: String, )
Update model configuration after downloading
Sourcepub fn save(&self) -> Result<(), Box<dyn Error>>
pub fn save(&self) -> Result<(), Box<dyn Error>>
Create generation request from config + prompt Save configuration to default location
Sourcepub fn resolve_secrets_dir() -> Result<PathBuf>
pub fn resolve_secrets_dir() -> Result<PathBuf>
Resolve the secrets directory using the unified secret-material resolver.
Precedence is:
HYPRSTREAM__SECRETS__PATH- explicit config, when provided via
resolve_secrets_dir_for - loaded config file / env-derived config
- XDG default (
<config_dir>/credentials)
Resolution is fail-closed: no /etc or /tmp fallback is chosen
silently when XDG resolution fails.
Sourcepub fn resolve_secrets_dir_for(config: Option<&HyprConfig>) -> Result<PathBuf>
pub fn resolve_secrets_dir_for(config: Option<&HyprConfig>) -> Result<PathBuf>
Resolve the secrets directory, optionally from an already-loaded config.
The optional config handle lets CLI paths that already honored
--config <path> stay on the same resolver family as daemon/service
code instead of reloading default config locations.
Sourcepub fn node_signing_key_bypass() -> Result<Option<SigningKey>>
pub fn node_signing_key_bypass() -> Result<Option<SigningKey>>
Check for the HYPRSTREAM__SIGNING_KEY test bypass.
Returns Ok(Some(key)) when the bypass is set and valid,
Ok(None) when not configured, Err when malformed.
Sourcepub fn user_signing_key_bypass() -> Result<Option<(SigningKey, VerifyingKey)>>
pub fn user_signing_key_bypass() -> Result<Option<(SigningKey, VerifyingKey)>>
Check for the HYPRSTREAM__OAUTH__USER_SIGNING_KEY test bypass.
Returns Ok(Some((sk, vk))) when the bypass is set and valid,
Ok(None) when not configured, Err when malformed.
Sourcepub fn default_for_model(model_path: &Path) -> Result<Self>
pub fn default_for_model(model_path: &Path) -> Result<Self>
Create a default configuration for a specific model path
Trait Implementations§
Source§impl Clone for HyprConfig
impl Clone for HyprConfig
Source§fn clone(&self) -> HyprConfig
fn clone(&self) -> HyprConfig
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 HyprConfig
impl Debug for HyprConfig
Source§impl Default for HyprConfig
impl Default for HyprConfig
Source§fn default() -> HyprConfig
fn default() -> HyprConfig
Source§impl<'de> Deserialize<'de> for HyprConfig
impl<'de> Deserialize<'de> for HyprConfig
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 HyprConfig
impl RefUnwindSafe for HyprConfig
impl Send for HyprConfig
impl Sync for HyprConfig
impl Unpin for HyprConfig
impl UnsafeUnpin for HyprConfig
impl UnwindSafe for HyprConfig
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 moreSource§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