rubric
rubric
Decision gist · record as of 2026-08-14
Yes, if you need to evaluate LLM outputs programmatically against weighted criteria. The library is young (Alpha, 205 days old) but actively maintained, has low install friction, and offers a clean abstraction over LLM-based grading with multiple evaluation strategies. Start with the default Gemini integration for prototyping; for production, implement a custom generate_fn with your preferred LLM provider. No known security vulnerabilities.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires GEMINI_API_KEY environment variable for the default generate function; custom LLM providers (OpenAI, Anthropic, etc.) require their own API keys and custom generate_fn implementation.
- Low install friction with a pure-Python wheel and five runtime dependencies (pydantic, google-genai, tenacity, python-dotenv, pyyaml).
- Last commit 2026-02-03 and 70 repository stars suggest active maintenance, though the package is classified as Alpha and only 205 days old.
License · maintenance · safety
MIT (permissive) — MIT license permits commercial and private use with minimal restrictions—you may use, modify, and distribute rubric freely as long as you include the license notice.
last release 2026-01-21 (205 days) · last repo commit 2026-02-03 · 70 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 150,565 downloads/mo, #10,961 on PyPI
Alternatives
Verify before relying
import asyncio
from rubric import Rubric, default_per_criterion_generate_fn
from rubric.autograders import PerCriterionGrader
async def main():
rubric = Rubric.from_dict([
{"weight": 10.0, "requirement": "Response mentions Paris"},
{"weight": 5.0, "requirement": "Response is concise"}
])
grader = PerCriterionGrader(generate_fn=default_per_criterion_generate_fn)
result = await rubric.grade("Paris is the capital of France.", autograder=grader)
print(f"Score: {result.score}")
asyncio.run(main())- Whether the three autograder strategies (PerCriterionGrader, PerCriterionOneShotGrader, RubricAsJudgeGrader) have documented performance or latency trade-offs.
- Whether custom generate functions can be synchronous or must be async.
- Behavior and scoring when all criteria weights are negative (error-detection rubrics) with edge cases.
What it is and what it does
Rubric is a Python library that automates evaluation of LLM outputs by scoring them against weighted criteria using an LLM as the judge. You define a rubric as a list of requirements, each with a weight; the library calls an LLM (via a pluggable generate function) to evaluate whether each criterion is met, then aggregates those verdicts into a final score. The score can be normalized to 0–1 or returned as a raw weighted sum.
The library ships with three evaluation strategies: PerCriterionGrader makes one inference call per criterion in parallel; PerCriterionOneShotGrader makes a single call for all criteria; and RubricAsJudgeGrader asks the LLM for a holistic 0–100 score. You can use the built-in Gemini integration for quick testing or plug in any LLM provider (OpenAI, Anthropic, local models) by writing a custom async generate function. All grading is async and uses Pydantic for structured outputs.
Use it for
- Evaluate chatbot or RAG system responses against domain-specific quality criteria with weighted importance.
- Detect and penalize specific errors in LLM outputs (e.g., hallucinations, missing facts) using negative-weight criteria.
- Compare multiple LLM models or prompts by scoring their outputs on the same rubric and aggregating results.
- Build automated grading pipelines for educational or content-generation workflows with custom scoring logic.
- Validate structured outputs from LLMs by checking for required fields or format compliance as pass/fail criteria.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need to evaluate LLM outputs programmatically against weighted criteria.
The library is young (Alpha, 205 days old) but actively maintained, has low install friction, and offers a clean abstraction over LLM-based grading with multiple evaluation strategies. Start with the default Gemini integration for prototyping; for production, implement a custom generate_fn with your preferred LLM provider. No known security vulnerabilities.
Install
rubric on PyPI
Before you install
Low install friction with a pure-Python wheel and five runtime dependencies (pydantic, google-genai, tenacity, python-dotenv, pyyaml). Last commit 2026-02-03 and 70 repository stars suggest active maintenance, though the package is classified as Alpha and only 205 days old.
Requires GEMINI_API_KEY environment variable for the default generate function; custom LLM providers (OpenAI, Anthropic, etc.) require their own API keys and custom generate_fn implementation.
License in practice
MIT license permits commercial and private use with minimal restrictions—you may use, modify, and distribute rubric freely as long as you include the license notice.
Quickstart
import asyncio
from rubric import Rubric, default_per_criterion_generate_fn
from rubric.autograders import PerCriterionGrader
async def main():
rubric = Rubric.from_dict([
{"weight": 10.0, "requirement": "Response mentions Paris"},
{"weight": 5.0, "requirement": "Response is concise"}
])
grader = PerCriterionGrader(generate_fn=default_per_criterion_generate_fn)
result = await rubric.grade("Paris is the capital of France.", autograder=grader)
print(f"Score: {result.score}")
asyncio.run(main())
Verify before relying
- Whether the three autograder strategies (PerCriterionGrader, PerCriterionOneShotGrader, RubricAsJudgeGrader) have documented performance or latency trade-offs.
- Whether custom generate functions can be synchronous or must be async.
- Behavior and scoring when all criteria weights are negative (error-detection rubrics) with edge cases.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 5 packagespydanticgoogle-genaitenacitypython-dotenvpyyaml |
| Maintenance | Aging 205 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 150,565 / month, #10,961 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 3 - AlphaIntended Audience :: DevelopersIntended Audience :: EducationLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Topic :: EducationTopic :: Software Development :: Libraries :: Python Modules |
Evidence: rubric-2.2.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “weighted rubric grading”
- rubricRubric is a Python library for evaluating LLM outputs against…
- color-matchercolor-matcher transfers color characteristics from one image to…
- harbor-rewardkitHarbor Rewardkit defines and runs verifiers for task evaluation,…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also openevals · textstat · autoevals · deepeval · ragas · llm · arize-phoenix-evals · instructor · strands-agents-evals