Skip to main content

Requirements

  • Python 3.12 or higher
  • pip or uv package manager
uv is a fast Python package installer and resolver:
# Install uv
curl -LsSf https://astral.sh/uv/install.sh | sh

# Install Merit directly from GitHub
uv pip install git+https://github.com/appMerit/merit.git

Install with pip

pip install git+https://github.com/appMerit/merit.git

Verify Installation

Check that Merit is installed correctly:
merit --version
You should see the Merit version number.

Set Up API Keys (Optional)

For AI Predicates (LLM-as-a-Judge)

If you plan to use AI-powered assertions, you’ll need Merit API credentials:
.env
MERIT_API_BASE_URL=https://api.appmerit.com
MERIT_API_KEY=your_merit_api_key_here
Get API Access: Contact us to get your Merit API key.AI predicates (has_facts, has_topics, etc.) call the Merit cloud service. Regular assertions work without any API keys.

For Error Analyzer (Bring Your Own Key)

If you plan to use Merit Analyzer, you’ll need Anthropic credentials (direct API or via AWS Bedrock):
ANTHROPIC_API_KEY=sk-ant-...
MODEL_VENDOR=anthropic
INFERENCE_VENDOR=anthropic
The analyzer uses your own Anthropic credentials directly (no Merit API required).

Project Setup

Create a new project directory:
mkdir my-ai-tests
cd my-ai-tests
Merit will automatically discover and run test files that:
  • Start with test_ or end with _test.py
  • Contain functions starting with merit_

Next Steps

Write Your First Test

Create and run your first Merit test