Prompt Chain

Compare LLM outputs across 300+ models via unified API

Compare DeepSeek R1, GPT-4.1 Mini, and Claude 4 Sonnet on joke-telling using the AI/ML API provider in promptfoo.

Works with aimlapideepseekgpt 4claude

82
Spark score
out of 100
Updated 21 days ago
Version 0.121.18
Models
deepseek v3gpt 4oclaude 3 5 sonnet

Add to Favorites

Why it matters

Evaluate and compare responses from multiple language models through a single API integration to determine which model performs best for specific tasks like joke generation, content creation, or reasoning challenges.

Outcomes

What it gets done

01

Connect to 300+ AI models through AI/ML API with one API key

02

Run parallel evaluations across DeepSeek R1, GPT-4, and Claude models

03

Judge output quality using keyword matching and LLM-based evaluation

04

Benchmark model performance on creative and reasoning tasks

Install

Add it to your toolbox

Run in your project directory:

curl -fsSL https://spark.entire.vc/get/pfoo-provider-aiml-api | bash

Steps

Steps in the chain

01
Get API key from AI/ML API
02
Set API key environment variable
03
Run the evaluation

Overview

Provider Aiml Api

A promptfoo example using AI/ML API's single-key access to 300+ models to compare DeepSeek R1, GPT-4.1 Mini, and Claude 4 Sonnet on a joke-telling task. Use it as a template for comparing models from multiple providers through one API key. Requires an AI/ML API key from aimlapi.com.

What it does

This promptfoo example uses AI/ML API, which provides access to 300+ models through a single API key, to compare three different language models - DeepSeek R1 (advanced reasoning), GPT-4.1 Mini (fast and cost-effective), and Claude 4 Sonnet (balanced performance) - on a joke-telling task. Each model is asked to tell jokes about different topics, and results are evaluated for whether the joke contains relevant keywords and whether it's actually funny, judged by an LLM.

When to use - and when NOT to

Use this example as a template for comparing models from different providers (OpenAI, Anthropic, DeepSeek) side by side without managing separate API keys for each, since AI/ML API exposes them all through one key. It requires an AI/ML API key from aimlapi.com; the specific joke-telling task is illustrative, meant to be swapped out for whatever comparison task you actually need.

Inputs and outputs

npx promptfoo@latest init --example provider-aiml-api
cd provider-aiml-api

export AIML_API_KEY=your_api_key_here

npx promptfoo@latest eval

Results are scored on two dimensions: keyword relevance to the requested joke topic, and an LLM-judged funniness assessment, giving both a mechanical check and a qualitative one for the same output.

Integrations

Set AIML_API_KEY, then reference any of AI/ML API's 300+ supported models by name in the provider config - no separate provider setup per model vendor is needed.

Who it's for

Teams that want to benchmark models from multiple providers side by side through one API key, using this joke-telling comparison as a starting template for their own evaluation criteria.

Source README

provider-aiml-api (AI/ML API Provider)

This example shows how to use AI/ML API to compare different language models on a fun task - telling jokes!

AI/ML API provides access to 300+ models through a single API key, making it easy to compare models from different providers.

Setup

  1. Get your API key from AI/ML API

  2. Set your API key:

    export AIML_API_KEY=your_api_key_here
    
  3. Run the evaluation:

    npx promptfoo@latest eval
    

What this example does

This example compares three different models:

  • DeepSeek R1 - Advanced reasoning model
  • GPT-4.1 Mini - Fast and cost-effective
  • Claude 4 Sonnet - Balanced performance

The models are asked to tell jokes about different topics, and we evaluate:

  • Whether the joke contains relevant keywords
  • Whether the joke is actually funny (using an LLM judge)

You can run this example with:

npx promptfoo@latest init --example provider-aiml-api
cd provider-aiml-api

FAQ

Common questions

Discussion

Questions & comments ยท 0

Sign In Sign in to leave a comment.