Skip to content

yggdrasil.exceptions.loki

loki

Loki agent exceptions.

The errors the Loki agent raises on its own — chiefly token-budget enforcement, so an interactive session can stop and ask the user to raise the cap rather than spending without bound. All derive from :class:~yggdrasil.exceptions.base.YGGException.

LokiError

Bases: YGGException

Base for every error the Loki agent raises on its own.

TokenBudgetExceeded

TokenBudgetExceeded(used: float, limit: float, message: str | None = None)

Bases: LokiError

Raised when USD spend would exceed the configured cost budget.

Carries the running :attr:used spend and the :attr:limit it crossed (both USD) so a caller (the interactive CLI) can show the gap and offer to raise the cap step by step.