How should I compare cheap and premium LLMs before choosing one?

Test cheap and premium LLMs on your own prompts, quality rubric and cost per accepted result before choosing a production model.

Build a small test set

Measure what users notice

Make the decision explicit

Example

from openai import OpenAI

client = OpenAI(api_key="YOUR_TOKENREX_KEY", base_url="https://tokenrex.ai/api/public")

resp = client.chat.completions.create(
    model="claude-sonnet-5",
    messages=[{"role": "user", "content": "Return JSON with the invoice number, total and due date"}],
    max_tokens=150,
)
print(resp.choices[0].message.content)
Get API keyCost calculatorDocs

Questions

How many test prompts do I need?
Start with 20 to 50 representative requests, then expand around failures.
Can I compare models with one key?
Yes. Use the same TokenRex key and change only the enabled model ID.

Related