Skip to main content

Should you trust AI(LLM) sommelier?

Project description

SommBench: Assessing Sommelier Expertise of Language Models

arXiv Python 3.12+

SommBench is a multilingual benchmark for evaluating sommelier-level wine knowledge in large language models. It spans three complementary tasks — Wine Theory Q&A, Food & Wine Pairing, and Wine Feature Completion.

Quick Start

uv add sommbench

Create a .env file with your API credentials:

API_KEY="your-api-key"
API_BASE="https://api.openai.com/v1"

Run the full benchmark suite:

sommbench run "lm_studio/qwen3.5-0.8b-mlx"

Usage

Command Line

sommbench <COMMAND> <MODEL> [OPTIONS]

Commands

Command Description
run Runs all three benchmarks and prints the composite SommBench Score
wtqa Wine Theory Question-Answering — multiple-choice wine knowledge quiz
fwp Food & Wine Pairing — predicts whether a wine pairs with a dish (English only)
wfc Wine Feature Completion — fills in masked wine attributes via structured output

Examples

Run all benchmarks:

sommbench run "gpt-4o" --output ./benchmark_results/

Single task — WTQA on all languages:

sommbench wtqa "gpt-4o"

Specify languages for WFC (Italian and German):

sommbench wfc "gemini-1.5-pro" -l it -l de --batch-size 64 --output wfc_results.json

Multiple passes for FWP:

sommbench fwp "claude-sonnet-4-6" --num-passes 3 --output fwp_results.json

Extra model parameters:

sommbench run "lm_studio/my-model" --model-params '{"stop": ["<|im_end|>"], "max_tokens": 512}'

Inline credentials:

sommbench wtqa "gpt-4-turbo" --api-key "sk-..." --api-base "https://api.openai.com/v1"

Options

sommmbech --help
Option Description Default
model (positional) Required. Model name/identifier passed to LiteLLM.
--output <PATH> Output file (or directory) for results. results.json (results/ for run)
-l, --language <LANG> Language(s) to benchmark. Repeat for multiple. Not available for fwp. all
--num-passes <INT> Number of full benchmark passes (each pass evaluates every item once). 1
--batch-size <INT> Items per API batch call. 32
--sample-size <INT> Randomly sample N items instead of the full dataset. full dataset
--temperature <FLOAT> Sampling temperature forwarded to the model. model default
--no-think Append /no_think to prompts (disables extended reasoning on supported models). off
--model-params <JSON> JSON string of extra parameters forwarded to the model via LiteLLM (e.g. stop, max_tokens). none
--api-key <KEY> API key. Overrides API_KEY from .env. from .env
--api-base <URL> Base URL for the API endpoint. Overrides API_BASE from .env. from .env

Python API

Full suite — run all benchmarks in one call:

from pathlib import Path
from sommbench import run

run(
    model="gpt-4o",
    output=Path("results/"),
    api_key="sk-...",
    api_base="https://api.openai.com/v1",
)

Single task — run one benchmark with custom options:

import json
from sommbench import run_wtqa_benchmark

results = run_wtqa_benchmark(
    model="gpt-4o",
    language=["en", "de"],
    num_passes=2,
    api_key="sk-...",
    api_base="https://api.openai.com/v1",
    batch_size=16,
)

with open("wtqa_results.json", "w", encoding="utf-8") as f:
    json.dump(results, f, indent=4, ensure_ascii=False)

Granular workflow — run each task individually and compute the composite score:

from sommbench import (
    compute_sommbench_score,
    run_fwp_benchmark,
    run_wfc_benchmark,
    run_wtqa_benchmark,
)

api_key = "sk-..."
api_base = "https://api.openai.com/v1"

wtqa = run_wtqa_benchmark(model="gpt-4o", language=None, num_passes=1, api_key=api_key, api_base=api_base)
fwp  = run_fwp_benchmark(model="gpt-4o", num_passes=1, api_key=api_key, api_base=api_base)
wfc  = run_wfc_benchmark(model="gpt-4o", language=["en", "de", "it"], num_passes=1, api_key=api_key, api_base=api_base)

score = compute_sommbench_score(wtqa, fwp, wfc)
print(score)
# {'sommbench_score': 0.6821, 's_wtqa': 0.8012, 's_fwp': 0.5432, 's_wfc': 0.7019}

License

This project is licensed under the MIT License. See LICENSE for details.

Citation

If you use SommBench in your research, please cite:

@misc{brach2025sommbench,
    title={SommBench: Assessing Sommelier Expertise of Language Models},
    author={William Brach and Peter Hartman and Marek Šuppa},
    year={2025},
    eprint={2603.12117},
    archivePrefix={arXiv},
    primaryClass={cs.CL},
    url={https://arxiv.org/abs/2603.12117},
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sommbench-0.1.1.tar.gz (228.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sommbench-0.1.1-py3-none-any.whl (27.9 kB view details)

Uploaded Python 3

File details

Details for the file sommbench-0.1.1.tar.gz.

File metadata

  • Download URL: sommbench-0.1.1.tar.gz
  • Upload date:
  • Size: 228.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.16

File hashes

Hashes for sommbench-0.1.1.tar.gz
Algorithm Hash digest
SHA256 78c8da7e84da206ae9000dbbc86e5d754697669b88a530ae69cba2e0f9fc0646
MD5 fb9b6bfd4e61af55fc810ee724cb346a
BLAKE2b-256 9fdd5112350daaf61610db807fad6e18e9e50fc51a208f6b0b3de5913595d041

See more details on using hashes here.

File details

Details for the file sommbench-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: sommbench-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 27.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.16

File hashes

Hashes for sommbench-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fd48e34290bd26c165e8b88fcaa7802a161302ba104e3cfcf47ae233e1cafa7f
MD5 9dec44f05ce4f5b9402b247b3f827ec8
BLAKE2b-256 be8509a8cb252f22e5856df6407b1e79e255e5d5e1609ea0b8a6880c2e80b0c0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page