Skip to main content

Module cloud_models

Module cloud_models 

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

ModelsAdmission
What a request to the gateway may carry now.

Enums§

ModelsRefusal
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§

CloudTokenSource
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; None without 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.