Skip to main content

A Python library encapsulating best practices for rubric-based evaluation of LLM/VLM outputs using LLM-as-a-judge.

Project description

PyPI version Python versions Website arXiv

AutoRubric

A Python library for evaluating text outputs against weighted criteria using LLM-as-a-judge.

  @misc{rao2026autorubric,
        title={Autorubric: A Unified Framework for Rubric-Based LLM Evaluation},
        author={Delip Rao and Chris Callison-Burch},
        year={2026},
        eprint={2603.00077},
        archivePrefix={arXiv},
        primaryClass={cs.CL},
        url={https://arxiv.org/abs/2603.00077},
  }

Installation

pip install autorubric

Quick Example

import asyncio
from autorubric import Rubric, LLMConfig
from autorubric.graders import CriterionGrader

async def main():
    grader = CriterionGrader(llm_config=LLMConfig(model="openai/gpt-5.1-mini"))

    rubric = Rubric.from_dict([
        {"weight": 10.0, "requirement": "States NMC cell-level energy density in the 250-300 Wh/kg range"},
        {"weight": 8.0, "requirement": "Identifies LFP thermal runaway threshold (~270°C) as higher than NMC (~210°C)"},
        {"weight": 6.0, "requirement": "States LFP cycle life advantage (2000-5000 cycles vs 1000-2000 for NMC)"},
        {"weight": -15.0, "requirement": "Incorrectly claims LFP has higher gravimetric energy density than NMC"}
    ])

    result = await rubric.grade(
        to_grade="""NMC cathodes (LiNixMnyCozO2) achieve 250-280 Wh/kg at the cell level,
        while LFP (LiFePO4) typically reaches 150-205 Wh/kg. However, LFP offers superior
        thermal stability with decomposition onset at ~270°C compared to ~210°C for NMC,
        and delivers 2000-5000 charge cycles versus 1000-2000 for NMC.""",
        grader=grader,
        query="Compare NMC and LFP cathode materials for EV battery applications.",
    )

    # result.score is `float | None` (None if the grade failed); guard before formatting.
    print(f"Score: {result.score:.2f}" if result.score is not None else "Score: n/a (grade failed)")
    for criterion in result.report:
        print(f"  [{criterion.final_verdict}] {criterion.criterion.requirement}")

asyncio.run(main())

Documentation

Full documentation, API reference, and a cookbook with several dozen recipes are available at autorubric.org.

Resource Link
Project site autorubric.org
API reference autorubric.org/docs/api
Cookbook autorubric.org/docs/cookbook

Features

Feature Description
Weighted criteria Positive and negative weights with explicit requirements
Per-criterion explanations Every verdict includes the judge's reasoning
100+ LLM providers OpenAI, Anthropic, Google, Azure, Groq, Ollama, and more via LiteLLM
Ensemble judging Combine multiple LLM judges with configurable aggregation strategies
Few-shot calibration Provide labeled examples to improve grading consistency
Multi-choice criteria Ordinal and nominal scales beyond binary met/unmet verdicts
Batch evaluation High-throughput EvalRunner with checkpointing and resumption
Metrics & validation Agreement metrics, bootstrap confidence intervals, distribution analysis
Length penalty Configurable penalty for overly long responses
Thinking/reasoning support Budget-controlled extended thinking for supported models
Response caching Disk-based caching to avoid redundant LLM calls
Dataset support Structured datasets with per-item rubrics, prompts, and ground truth
YAML configuration Define rubrics, LLM configs, and datasets in YAML
Meta-rubric evaluation Evaluate and automatically improve rubric quality

License

MIT License - see LICENSE file for details.

Acknowledgments

This research was developed with funding from the Defense Advanced Research Projects Agency’s (DARPA) SciFy program (Agreement No. HR00112520300). The views expressed are those of the author and do not reflect the official policy or position of the Department of Defense or the U.S. Government.

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

autorubric-1.5.0.tar.gz (210.5 kB view details)

Uploaded Source

Built Distribution

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

autorubric-1.5.0-py3-none-any.whl (172.6 kB view details)

Uploaded Python 3

File details

Details for the file autorubric-1.5.0.tar.gz.

File metadata

  • Download URL: autorubric-1.5.0.tar.gz
  • Upload date:
  • Size: 210.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.17 {"installer":{"name":"uv","version":"0.11.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for autorubric-1.5.0.tar.gz
Algorithm Hash digest
SHA256 67c5b0b5f5f02d8551f37afb85b9a8c5e40d6f574324500dcd962d1b5970b842
MD5 714cc4ab389898092ff046921e10dd29
BLAKE2b-256 eb31970979168f67d9287573807c133a81d43c526ffd8c220d6a39412729d9d8

See more details on using hashes here.

File details

Details for the file autorubric-1.5.0-py3-none-any.whl.

File metadata

  • Download URL: autorubric-1.5.0-py3-none-any.whl
  • Upload date:
  • Size: 172.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.17 {"installer":{"name":"uv","version":"0.11.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for autorubric-1.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5c8e9e29590a1781b8260196f9eaa33b3e8fc85e49ba417d6aa5b2544f6e990d
MD5 55895dd5cd3481e7e9359d235c1e7f1e
BLAKE2b-256 d5e5843ab4f8d0d41412f6bd831b3777a520c4a2776a203d4bae14b8974d9da7

See more details on using hashes here.

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