Skip to main content

Compare GPT-4, Claude & Gemini Responses with Contextual AI's LMUnit Evaluation

Workflow preview

Workflow preview
100%
Compare GPT-4, Claude & Gemini Responses with Contextual AI's LMUnit Evaluation preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

PROBLEM Evaluating and comparing responses from multiple LLMs (OpenAI, Claude, Gemini) can be challenging when done manually. Each model produces outputs that differ in clarity, tone, and reasoning...

Best for

  • Engineering automation workflows
  • AI Summarization automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

@n8n/n8n-nodes-langchain.chattrigger, n8n-nodes-contextualai.contextualai, n8n-nodes-base.set, n8n-nodes-base.merge, n8n-nodes-base.code, n8n-nodes-base.splitinbatches, n8n-nodes-base.wait, @n8n/n8n-nodes-langchain.chat

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Jinash Rouniyar.

Original n8n.io source

1.1 Workflow description

Title
Compare GPT-4, Claude & Gemini Responses with Contextual AI's LMUnit Evaluation
Workflow name
Compare GPT-4, Claude & Gemini Responses with Contextual AI's LMUnit Evaluation

PROBLEM

Evaluating and comparing responses from multiple LLMs (OpenAI, Claude, Gemini) can be challenging when done manually.

  • Each model produces outputs that differ in clarity, tone, and reasoning structure.
  • Traditional evaluation metrics like ROUGE or BLEU fail to capture nuanced quality differences.
  • Human evaluations are inconsistent, slow, and difficult to scale.

This workflow automates LLM response quality evaluation using Contextual AI’s LMUnit, a natural language unit testing framework that provides systematic, fine-grained feedback on response clarity and conciseness.

> Note: LMUnit offers natural language-based evaluation with a 1–5 scoring scale, enabling consistent and interpretable results across different model outputs.

How it works

  • A chat trigger node collects responses from multiple LLMs such as **OpenAI GPT-4.1, Claude 4.5 Sonnet, and Gemini 2.5 Flash.
  • Each model receives the same input prompt to ensure fair comparison, which is then aggregated and associated with each test cases
  • We use Contextual AI's LMUnit node to evaluate each response using predefined quality criteria:
    • “Is the response clear and easy to understand?” - Clarity
    • “Is the response concise and free from redundancy?” - Conciseness
  • LMUnit then produces evaluation scores (1–5) for each test
  • Results are aggregated and formatted into a structured summary showing model-wise performance and overall averages.

How to set up

How to customize the workflow

  • Add more evaluation criteria (e.g., factual accuracy, tone, completeness) in the LMUnit test configuration.
  • Include additional LLM providers by duplicating the response generation nodes.
  • Adjust thresholds and aggregation logic to suit your evaluation goals.
  • Enhance the final summary formatting for dashboards, tables, or JSON exports.
  • For detailed API parameters, refer to the LMUnit API reference.
  • If you have feedback or need support, please email [email protected].

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - When chat message received

Type / Role
@n8n/n8n-nodes-langchain.chatTrigger - chatTrigger
Config choices
Version 1.3

Block 2 - Run LMUnit

Type / Role
n8n-nodes-contextualai.contextualAi - contextualAi
Config choices
Version 1

Block 3 - Preprocess OpenAI Response

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 4 - Preprocess Gemini Response

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 5 - Combine responses

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 3.2

Block 6 - Add unit tests to responses

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 7 - Iterate over each unit tests

Type / Role
n8n-nodes-base.splitInBatches - splitInBatches
Config choices
Version 3

Block 8 - Wait for 3 sec

Type / Role
n8n-nodes-base.wait - wait
Config choices
Version 1.1

Block 9 - Associate scores with Responses

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 10 - Group Results Together

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 11 - Format Final Result

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 12 - Final Response

Type / Role
@n8n/n8n-nodes-langchain.chat - chat
Config choices
Version 1

Block 13 - Preprocess Anthropic Response

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 14 - OpenAI GPT 4.1

Type / Role
@n8n/n8n-nodes-langchain.openAi - openAi
Config choices
Version 1.8

Block 15 - Gemini 2.5 Flash

Type / Role
@n8n/n8n-nodes-langchain.googleGemini - googleGemini
Config choices
Version 1

Block 16 - Claude 4.5 Sonnet

Type / Role
@n8n/n8n-nodes-langchain.anthropic - anthropic
Config choices
Version 1

Block 17 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 18 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 19 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 20 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow Compare GPT-4, Claude & Gemini Responses with Contextual AI's LMUnit Evaluation
Complexity advanced
Nodes 20
Categories Engineering, AI Summarization
Author Jinash Rouniyar
Published 09 Dec 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/11618/11618.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Compare GPT-4, Claude & Gemini Responses with Contextual AI's LMUnit Evaluation do?

PROBLEM Evaluating and comparing responses from multiple LLMs (OpenAI, Claude, Gemini) can be challenging when done manually. Each model produces outputs that differ in clarity, tone, and reasoning...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Engineering, AI Summarization use case.