New to Kestra?
Use blueprints to kickstart your first workflows.
Sends golden benchmark prompt suites to OpenAI daily, evaluates output schema and semantic quality, and alerts engineering on regression.
Large Language Model (LLM) APIs are continuously updated by foundation model providers (such as OpenAI, Anthropic, and Google). Even within fixed alias endpoints like gpt-4o-mini, upstream weight refinements, safety guardrail alterations, and prompt template adjustments can silently alter response formatting and semantic classifications.
When production applications rely on structured JSON outputs from LLMs, a subtle provider update can cause models to omit required keys, wrap JSON in unexpected markdown fences, or misclassify critical user intents, causing downstream automated workflows to fail.
This blueprint provides an automated LLM quality gate that dispatches standardized golden benchmark prompts daily, verifies JSON schema validity, tests semantic intent assertions, and alerts AI engineering teams via Slack the moment quality regressions appear.
daily_model_evaluation trigger (io.kestra.plugin.core.trigger.Schedule) executes daily at 08:00 UTC.execute_model_inference task (io.kestra.plugin.openai.ChatCompletion) sends the standardized golden prompt with system constraints to OpenAI.analyze_response_quality task (io.kestra.plugin.scripts.python.Script) strips markdown wrappers, validates JSON parsing, checks expected intent keywords, and exports drift_report.json.evaluate_drift_alarm flowable task (io.kestra.plugin.core.flow.If) branches based on whether any drift criteria were triggered.notify_slack_prompt_drift (io.kestra.plugin.slack.notifications.SlackIncomingWebhook) delivers an actionable triage card.export_drift_manifest task records benchmark results for model evaluation dashboards.flowchart TD
A[Schedule: Daily 08:00 UTC] --> B[execute_model_inference: OpenAI]
B --> C[analyze_response_quality: Python JSON & Semantic Validator]
C --> D{Quality Drift Detected?}
D -- Yes --> E[notify_slack_prompt_drift: Slack]
D -- No --> F[log_model_accuracy_compliant: Log]
E --> G[export_drift_manifest: Return JSON]
F --> G
Building custom LLM evaluation scripts requires managing API client keys, scheduling crons, and formatting incident webhooks. Kestra natively unifies OpenAI integration, containerized Python analysis, conditional branching, and enterprise Slack alerting into a declarative workflow that runs reliably.
| Name | Type | Default | Description |
|---|---|---|---|
model_name |
STRING | gpt-4o-mini |
OpenAI model target identifier. |
golden_prompt |
STRING | Extract the core customer intent... |
Benchmark prompt payload. |
expected_intent_keyword |
STRING | cancel |
Keyword expected in structured intent output. |
slack_channel |
STRING | #ai-platform |
Slack channel destination for alerts. |
{{ outputs.analyze_response_quality.vars.drift_detected }}: Boolean flag indicating if regression occurred.{{ outputs.analyze_response_quality.vars.parse_success }}: Boolean flag indicating valid JSON parsing.{{ outputs.analyze_response_quality.vars.intent_matched }}: Boolean flag indicating expected keyword match.{{ outputs.analyze_response_quality.outputFiles['drift_report.json'] }}: Complete JSON diagnostic report.OPENAI_API_KEY: API key for OpenAI model inference.SLACK_WEBHOOK_URL: Slack Incoming Webhook endpoint URL.OPENAI_API_KEY and SLACK_WEBHOOK_URL in your Kestra namespace secrets.```json ... ```; the script safely handles and strips fences before validation.io.kestra.plugin.core.flow.EachParallel to test multiple models (e.g. gpt-4o-mini, gpt-4o, claude-3-5-sonnet) against the same prompt simultaneously.