Skip to main content

credential_id

Method
This is a method of the AuthProfile class in the failover module.
Stable, non-secret identity for cross-replica quota coordination. The coordinator keys benches by the credential, not the profile label. name is a local display label: two replicas may name the same key differently (breaking cooldown propagation) or reuse a name like "default" for different keys (benching an unrelated key). Derive a deterministic id from the fields that identify the credential (provider, api_key, base_url) using a short salted hash so the real key is never exposed. Falls back to name when no api_key is present.

Signature

Returns

str
The result of the operation.

Uses

  • hexdigest
  • hashlib.sha256
  • encode

Source

View on GitHub

praisonaiagents/llm/failover.py at line 120