# OpenEvals

> Ready-made evaluators and LLM-as-judge scorers for testing LLM applications

- Category: Evaluation & Production Ops / Evaluation & Red-Teaming
- Language: Python
- Repository: https://github.com/langchain-ai/openevals
- Canonical page: https://ai-tldr.dev/tools/openevals/

## In short

OpenEvals is an open-source package from LangChain that gives you a starting point for writing evals for LLM applications. Much like tests in traditional software, evals help you check that your model's outputs meet a standard before you ship to production. It sits in the Evaluation & Red-Teaming category of the Evaluation & Production Ops tools and is open-source, written in Python.

## Overview

OpenEvals is an open-source package from LangChain that gives you a starting point for writing evals for LLM applications. Much like tests in traditional software, evals help you check that your model's outputs meet a standard before you ship to production. The package ships ready-made evaluators you can run as-is, then extend with criteria specific to your own app.

It centers on LLM-as-judge evaluators: you pass inputs and outputs to a scorer backed by a model, and it returns a score plus a comment explaining the result. Some evaluators are reference-free, while others compare against an expected reference output. There are also prebuilt prompts for things like conciseness, RAG correctness and groundedness, structured-output and tool-call checks, and code type-checking.

It sits in the evaluation and testing space alongside other eval frameworks. It is available for both Python and TypeScript, so it fits teams building LLM features in either ecosystem. If you specifically need to evaluate LLM agents, the authors point to a companion package, agentevals.

## What it does

- LLM-as-judge evaluators that return a score and an explanatory comment
- Prebuilt prompts for quality, safety, security, RAG, and more (for example CONCISENESS_PROMPT)
- Both reference-free and reference-based evaluators for comparing against expected outputs
- Customizable output scores, model, and prompts to fit your own criteria
- Evaluators for structured output, tool calls, and code type-checking
- Available for both Python and TypeScript

## Getting started

Install the package, set an OpenAI API key for the judge model, then run your first LLM-as-judge eval.

1. Install OpenEvals

   Install with pip for Python, or with npm (alongside @langchain/core) for TypeScript.

```bash
pip install openevals
```

2. Set your OpenAI API key

   The quickstart evaluator is powered by an OpenAI model used as the judge, so export your key as an environment variable.

```bash
export OPENAI_API_KEY="your_openai_api_key"
```

3. Run your first eval

   Create an LLM-as-judge evaluator from a prebuilt prompt, then call it with your inputs and outputs to get a score and comment.

```python
from openevals.llm import create_llm_as_judge
from openevals.prompts import CONCISENESS_PROMPT

conciseness_evaluator = create_llm_as_judge(
    prompt=CONCISENESS_PROMPT,
    model="openai:gpt-5.4",
)

inputs = "How is the weather in San Francisco?"
outputs = "Thanks for asking! The current weather in San Francisco is sunny and 90 degrees."

eval_result = conciseness_evaluator(
    inputs=inputs,
    outputs=outputs,
)

print(eval_result)
```

## When to use it

- Score the conciseness, correctness, or safety of your LLM's responses before release
- Catch regressions in a RAG pipeline by checking groundedness and retrieval relevance
- Validate that structured outputs or tool calls match an expected schema
- Build a custom eval suite by extending the prebuilt prompts with your own criteria
