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.1.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.1-py3-none-any.whl (15.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: agentforge_eval_geval-0.3.1.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.1.tar.gz
Algorithm Hash digest
SHA256 c18636a54524c8a8ba85cf8519c663d63ac40975fb2087aee16bdca8d87abbe7
MD5 f926c3243847932cefaba0bd08d6e2c5
BLAKE2b-256 362476f270203c717420d4039920a9e2c9fc0272b1fa673aa4271aae6cf938fc

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentforge_eval_geval-0.3.1.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.1-py3-none-any.whl.

File metadata

File hashes

Hashes for agentforge_eval_geval-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3a28f5698992164859f64a625f1ef479823067c8831bb02bfd9642267af286b4
MD5 bb191e9fdef573ad9d1a082e4ec1bf1a
BLAKE2b-256 0cf3c01cf89cf7cd1f91f49286d21dfff53b4f7ebcfeab4711c607d0ec64fb88

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentforge_eval_geval-0.3.1-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