Skip to main content

HyprConfig

Struct HyprConfig 

Source
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: ServerConfig

HTTP server configuration

§model: ModelConfig

Model configuration

§inference: InferenceServerConfig

Standalone CPU inference service configuration (#1236/#1247).

§runtime: RuntimeConfig

Runtime execution settings

§generation: GenerationConfig

Text generation parameters

§lora: LoraAppConfig

LoRA adapter settings

§storage: StorageConfig

Storage paths configuration

§git2db: Git2DBConfig

Git 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: ServicesConfig

Service management configuration

Controls which services are started at startup in ipc-systemd mode.

§token: TokenConfig

JWT token configuration

§oai: OAIConfig

OpenAI-compatible HTTP API configuration

§xet: XetConfig

HuggingFace-XET CAS HTTP face configuration (epic #654)

§flight: FlightConfig

Arrow Flight SQL server configuration

§mcp: MCPConfig

MCP service configuration (HTTP/SSE for Model Context Protocol)

§oauth: OAuthConfig

OAuth 2.1 authorization server configuration

§credentials: CredentialsConfig

Credentials storage backend (user profiles, pubkeys, refresh tokens).

§streaming: StreamingConfig

StreamService configuration (buffer sizes, TTL, etc.)

§rpc: RpcServerConfig

RPC 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: TlsConfig

TLS 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: AccountZoneConfig

Account 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: QuicConfig

QUIC/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: EventServiceConfig

Event proxy service configuration

§registry: RegistryServiceConfig

Registry service configuration

§policy: PolicyServiceConfig

Policy service configuration

§discovery: DiscoveryServiceConfig

Discovery service configuration

§tui: TuiServiceConfig

TUI display server configuration

§metrics: MetricsConfig

Metrics 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: SecretsConfig

Persistent 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: bool

When 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: RdsConfig

Records/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

Source

pub fn builder() -> HyprConfigBuilder

Create a builder for the application configuration

Source

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.

Source

pub fn from_file(path: &Path) -> Result<Self>

Load configuration from file

Source

pub fn to_file(&self, path: &Path) -> Result<()>

Save configuration to file

Source

pub fn validate(&self) -> Result<()>

Validate the entire configuration

Source

pub fn models_dir(&self) -> &PathBuf

Get the models directory path

Source

pub fn loras_dir(&self) -> &PathBuf

Get the LoRAs directory path

Source

pub fn cache_dir(&self) -> &PathBuf

Get the cache directory path

Source

pub fn config_dir(&self) -> &PathBuf

Get the config directory path

Source

pub fn ensure_directories(&self) -> Result<(), Error>

Ensure all configured directories exist

Source

pub fn set_model( &mut self, model_path: PathBuf, model_name: String, architecture: String, )

Update model configuration after downloading

Source

pub fn save(&self) -> Result<(), Box<dyn Error>>

Create generation request from config + prompt Save configuration to default location

Source

pub fn resolve_secrets_dir() -> Result<PathBuf>

Resolve the secrets directory using the unified secret-material resolver.

Precedence is:

  1. HYPRSTREAM__SECRETS__PATH
  2. explicit config, when provided via resolve_secrets_dir_for
  3. loaded config file / env-derived config
  4. XDG default (<config_dir>/credentials)

Resolution is fail-closed: no /etc or /tmp fallback is chosen silently when XDG resolution fails.

Source

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.

Source

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.

Source

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.

Source

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

Source§

fn clone(&self) -> HyprConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for HyprConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for HyprConfig

Source§

fn default() -> HyprConfig

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for HyprConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for HyprConfig

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for T
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send> ⓘ

§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FromRef<T> for T
where T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> FutureExt for T

§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
§

impl<T, W> HasTypeWitness<W> for T
where W: MakeTypeWitness<Arg = T>, T: ?Sized,

§

const WITNESS: W = W::MAKE

A constant of the type witness
§

impl<T> Identity for T
where T: ?Sized,

§

const TYPE_EQ: TypeEq<T, <T as Identity>::Type> = TypeEq::NEW

Proof that Self is the same type as Self::Type, provides methods for casting between Self and Self::Type.
§

type Type = T

The same type as Self, used to emulate type equality bounds (T == U) with associated type equality constraints (T: Identity<Type = U>).
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<T> JaggedSlice<T> for T

§

type Index = Index2

§

fn push_into(self, array: &mut Jagged<T>)

§

fn insert_into(self, index: <T as JaggedSlice<T>>::Index, array: &mut Jagged<T>)

§

impl<T> NoneValue for T
where T: Default,

§

type NoneType = T

§

fn null_value() -> T

The none-equivalent value.
§

impl<T> NoneValue for T
where T: Default,

§

type NoneType = T

§

fn null_value() -> T

The none-equivalent value.
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Serialize for T
where T: Serialize + ?Sized,

Source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<Ok, Error>

§

impl<T> ServiceExt for T

§

fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>
where Self: Sized,

Apply a transformation to the response body. Read more
§

fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>
where Self: Sized,

High level tracing that classifies responses using HTTP status codes. Read more
§

fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>
where Self: Sized,

High level tracing that classifies responses using gRPC headers. Read more
§

fn follow_redirects(self) -> FollowRedirect<Self>
where Self: Sized,

Follow redirect resposes using the Standard policy. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> MaybeSend for T
where T: Send,

§

impl<T> MaybeSend for T
where T: Send,

§

impl<T> MaybeSync for T
where T: Sync,

§

impl<T> MaybeSync for T
where T: Sync,

§

impl<E> ResultError for E
where E: Send + Debug + Sync,

§

impl<T> ResultType for T
where T: Send + Clone + Sync + Debug,

§

impl<T> RpcMessage for T
where T: Debug + Serialize + DeserializeOwned + Send + Sync + Unpin + 'static,

§

impl<T> SendSyncUnwindSafe for T
where T: Send + Sync + UnwindSafe + ?Sized,

Source§

impl<T> TerminalState for T
where T: Clone + Send + Sync,