Skip to content

Commit 026b3e1

Browse files
authored
Merge pull request #48 from awslabs/eval_mcp
Standalone eval-mcp on PyPI + backend cleanup
2 parents 7c45cc6 + 764cc00 commit 026b3e1

125 files changed

Lines changed: 7286 additions & 3242 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,3 +116,6 @@ terraform.tfvars
116116
# Local tool installs (deploy.sh auto-installs terraform/kubectl/helm here)
117117
.tools/
118118
.claude/
119+
120+
# Local eval log artifacts (synced via S3)
121+
logs/

.mcp.json

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
{
22
"mcpServers": {
3-
"synthetic-eval": {
4-
"command": "python",
5-
"args": ["-m", "backend.mcp_servers.synthetic.server_http"],
6-
"env": {
7-
"PYTHONPATH": "."
8-
}
3+
"eval": {
4+
"command": "eval-mcp"
95
}
106
}
117
}

AGENTS.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ Users interact through a chat interface. The agent uses MCP tools in this order:
88
## Adding a new model
99

1010
Update both files:
11-
1. `backend/mcp_servers/providers/server_http.py` — add to `PROMPTFOO_SUPPORTED_MODELS`
12-
2. `backend/core/bedrock_pricing.json` — add pricing (per 1M tokens)
11+
1. `eval_mcp/tools/server_http.py` — add to `SUPPORTED_MODELS`
12+
2. `eval_mcp/provider_pricing.json` — add pricing (per 1M tokens)
1313

1414
## Key files
1515

1616
| File | Purpose |
1717
|------|---------|
1818
| `backend/core/agent.py` | Agent system prompt and loop |
1919
| `backend/core/bedrock_client.py` | Bedrock client + API key auth helper |
20-
| `backend/core/bedrock_pricing.json` | Single source of truth for model pricing |
21-
| `backend/core/judge_config.py` | Default judge models and criteria |
22-
| `backend/mcp_servers/providers/server_http.py` | Model allowlist and discovery |
23-
| `backend/mcp_servers/synthetic/server_http.py` | Eval tools (QA gen, judge, config, run) |
20+
| `eval_mcp/server.py` | Unified MCP server (all eval tools) |
21+
| `eval_mcp/tools/` | Eval tools (QA gen, judge, config, run, …) |
22+
| `eval_mcp/provider_pricing.json` | Source of truth for model pricing |
23+
| `eval_mcp/core/judge_config.py` | Default judge models and criteria |
2424
| `Makefile` | Local dev commands (`make dev`, `make run`, `make stop`) |

Dockerfile

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
FROM python:3.12-slim
2+
3+
RUN apt-get update \
4+
&& apt-get install -y --no-install-recommends ca-certificates \
5+
&& rm -rf /var/lib/apt/lists/*
6+
7+
# uv = fast deterministic resolver (pip's backtracking is too slow on this graph)
8+
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
9+
10+
WORKDIR /app
11+
COPY pyproject.toml uv.lock ./
12+
COPY eval_mcp/ ./eval_mcp/
13+
COPY backend/ ./backend/
14+
15+
# Slim runtime: only the core deps. Add --extra providers if you eval
16+
# non-Bedrock models, --extra k8s-sandbox for containerized agent evals.
17+
RUN uv sync --locked --no-dev
18+
ENV PATH="/app/.venv/bin:$PATH"
19+
20+
# Persistent state (datasets, judges, configs, logs, reports)
21+
ENV EVAL_MCP_HOME=/data
22+
RUN mkdir -p /data
23+
24+
EXPOSE 8002
25+
26+
# Bedrock credentials come from the platform (instance role / IRSA / env).
27+
# S3 replication: set EVAL_MCP_BUCKET, or `eval-mcp config set bucket <name>`
28+
# inside a writable /data volume, or pre-write /data/config.json before launch.
29+
CMD ["eval-mcp", "serve", "--host", "0.0.0.0", "--port", "8002"]

INSTALL.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# For coding agents: installing eval-mcp
2+
3+
Follow this when a user asks you to install eval-mcp into their IDE.
4+
5+
## 1. Prerequisite check
6+
7+
User needs `uv`. Check: `command -v uv`. If missing, tell them to run `curl -LsSf https://astral.sh/uv/install.sh | sh` (or `brew install uv` on macOS).
8+
9+
## 2. Pick the IDE
10+
11+
Detect from what's present in the user's home:
12+
13+
| IDE | Check |
14+
|---|---|
15+
| Claude Code | `claude` on PATH or `~/.claude/` exists |
16+
| Cursor | `~/.cursor/` exists |
17+
| VS Code | `code` on PATH |
18+
| Kiro | `~/.kiro/` exists |
19+
| Codex CLI | `~/.codex/` exists |
20+
21+
If multiple, ask the user which.
22+
23+
## 3. Install
24+
25+
Run the one-command install for that IDE:
26+
27+
- **Claude Code**: `claude mcp add-json eval '{"type":"stdio","command":"uvx","args":["--from","llm-evaluation-system","eval-mcp"]}' --scope user`
28+
- **Cursor**: open `cursor://anysphere.cursor-deeplink/mcp/install?name=eval&config=eyJjb21tYW5kIjoidXZ4IiwiYXJncyI6WyItLWZyb20iLCJsbG0tZXZhbHVhdGlvbi1zeXN0ZW0iLCJldmFsLW1jcCJdfQ==` (or edit `~/.cursor/mcp.json`)
29+
- **VS Code**: `code --add-mcp '{"name":"eval","command":"uvx","args":["--from","llm-evaluation-system","eval-mcp"]}'`
30+
- **Kiro**: merge into `~/.kiro/settings/mcp.json` under `mcpServers.eval` — same JSON shape as Cursor. Back up first, atomic write.
31+
- **Codex**: append to `~/.codex/config.toml`: `[mcp_servers.eval]\ncommand = "uvx"\nargs = ["--from", "llm-evaluation-system", "eval-mcp"]`
32+
33+
For any manual JSON/TOML edit: back up first, merge — never clobber, atomic write.
34+
35+
## 4. Warm the cache
36+
37+
Run this so the user's first IDE launch is instant instead of waiting ~60s for uvx to fetch the package:
38+
39+
```bash
40+
uvx --from llm-evaluation-system eval-mcp --help >/dev/null
41+
```
42+
43+
## 5. Ask about S3 team sharing
44+
45+
> Want to share eval results, datasets, judges, and reports with teammates via a shared S3 bucket?
46+
47+
If **yes, team already has a bucket**:
48+
```bash
49+
uvx --from llm-evaluation-system eval-mcp init <bucket-name>
50+
```
51+
52+
If **yes, creating a new bucket** (first on the team):
53+
```bash
54+
git clone https://github.com/awslabs/llm-evaluation-system.git /tmp/eval-mcp-infra
55+
cd /tmp/eval-mcp-infra/infra/modules/eval-logs-bucket
56+
terraform init
57+
terraform apply -var="bucket_name=<bucket-name>"
58+
```
59+
Then `uvx --from llm-evaluation-system eval-mcp init <bucket-name>`. Tell the user: teammates just run `eval-mcp init <bucket-name>` — no Terraform needed.
60+
61+
Suggested bucket name if they don't have a preference: `eval-mcp-$(aws sts get-caller-identity --query Account --output text)` — globally unique, easy to remember.
62+
63+
If **no**: skip. They can enable it later with `eval-mcp init <bucket>`.
64+
65+
## 6. Tell the user to restart
66+
67+
- Claude Code / Cursor / VS Code: reload/restart the window or app
68+
- Kiro: save mcp.json — picks up automatically
69+
- Codex: must restart the CLI
70+
71+
## Uninstall
72+
73+
Reverse step 3 (remove the `eval` entry), restart.

README.md

Lines changed: 91 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,104 +1,144 @@
1+
<!-- mcp-name: io.github.awslabs/llm-evaluation-system -->
2+
13
# Agentic AI-Guided Evaluation Platform
24

3-
A web-based LLM evaluation platform deployed on AWS. Access it through a browser — each user gets their own isolated workspace. An expert AI agent guides you through the entire evaluation process via natural conversation: upload your documents, describe what you want to evaluate, and the agent handles dataset generation, judge configuration, execution, and analysis.
5+
An LLM evaluation system where you describe what you want to evaluate in natural language — an expert AI agent handles dataset generation, judge configuration, execution, and analysis end-to-end, and hands you back a PDF report.
46

57
## Features
68

79
- **Expert agent interface** — The agent knows evaluation best practices, recommends criteria and validates configurations before execution. No config files or CLI expertise needed.
8-
- **Jury system** — Multiple judges from different model families (e.g. Claude Sonnet, Nova Pro, Llama) each evaluate distinct aspects of every response — correctness, reasoning, completeness. Combining diverse judge families reduces self-preference bias, and aggregating weak signals from diverse judges and criteria produces stronger results than any single judge ([Verma et al., 2025](https://arxiv.org/abs/2502.20379), [Frick et al., 2025](https://arxiv.org/abs/2506.18203)).
10+
- **Jury system** — Multiple judges from different model families (e.g. Claude Sonnet, Nova Pro, Nemotron) each evaluate distinct aspects of every response — correctness, reasoning, completeness. Combining diverse judge families reduces self-preference bias, and aggregating weak signals from diverse judges and criteria produces stronger results than any single judge ([Verma et al., 2025](https://arxiv.org/abs/2502.20379), [Frick et al., 2025](https://arxiv.org/abs/2506.18203)).
911
- **Adaptable binary scoring** — Binary pass/fail per criteria rather than subjective numeric scales, shown to produce more reliable results across judges ([Chiang et al., 2025](https://arxiv.org/abs/2503.23339v2)). Criteria are tailored by the agent to what you're evaluating.
1012
- **Document-grounded synthetic data** — Upload PDFs, knowledge bases, or product docs and generate QA pairs grounded in your actual content, reflecting real customer scenarios.
11-
- **Agentic eval support** — Evaluate agent systems via Inspect AI's `sandbox_agent_bridge` (Strands, LangChain, any OpenAI-compatible framework).
12-
- **Multi-tenant isolation** — Each user gets isolated data directories. Eval results stored as immutable `.eval` log files.
13-
- **Integrated viewer** — Inspect AI's evaluation viewer embedded directly in the platform.
13+
- **Agentic eval support** — Evaluate any agent calling Bedrock (Strands, LangChain, custom boto3) with zero code modification via OpenTelemetry instrumentation.
14+
15+
## Quick Start
1416

15-
## Prerequisites
17+
### Prerequisites
1618

17-
- AWS CLI configured with credentials
18-
- An AWS account with Bedrock model access enabled
19+
- AWS credentials with Bedrock model access
20+
- [`uv`](https://docs.astral.sh/uv/getting-started/installation/) installed
21+
- Claude Code, Cursor, Kiro, VS Code, or any MCP-compatible IDE
1922

20-
That's it. The deploy script auto-installs Terraform, kubectl, and Helm locally.
23+
### Install
2124

22-
## Deploy
25+
Pick your IDE and paste / click.
2326

27+
**Claude Code** — one CLI command:
2428
```bash
25-
git clone https://github.com/awslabs/llm-evaluation-system.git && cd llm-evaluation-system
26-
./deploy.sh
29+
claude mcp add-json eval '{"type":"stdio","command":"uvx","args":["--from","llm-evaluation-system","eval-mcp"]}' --scope user
2730
```
2831

29-
The script will:
30-
1. Install any missing tools to `.tools/` (no sudo required)
31-
2. Validate AWS credentials and confirm the target account
32-
3. Deploy infrastructure in two layers (data, then platform)
33-
4. Build container images via CodeBuild
34-
5. Deploy the application via Helm
35-
6. Print the app URL and instructions for creating users
36-
37-
## User Management
32+
**Cursor** — one-click deeplink: [Install eval-mcp in Cursor](cursor://anysphere.cursor-deeplink/mcp/install?name=eval&config=eyJjb21tYW5kIjoidXZ4IiwiYXJncyI6WyItLWZyb20iLCJsbG0tZXZhbHVhdGlvbi1zeXN0ZW0iLCJldmFsLW1jcCJdfQ==)
33+
34+
**Kiro** — add to `~/.kiro/settings/mcp.json`:
35+
```json
36+
{
37+
"mcpServers": {
38+
"eval": {
39+
"command": "uvx",
40+
"args": ["--from", "llm-evaluation-system", "eval-mcp"]
41+
}
42+
}
43+
}
44+
```
3845

39-
After deployment, `deploy.sh` prompts you to create an initial admin user with a temporary password shown in the terminal.
46+
**Codex CLI** — add to `~/.codex/config.toml`, then restart Codex:
47+
```toml
48+
[mcp_servers.eval]
49+
command = "uvx"
50+
args = ["--from", "llm-evaluation-system", "eval-mcp"]
51+
```
4052

53+
**VS Code** (with GitHub Copilot MCP) — one CLI command:
4154
```bash
42-
./manage-users.sh create user@example.com # Create user, show temp password
43-
./manage-users.sh list # List all users
44-
./manage-users.sh delete user@example.com # Delete a user
55+
code --add-mcp '{"name":"eval","command":"uvx","args":["--from","llm-evaluation-system","eval-mcp"]}'
4556
```
4657

47-
Users must change the temporary password on first login.
58+
Using a coding agent to install? Point it at [INSTALL.md](INSTALL.md) — it handles the config edit, warms the uvx cache, and asks about optional S3 team sharing.
4859

49-
## Updating
60+
### Use
5061

51-
After code changes, re-run the deploy script:
62+
Ask your AI assistant to evaluate agents, models, or prompts — using a dataset you provide or one generated from your documents or context:
63+
64+
- "Evaluate my agent at `./my_agent.py`"
65+
- "Compare Claude Sonnet vs Nova Pro on this dataset"
66+
- "Test these three prompt templates against my golden QA set"
67+
- "Generate a dataset from this PDF and run an eval"
68+
69+
The agent picks the right mode, auto-generates whatever's missing (dataset, judge, criteria), runs it, opens the results viewer in your browser, and hands you a PDF report.
70+
71+
## Team Sharing (S3)
72+
73+
Share datasets, judges, configs, and eval results across your team via a shared S3 bucket. No servers needed.
74+
75+
### Setup
5276

5377
```bash
54-
./deploy.sh
78+
uvx --from llm-evaluation-system eval-mcp init my-team-evals
5579
```
5680

57-
It's fully idempotent — Terraform converges existing infrastructure, CodeBuild rebuilds images, Helm upgrades the release.
81+
User identity is auto-detected from your AWS credentials. Projects are auto-discovered from the bucket.
5882

59-
## Teardown
83+
### How it works
6084

61-
```bash
62-
./destroy.sh
85+
```
86+
s3://my-team-evals/
87+
users/alice/ ← Alice's evals, datasets, judges, configs (auto-replicated on every write)
88+
users/bob/ ← Bob's
89+
projects/project-alpha/ ← shared team evals
90+
projects/project-beta/ ← shared team evals
6391
```
6492

65-
This destroys the platform layer (EKS, CloudFront, ALB, Cognito, etc.) while **preserving data** (VPC, RDS database, S3 buckets, EBS volume). The script prints exact commands to delete preserved resources if you want a full cleanup.
93+
- Every write (eval result, dataset, judge, config, PDF report) auto-replicates to `users/{you}/` in the background
94+
- Every list/read auto-pulls from S3 first (debounced) so your local state mirrors S3
95+
- `eval-mcp share my-project` → promote your stuff to a shared project prefix
96+
- `eval-mcp sync` → manual reconcile (used after long offline periods or on a fresh laptop)
6697

67-
To destroy the data layer as well (VPC, RDS, S3 buckets):
98+
### Create the bucket
99+
100+
One person on the team runs this once:
68101

69102
```bash
70-
AWS_PROFILE=<your-profile> terraform -chdir=infra/data destroy -auto-approve
103+
git clone https://github.com/awslabs/llm-evaluation-system.git
104+
cd llm-evaluation-system/infra/modules/eval-logs-bucket
105+
terraform init
106+
terraform apply -var="bucket_name=my-team-evals"
71107
```
72108

73-
> **Note:** `destroy.sh` sets `AWS_PROFILE` internally, so it does not persist to your shell session. You must set it explicitly when running Terraform commands manually.
109+
## Deploy Full Platform on EKS
74110

75-
## Security
111+
For a multi-user web app with Cognito auth, chat UI, and per-user isolation, the repo also ships an EKS deployment. This is the heavyweight path — for most users the MCP above is enough.
76112

77-
All traffic is served over HTTPS through CloudFront with WAF protection. The application runs inside a private VPC — the load balancer is not exposed to the internet. Authentication is handled via Amazon Cognito. Secrets are managed through AWS Secrets Manager, and database access uses IAM authentication with no static passwords.
113+
```bash
114+
./deploy.sh
115+
```
78116

79-
## Run Locally
117+
The script auto-installs Terraform, kubectl, and Helm, then deploys the complete platform (Cognito auth, CloudFront, WAF, per-user isolation).
80118

81-
Test it on your machine with only Bedrock API access needed:
119+
### User Management
82120

83121
```bash
84-
# Using AWS SSO/profile
85-
AWS_PROFILE=my-profile make dev
86-
87-
# Using a Bedrock API key (no IAM credentials needed)
88-
AWS_BEARER_TOKEN_BEDROCK=your-key make dev
122+
./manage-users.sh create user@example.com
123+
./manage-users.sh list
124+
./manage-users.sh delete user@example.com
89125
```
90126

91-
Other commands: `make stop`, `make logs`, `make logs s=backend`, `make restart s=backend`, `make build`.
127+
### Teardown
128+
129+
```bash
130+
./destroy.sh
131+
```
92132

93-
Opens at **http://localhost:4001**. See [local/README.md](local/README.md) for details.
133+
Architecture details, OIDC config, Helm values, and manual deployment steps: [docs/DEVELOPMENT.md](docs/DEVELOPMENT.md).
94134

95-
## Development
135+
## Contributing / Local Development
96136

97-
For architecture details, infrastructure reference, OIDC identity provider configuration, Helm chart structure, manual deployment steps, and troubleshooting, see [docs/DEVELOPMENT.md](docs/DEVELOPMENT.md).
137+
See [docs/DEVELOPMENT.md](docs/DEVELOPMENT.md) for how to clone, run from source, rebuild the viewer frontend, and contribute.
98138

99139
## Acknowledgments
100140

101-
This platform is built on [Inspect AI](https://github.com/UKGovernmentBEIS/inspect_ai) by the UK AI Security Institute, an open-source framework for large language model evaluations.
141+
Built on [Inspect AI](https://github.com/UKGovernmentBEIS/inspect_ai) by the UK AI Security Institute.
102142

103143
## Legal Disclaimer
104144

0 commit comments

Comments
 (0)