Skip to main content

Module config

Module config 

Source
Expand description

Token Maxing configuration (RFC-031 §2).

The schema is a small surface — the user must opt in, then list each subscription provider with its plan allocation. The eligibility rule is conservative: only providers with billing_model = "subscription" are ever used by crate::token_maxing::TokenMaxer. A metered key can never be silently drafted.

§Example

[token-maxing]
enabled = false

[[token-maxing.providers]]
provider = "zai"
billing_model = "subscription"
token_limit = 2000000
reset_window_secs = 18000          # 5h
min_remaining_percent = 5
models = ["zai/glm-4.6", "zai/glm-4.5-air"]

Structs§

TokenMaxingConfig
Top-level [token-maxing] configuration.
TokenMaxingProviderConfig
Per-provider subscription plan entry. One row per subscription provider the user has opted in to.

Constants§

SUBSCRIPTION_BILLING_MODEL
The only accepted value of billing_model. This is the single choke point that upholds the “절대 동작하면 안 된다” constraint — the QuotaTracker will only ever mark a provider eligible when this exact string is present in the config.