Skip to main content

LLM-judge evaluators (G-Eval) for AgentForge

Project description

agentforge-eval-geval

LLM-judge evaluators for AgentForge (feat-006).

This package ships the G-Eval engine — an LLM-as-judge grader that scores agent outputs against a rubric YAML — plus six named graders that wrap G-Eval with reference rubrics:

Grader Scores
Correctness Output matches the ground-truth answer (rubric-tunable for binary / Likert / ordinal)
Faithfulness Output is supported by the retrieved evidence (no claims beyond what was retrieved)
Groundedness Output stays inside the provided sources (no off-source content)
Hallucination Output contains content not derivable from inputs (faithfulness + groundedness combined into a single risk score)
Relevance Output addresses the user's question vs going off-topic
Helpfulness Output is useful — actionable, complete, well-structured

Each grader takes a judge LLMClient at construction. The judge is typically a cheaper model than the agent's primary model (e.g. Haiku judging Sonnet output) — cuts cost and reduces "judge agrees with itself" bias.

Quick start

from agentforge import Agent
from agentforge_bedrock import BedrockClient
from agentforge_eval_geval import Correctness, Faithfulness

judge = BedrockClient(model_id="us.anthropic.claude-haiku-4-5")

agent = Agent(
    model="bedrock:us.anthropic.claude-sonnet-4-5-20250929",
    evaluators=[
        Correctness(judge=judge, ground_truth_field="expected"),
        Faithfulness(judge=judge, sources_field="retrieved_docs"),
    ],
)
result = await agent.run("Summarise PR #42")
print(result.eval_scores)

Cost-bounded: each judge call bills against the run's BudgetPolicy (feat-007). When the remaining budget falls below the grader's cost_estimate_usd, the agent skips the grader and logs a WARN.

Custom rubrics with G-Eval

from agentforge_eval_geval import GEval

grader = GEval(
    judge=judge,
    name="code-review-quality",
    rubric={
        "criteria": "Score the PR description's accuracy and completeness.",
        "scoring": "0.0 = incorrect/incomplete; 1.0 = accurate and complete",
        "examples": [
            {"output": "...", "score": 0.9, "reasoning": "..."},
        ],
    },
)

Or load from a YAML file:

grader = GEval.from_rubric_file("./rubrics/code-review.yaml", judge=judge)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agentforge_eval_geval-0.3.0.tar.gz (14.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agentforge_eval_geval-0.3.0-py3-none-any.whl (15.8 kB view details)

Uploaded Python 3

File details

Details for the file agentforge_eval_geval-0.3.0.tar.gz.

File metadata

  • Download URL: agentforge_eval_geval-0.3.0.tar.gz
  • Upload date:
  • Size: 14.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for agentforge_eval_geval-0.3.0.tar.gz
Algorithm Hash digest
SHA256 7dfbbe3fd47ddd70c25a02746b705af9cd78f00d31a66d1f0ba87fdb90d5cc67
MD5 11f017230b673047eba03087c2b7d4d5
BLAKE2b-256 e49c0b866b95ef0b284976b013d2bc2a86801f1aaef598545f6b5cd35aac7b43

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentforge_eval_geval-0.3.0.tar.gz:

Publisher: release.yml on Scaffoldic/agentforge-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file agentforge_eval_geval-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for agentforge_eval_geval-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e6f0735d72b7896340c75e505afeb500d3b369b89a0ec401f598a255bd45a1ad
MD5 25aade9d079b2945cfb44b0167aac992
BLAKE2b-256 c264ee1d497b1fdd7231142ed9bcba1acd520f68dd68162c54b53ab81b767ecb

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentforge_eval_geval-0.3.0-py3-none-any.whl:

Publisher: release.yml on Scaffoldic/agentforge-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page