Skip to main content
Glama

evalgate

A zero-dependency CI/CD regression gate for prompts, models, and AI agents — plus a read-only Streamable HTTP MCP server for querying run history.

Point evalgate at an AI gateway, Gemini API, local CLI, or HTTP endpoint. It runs your test cases in parallel, grades outputs against deterministic assertions and latency/token budgets, diffs against baseline.json, and exits 1 on regressions so it drops straight into GitHub Actions.

Quick start

No pip dependencies required for the core CLI (Python 3.10+ stdlib only):

# Offline smoke test using bundled fixtures
python3 -m evalgate run \
  --target fixture \
  --suite cases/suite.json \
  --baseline cases/baseline.json \
  --out reports/latest.md \
  --fail-on-regression

Run against an AI gateway (OpenAI-compatible)

Works with any AI gateway (LiteLLM, OpenRouter, Cloudflare AI Gateway, vLLM, or OpenAI directly):

export EVALGATE_GATEWAY_URL="https://your-ai-gateway.example.com/v1"
export EVALGATE_API_KEY="your-key"

python3 -m evalgate run \
  --target gateway \
  --model gemini-2.5-flash \
  --suite cases/suite.json \
  --baseline cases/baseline.json \
  --out reports/latest.md \
  --fail-on-regression

Other targets

# Direct Gemini REST API (uses GEMINI_API_KEY)
python3 -m evalgate run --target gemini --model gemini-2.5-flash --fail-on-regression

# Any local CLI / script (pipes prompt to stdin, grades stdout)
python3 -m evalgate run --target cmd --cmd "python3 my_agent.py" --fail-on-regression

# Any custom HTTP agent endpoint
python3 -m evalgate run --target http --url https://agent.example.com/run --response-key answer

Promote a new baseline or diff two runs

python3 -m evalgate baseline --from reports/latest.json --out cases/baseline.json
python3 -m evalgate diff --baseline cases/baseline.json --candidate reports/latest.json

Related MCP server: AgentInspect MCP Server

Supported assertions

Each case in cases/suite.json supports any combination of:

  • JSON: json_valid, expected_keys, expected_json, strict_json

  • Text & safety: required_tokens, forbidden_tokens, forbidden_prefixes (CSV formula injection), regex_match, regex_not_match

  • Budgets: max_latency_ms, max_output_tokens

  • Custom grader: grader_cmd (pipes output to any shell/Python command; exit 0 = pass)

GitHub Actions

A ready-to-use workflow lives at .github/workflows/eval.yml. On every pull request it runs evalgate, posts/updates a sticky PR comment with the per-case regression table, and fails the check if any case regresses.

Remote MCP server

Expose your eval history to any MCP-compatible agent over Streamable HTTP:

pip install -e ".[mcp]"
python3 -m evalgate.mcp_server --port 8080

Read-only tools exposed:

  • list_eval_runs — recent runs with pass rate, p50 latency, and regression count

  • get_regression_diff — pass-rate and latency deltas against baseline

  • get_failing_cases — failing/regressed cases with exact reasons and outputs

  • get_flaky_cases — cases that oscillate between pass and fail across the last N runs

Deploy to Cloud Run behind IAM/IAP for per-user access control:

gcloud run deploy evalgate-mcp \
  --source . \
  --region us-central1 \
  --no-allow-unauthenticated

Tests

python3 -m unittest discover -s tests -v

License

MIT

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      A
      maintenance
      Read-only local MCP server for inspecting AgentInspect TypeScript AI-agent traces. Lists runs, exposes bounded causal-failure and TraceFacts evidence, evaluates TraceContract checks, compares runs, and creates share-checked evidence without mutating traces or invoking agent tools.
      28,919 npm
      213
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Exposes dify-eval's evaluation capabilities as an MCP server, enabling AI agents in MCP clients to run regression evaluations, compare runs, and manage human review workflows via natural language.
      5
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Enables MCP clients to query and diagnose machine-learning training runs through read-only tools for listing experiments, reading configurations and final metrics, comparing runs, sampling metric curves, and detecting training failures.
      6
      MIT