evaluations: judge model moves to config.evaluations.judge

This commit is contained in:
Yiorgis Gozadinos 2026-05-20 12:56:22 +03:00
parent 8c57a3ca99
commit f9392cee46
No known key found for this signature in database
3 changed files with 19 additions and 6 deletions

View file

@ -13,6 +13,7 @@
- BTree scalar indexes on `document_items.{document_id, position, self_ref}`. The 0.48.0 migration creates them on existing DBs. Per-doc lookups go from full-table scans (~100300 ms) to point queries (~321 ms) on small/medium corpora.
- Per-doc lazy cache for `items.jsonl` and `toc.json` in the analysis sandbox. First read fetches; subsequent reads of either file in the same `execute_code` session hit a serialized cache. One DB fetch per doc per session.
- `cite` tool now accepts chunk_ids that resolve via the chunks table, not only chunk_ids from a prior `search()` result. Lets the model cite directly from `items.jsonl` / `toc.json` rows. The hallucination guard (`ModelRetry` on chunk_ids that don't exist in the DB) is preserved.
- `AppConfig.evaluations` (`EvaluationsConfig`) with an optional `judge: ModelConfig`. Lets the eval CLI pin the LLM-as-judge per-yaml — including a custom `base_url` for any OpenAI-compatible endpoint (vLLM, LM Studio) without env-var routing.
### Removed
@ -27,6 +28,7 @@
- `prompts.qa` config field.
- `evaluations optimize` subcommand and GEPA prompt-optimization. Drops `gepa` dep.
- `--target qa` from `evaluations run`. Default is now `rag-skill`.
- `--judge-model` flag from `evaluations run`. Set the judge in `config.evaluations.judge` instead.
- `position` field on `toc.json` nodes (redundant with `item_range[0]`).
- `position` and `tree_depth` from `items.jsonl` row serialization. Both fields are still persisted on `DocumentItem`; they are no longer surfaced to the sandbox.

View file

@ -591,11 +591,6 @@ def run(
"--multimodal-only",
help="Only evaluate queries requiring image understanding.",
),
judge_model: str | None = typer.Option(
None,
"--judge-model",
help="Judge model as 'provider:name'. Defaults to ollama:qwen3.6.",
),
target: str = typer.Option(
"rag-skill",
"--target",
@ -617,7 +612,7 @@ def run(
f"Unknown target {target!r}. Choose from: {', '.join(TARGETS)}"
)
target_value = cast(Target, target)
judge_model_config = parse_model_option(judge_model) if judge_model else None
judge_model_config = app_config.evaluations.judge
skill_model_config = parse_model_option(skill_model) if skill_model else None
asyncio.run(

View file

@ -236,6 +236,19 @@ class PromptsConfig(BaseModel):
)
class EvaluationsConfig(BaseModel):
"""Settings consumed only by the `evaluations` package."""
judge: ModelConfig | None = Field(
default=None,
description=(
"Judge model for `evaluations run`'s LLM-as-judge step. "
"ModelConfig's base_url lets the judge point at any "
"OpenAI-compatible endpoint."
),
)
class AppConfig(BaseModel):
environment: str = "production"
storage: StorageConfig = Field(default_factory=StorageConfig)
@ -249,3 +262,6 @@ class AppConfig(BaseModel):
search: SearchConfig = Field(default_factory=SearchConfig)
providers: ProvidersConfig = Field(default_factory=ProvidersConfig)
prompts: PromptsConfig = Field(default_factory=PromptsConfig)
evaluations: "EvaluationsConfig" = Field(
default_factory=lambda: EvaluationsConfig()
)