- Changed terminology in `config.yaml` from "SLA deadline" to "readiness target" to clarify that jobs still run after the specified time. - Updated `README.md` to reflect the new readiness target concept, emphasizing that jobs started after the target are still executed and reported. - Modified `pipeline` logic to incorporate the new readiness target, ensuring accurate tracking of jobs that begin after the target time. - Enhanced reporting in the run report to include counts of jobs that started after the readiness target, improving transparency in job execution outcomes.
100 lines
5.0 KiB
YAML
100 lines
5.0 KiB
YAML
# ── LLM configuration ─────────────────────────────────────────────────────────
|
|
# Two independent profiles, one per pipeline stage. Each accepts the same keys:
|
|
# provider: openai | anthropic | gemini
|
|
# openai_model / anthropic_model / gemini_model / max_tokens / temperature
|
|
# thinking_level (optional, Gemini 3 only): low | medium | high.
|
|
# Gemini counts thinking tokens inside max_tokens, so max_tokens is the
|
|
# combined thinking-plus-output cap. Omit thinking_level to use the model's default.
|
|
llm:
|
|
# Part_One: vector-search query synthesis (small structured JSON in,
|
|
# 1-2 short queries out). A lighter/cheaper model is sufficient here.
|
|
query_synthesis:
|
|
provider: gemini
|
|
openai_model: gpt-4o-mini
|
|
anthropic_model: claude-haiku-4-5
|
|
gemini_model: gemini-3.8-flash
|
|
max_tokens: 2048
|
|
temperature: 0.0
|
|
|
|
# Part_Two: the farmer-facing advisory generator. Receives the full
|
|
# json_for_advice_generation payload (weather, phenology, model output,
|
|
# applied treatments, product labels) and returns the structured advice
|
|
# JSON stored in the advisories table. Needs a more capable model.
|
|
advice_generation:
|
|
provider: gemini
|
|
openai_model: gpt-4o
|
|
anthropic_model: claude-opus-4-5
|
|
gemini_model: gemini-3.1-pro-preview
|
|
max_tokens: 13312
|
|
thinking_level: medium
|
|
temperature: 0.0
|
|
|
|
# ── Worklist filters ───────────────────────────────────────────────────────────
|
|
# `python -m pipeline batch` discovers jobs from the database, not from this
|
|
# file. A disease can generate advice when
|
|
# AI_agrosupport_an_pathogen_models.pat_mod_AI_model = 1; its name is
|
|
# pat_mod_desc. A field is included when AI_agrosupport_agro_models.anmod_AI_advice
|
|
# = 1 and anmod_model matches that name. The cultivated crop comes from
|
|
# AI_agrosupport_cmp_layers / AI_agrosupport_an_colture and vocab/crops.yaml.
|
|
# The English disease name comes from vocab/diseases.yaml.
|
|
#
|
|
# Each crop-disease pair needs a matching prompt directory under
|
|
# prompts/advice/<crop>__<disease slug>/ (see the pipeline README for the slug
|
|
# rules); pairs without one fall back to prompts/advice/_default/ and are
|
|
# logged at startup.
|
|
worklist:
|
|
# Restrict the batch to specific field IDs while testing; empty = no filter.
|
|
field_allowlist: []
|
|
|
|
# ── Concurrency & rate limiting ────────────────────────────────────────────────
|
|
# One "gemini" budget covers both direct LLM calls (query synthesis, advice
|
|
# generation) and Weaviate near_text search, because the ProductProfile
|
|
# collection is vectorised with text2vec-palm (gemini-embedding-001) using the
|
|
# same GEMINI_API_KEY — they share one quota.
|
|
concurrency:
|
|
workers: 12
|
|
limits:
|
|
sql: 6
|
|
gemini: 12
|
|
gemini_requests_per_minute: 60
|
|
|
|
# ── Retry policy for transient LLM / Weaviate / SQL failures ──────────────────
|
|
retry:
|
|
attempts: 3
|
|
initial_backoff_seconds: 2
|
|
max_backoff_seconds: 30
|
|
|
|
# ── Daily readiness target ──────────────────────────────────────────────────────
|
|
# Advice should be ready by this local time. Start the run no earlier than
|
|
# ~07:00 so weather is fresh (see README). Jobs not yet started by then are
|
|
# still run and written; the run report counts them in
|
|
# jobs_started_after_deadline.
|
|
schedule:
|
|
deadline: "09:00"
|
|
|
|
# ── Single-field debug mode (`python -m pipeline one`) ────────────────────────
|
|
# Not used by `batch`; kept for ad-hoc single-field runs and debugging.
|
|
field_id: 4012
|
|
disease_name: "PERONOSPORA"
|
|
|
|
# ── Vocabulary paths ──────────────────────────────────────────────────────────
|
|
vocab:
|
|
crops: vocab/crops.yaml
|
|
diseases: vocab/diseases.yaml
|
|
|
|
# ── Observability (optional; off by default) ──────────────────────────────────
|
|
# Sends OpenTelemetry/OpenInference spans to the self-hosted Phoenix container
|
|
# in docker-compose.yml (http://localhost:6006). Never required: if this is
|
|
# off, or Phoenix is down/unreachable, `batch` and `one` run exactly as if
|
|
# this block did not exist (see pipeline/observability.py).
|
|
observability:
|
|
enabled: false
|
|
project_name: ai-agro-support
|
|
endpoint: http://localhost:6006/v1/traces
|
|
# Keep prompt/payload text out of Phoenix spans. json_for_advice_generation
|
|
# carries the full product-label payload and is already persisted under
|
|
# output/<date>/*.json; spans only need model/token/status metadata.
|
|
hide_prompts: true
|
|
# Hard cap on every exported string attribute (OTel span attribute limit).
|
|
max_attribute_chars: 4096
|