Files
wehub-resource-sync 0d3cb498a3
Deploy local.promptfoo.app / Deploy to Cloudflare Pages (push) Waiting to run
Test and Publish Multi-arch Docker Image / test (push) Waiting to run
Test and Publish Multi-arch Docker Image / build-docker-and-push-digests (map[digest-suffix:linux-amd64 platform:linux/amd64 runner:ubuntu-latest]) (push) Blocked by required conditions
Test and Publish Multi-arch Docker Image / build-docker-and-push-digests (map[digest-suffix:linux-arm64 platform:linux/arm64 runner:ubuntu-24.04-arm]) (push) Blocked by required conditions
Test and Publish Multi-arch Docker Image / merge-docker-digests (push) Blocked by required conditions
Test and Publish Multi-arch Docker Image / Attest Multi-arch Image (push) Blocked by required conditions
CI / Shell Format Check (push) Waiting to run
CI / Check Ruby (3.4) (push) Waiting to run
CI / CI Config (push) Waiting to run
CI / Test on Node ${{ matrix.node }} and ${{ matrix.os }}${{ matrix.shard && format(' (shard {0}/3)', matrix.shard) || '' }} (push) Blocked by required conditions
CI / Build on Node ${{ matrix.node }} (push) Blocked by required conditions
CI / Style Check (push) Waiting to run
CI / Generate Assets (push) Waiting to run
CI / Check Python (3.14) (push) Waiting to run
CI / Check Python (3.9) (push) Waiting to run
CI / Build Docs (push) Waiting to run
CI / Code Scan Action (push) Waiting to run
CI / Site tests (push) Waiting to run
CI / webui tests (push) Waiting to run
CI / Run Integration Tests (push) Waiting to run
CI / Run Smoke Tests (push) Waiting to run
CI / Go Tests (push) Waiting to run
CI / Share Test (push) Waiting to run
CI / Redteam (Production API) (push) Waiting to run
CI / Redteam (Staging API) (push) Waiting to run
CI / GitHub Actions Lint (push) Waiting to run
CI / Check Ruby (3.0) (push) Waiting to run
release-please / release-please (push) Waiting to run
release-please / build (push) Blocked by required conditions
release-please / publish-npm (push) Blocked by required conditions
release-please / publish-npm-backfill (push) Waiting to run
release-please / docker (push) Blocked by required conditions
release-please / publish-code-scan-action (push) Blocked by required conditions
release-please / attest-code-scan-action (push) Blocked by required conditions
Validate Renovate Config / Validate Renovate Configuration (push) Waiting to run
chore: import upstream snapshot with attribution
2026-07-13 13:24:08 +08:00
..

compare-deepseek-r1-vs-openai-o1 (DeepSeek-R1 vs OpenAI o1 Comparison)

You can run this example with:

npx promptfoo@latest init --example compare-deepseek-r1-vs-openai-o1
cd compare-deepseek-r1-vs-openai-o1

This example demonstrates how to benchmark DeepSeek's R1 model against OpenAI's o1 model using the Massive Multitask Language Understanding (MMLU) benchmark, focusing on reasoning-heavy subjects.

Prerequisites

  • promptfoo CLI installed (npm install -g promptfoo or brew install promptfoo)
  • OpenAI API key set as OPENAI_API_KEY
  • DeepSeek API key set as DEEPSEEK_API_KEY
  • Hugging Face account and access token (for MMLU dataset)

Hugging Face Authentication

To access the MMLU dataset, you'll need to authenticate with Hugging Face:

  1. Create a Hugging Face account at huggingface.co if you don't have one

  2. Generate an access token at huggingface.co/settings/tokens

  3. Set your token as an environment variable:

    export HF_TOKEN=your_token_here
    

    Or add it to your .env file:

    HF_TOKEN=your_token_here
    

Running the Eval

  1. Get a local copy of the promptfooconfig.

    You can clone this repository and from the root directory run:

    cd examples/compare-deepseek-r1-vs-openai-o1
    

    or you can get the example with:

    promptfoo init --example compare-deepseek-r1-vs-openai-o1
    
  2. Run the evaluation:

    promptfoo eval
    
  3. View the results in a web interface:

    promptfoo view
    

What's Being Tested

This comparison evaluates both models on reasoning tasks from the MMLU benchmark, specifically:

  1. Abstract Algebra: Advanced mathematical reasoning
  2. Formal Logic: Logical statement analysis
  3. High School Mathematics: Core problem-solving
  4. College Mathematics: Advanced mathematical concepts
  5. Logical Fallacies: Flaw identification in reasoning

Each subject uses 10 questions to keep the test manageable. You can edit this in promptfooconfig.yaml.

Test Structure

The configuration in promptfooconfig.yaml:

  1. Prompt Template: Encourages step-by-step reasoning for multiple choice questions
  2. Quality Checks:
    • 60-second timeout per question
    • Required step-by-step reasoning
    • Clear final answer format
  3. Evaluation Metrics:
    • Accuracy
    • Reasoning quality
    • Response time
    • Format adherence

Customizing

You can modify the test by editing promptfooconfig.yaml:

  1. Add more MMLU subjects:

    tests:
      - huggingface://datasets/cais/mmlu?split=test&subset=physics
    
  2. Try different prompting strategies:

    prompts:
      # Zero-shot with step-by-step reasoning (default)
      - |
        You are an expert test taker. Please solve the following multiple choice question step by step.
    
        Question: {{question}}
    
        Options:
        A) {{choices[0]}}
        B) {{choices[1]}}
        C) {{choices[2]}}
        D) {{choices[3]}}
    
        Think through this step by step, then provide your final answer in the format "Therefore, the answer is A/B/C/D."
    
      # Zero-shot with direct answer
      - |
        Question: {{question}}
    
        A) {{choices[0]}}
        B) {{choices[1]}}
        C) {{choices[2]}}
        D) {{choices[3]}}
    
        Answer with just the letter (A/B/C/D) of the correct option.
    
  3. Change the number of questions:

    tests:
      - huggingface://datasets/cais/mmlu?split=test&subset=physics&limit=20 # Test 20 questions per subject
    
  4. Adjust quality requirements:

    defaultTest:
      assert:
        - type: latency
          threshold: 30000 # Stricter 30-second timeout
    

Additional Resources