Expand description
The seam through which the local proxy serves the subscription models
(mz6, docs/model-access-subscription.md §4).
The built-in registry provider PROVIDER_ID forwards to the Cloud models
gateway with the instance’s short-lived cloud_i_ access token. The proxy
and the Cloud connector are sibling crates, so the connector registers the
one process-wide CloudTokenSource (as it does the runtime
LeaseSource) and the proxy asks it, never the Cloud crate directly.
The token opens every engine route of Cloud, so it may only go to the
models origin models_origin derives from the enrolled Cloud URL.
Re-exports§
pub use crate::core::config::LEANCTX_PROVIDER_ID as PROVIDER_ID;
Structs§
- Models
Admission - What a request to the gateway may carry now.
Enums§
- Models
Refusal - Why a request is answered locally instead of going to the gateway.
Constants§
- TOKEN_
UNAVAILABLE_ CODE - Error code of the local 503 when no instance token can be had.
- UNAVAILABLE_
CODE - Error code of the local 403 while the lease does not grant the right
models.subscription(or the models origin is refused).
Traits§
- Cloud
Token Source - Where the subscription-model access comes from (the Cloud connector). Every method may block (file reads, a token mint); the proxy calls them off the async runtime and bounds the wait.
Functions§
- cloud_
token_ source - The registered source;
Nonewithout a Cloud connector. - models_
origin - The models origin for an instance enrolled at
cloud_url. - set_
cloud_ token_ source - Registers the process-wide source. A later call replaces it.