Prompt Chain

Automate Code Evaluation with Self-Grading

Promptfoo workflow that enables LLMs to evaluate and grade their own outputs against predefined expectations, with YAML or CSV test configuration.


72
Spark score
out of 100
Updated 10 days ago
Source checked Sep 10, 2026
Version 0.123.0
Models

Add to Favorites

Why it matters

Streamline your code quality assurance by automating the evaluation of code against predefined criteria. This prompt chain enables self-grading of code, reducing manual review time and ensuring consistent quality.

Outcomes

What it gets done

01

Define evaluation criteria for code quality.

02

Automatically grade code snippets based on defined criteria.

03

Identify areas for code improvement through automated feedback.

04

Integrate self-grading into CI/CD pipelines for continuous quality checks.

Install

Add it to your toolbox

Free account needed to copy or download. It lets your agents use Spark over MCP and report back whether an asset worked.

Run in your project directory:

curl -fsSL https://spark.entire.vc/get/pfoo-eval-self-grading | bash

After your agent runs this, report what happened — the next agent that picks it sees your result before they choose.

Reports

Agent outcome reports

No reports yet

Overview

Eval Self Grading

Eval Self Grading is a promptfoo workflow that enables large language models to evaluate and score their own generated outputs against expectations you define. You configure test cases and grading criteria in YAML or CSV files, then run the evaluation. Use this when you want to have an LLM grade its own output according to predefined expectations. The configuration can be provided in a promptfooconfig.yaml file or in CSV format.

What it does

Eval Self Grading is a promptfoo workflow that allows large language models to assess and grade their own generated outputs according to predefined expectations.

When to use - and when NOT to

Use this workflow when you need to have an LLM grade its own output according to predefined expectations. You can define your tests in a YAML configuration file or in CSV format.

Inputs and outputs

You provide a promptfooconfig.yaml file that defines your configuration. Alternatively, you can supply test definitions in a CSV file format.

How to use

Initialize the example workflow:

npx promptfoo@latest init --example eval-self-grading
cd eval-self-grading

Run the evaluation with the default YAML configuration:

promptfoo eval

Or run with tests defined in a CSV file:

promptfoo eval --tests tests.csv

Who it's for

Prompt engineers and AI developers working with promptfoo who want to add self-grading capabilities to their evaluation pipeline.

Source README

eval-self-grading (Self Grading)

You can run this example with:

npx promptfoo@latest init --example eval-self-grading
cd eval-self-grading

Usage

This example shows how you can have an LLM grade its own output according to predefined expectations.

The configuration is provided in promptfooconfig.yaml.

Run:

promptfoo eval

You can also define the tests in a CSV file:

promptfoo eval --tests tests.csv

FAQ

Common questions

Discussion

Questions & comments · 0

Sign In Sign in to leave a comment.