New to Kestra?
Use blueprints to kickstart your first workflows.
Orchestrate automated multi-LLM proxy token expenditure tracking, health failover gates, and Slack incident alerting in Kestra.
Enterprise generative AI platforms increasingly deploy unified LLM proxy gateways (such as LiteLLM Proxy) to load balance inference calls across multiple foundation models (OpenAI, Anthropic, Mistral, Vertex AI). As traffic scales, engineering and FinOps teams face two critical risks: unexpected token spending surges and upstream provider outages causing silent downstream application failures.
This blueprint automates continuous health and budget surveillance for multi-model LLM proxy deployments. It evaluates accumulated token spending against organizational cost caps, tests primary provider route responsiveness, verifies automated failover availability, and dispatches rich status digests to your Slack operations channels.
check_provider_health_and_spend (io.kestra.plugin.scripts.python.Script): Connects to the LiteLLM proxy management API to gather accumulated daily token metrics, calculates budget utilization percentages, checks provider route availability, and emits structured outputs via Kestra.outputs.evaluate_governance_gate (io.kestra.plugin.core.flow.If): Tests whether current daily spend exceeds the budget threshold or whether the primary provider is degraded. If anomalies exist, dispatches notify_governance_alert; otherwise, emits notify_governance_nominal.archive_spend_audit_log (io.kestra.plugin.scripts.shell.Commands): Persists operational metric snapshots to audit trails.alert_on_gateway_failure (errors block): Triggers immediately if network partitions, bad credentials, or runner crashes prevent communication with the proxy, notifying engineers with the execution ID.0 * * * *).openai/gpt-4o) to secondary models (anthropic/claude-3-5-sonnet).Coordinating multi-provider AI infrastructure requires flexible scheduling, containerized runtime environments, secure API key isolation, and reliable alerting. Kestra coordinates LLM proxy health checks without requiring custom microservice daemons, providing native secrets storage and execution tracing for compliance.
LITELLM_MASTER_KEY: Master API key for querying the LiteLLM proxy management API.SLACK_WEBHOOK_URL: Slack Incoming Webhook endpoint for alerting.LITELLM_MASTER_KEY and SLACK_WEBHOOK_URL in your Kestra namespace secrets.primary_provider, fallback_provider, and daily_budget_usd inputs.hourly_spend_check trigger active for continuous automated budget oversight.