Skip to main content

Kaggle Benchmarks

Ask DeepWiki

kaggle-benchmarks is a Python library designed to help you rigorously evaluate AI models on tasks that matter to you. It provides a structured framework for defining tasks, interacting with models, and asserting the correctness of their outputs. The fastest way for you to write a task and run it on Kaggle is to point your AI coding agent to this write-kaggle-benchmarks skill.

This is especially useful for:

Features

  • Define Custom Tasks: Easily define evaluation tasks using a simple @kbench.task decorator.
  • Interact with Multiple LLMs: Programmatically interact with and compare various large language models.
  • Structured & Multimodal I/O: Go beyond plain text. Get structured dataclass or pydantic objects from models and provide image, audio, and video inputs.
  • Tool Use: Empower models with tools, including a built-in Python interpreter to execute code.
  • Robust Assertions: Use a rich set of built-in assertions or create your own to validate model outputs.
  • Dataset Evaluation: Run benchmarks over entire datasets (e.g., pandas DataFrames) to get aggregate performance metrics.

Getting Started

On Kaggle

The easiest way to use kaggle-benchmarks is directly within a Kaggle notebook.

Prerequisites: A Kaggle account.

Installation: No installation is needed! For early access, simply navigate to https://www.kaggle.com/benchmarks/tasks/new. This will create a new Kaggle notebook with the library and its dependencies pre-installed and ready to use.

Data Usage and Leaderboard Generation: When running in Kaggle notebook, each benchmark task outputs a task file and associated run files. These files are used to build the benchmark entity and display its results on a Kaggle leaderboard. An example can be seen on the ICML 2025 Experts Leaderboard.

Usage

Here is a simple example of a benchmark that asks a model a riddle and checks its answer.

import kaggle_benchmarks as kbench

@kbench.task(name="simple_riddle")
def solve_riddle(llm, riddle: str, answer: str):
    """Asks a riddle and checks for a keyword in the answer."""
    response = llm.prompt(riddle)

    # Assert that the model's response contains the answer, ignoring case.
    kbench.assertions.assert_contains_regex(
        f"(?i){answer}", response, expectation="LLM should give the right answer."
    )

# Execute the task
solve_riddle.run(
    llm=kbench.llm, # Uses the default LLM
    riddle="What gets wetter as it dries?",
    answer="Towel",
)

For a detailed walkthrough of the library's features, check out our documentation:

Supported Models

This library supports a wide range of models available through Kaggle's backend. The exact models available to you depend on your environment (Kaggle Notebook vs. local proxy token).

Contributing

Contributions are welcome! Please refer to our Contribution Guidelines for more details.

License

This project is licensed under the Apache License 2.0. See the LICENSE file for details.

Metadata

Release files for kaggle_benchmarks 0.6.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kaggle_benchmarks 0.6.2
File Size Uploaded Provenance Actions
kaggle_benchmarks-0.6.2.tar.gz 731.0 kB Without provenance Details for kaggle_benchmarks-0.6.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for kaggle_benchmarks 0.6.2
File Interpreter ABI Platform Actions
kaggle_benchmarks-0.6.2-py3-none-any.whl Python 3 none any Details for kaggle_benchmarks-0.6.2-py3-none-any.whl

Total release size: 887.3 kB

Release files / kaggle_benchmarks-0.6.2.tar.gz

Download URL kaggle_benchmarks-0.6.2.tar.gz
Size 731.0 kB
Tags Source
SHA-256 checksum
How to use checksums
2276b25b5a1197d3535d10fc2dad9aaf36954c3e29a0ce5d685c99ed28cb7f06
BLAKE2b-256 checksum
How to use checksums
523a19d9bac4a654f62e49c06c4926a89aaefbd384fed3e92c5561a25a4891ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.14

Release files / kaggle_benchmarks-0.6.2-py3-none-any.whl

Download URL kaggle_benchmarks-0.6.2-py3-none-any.whl
Size 156.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c6d56e0881a8701e3883dbd64a248fc6cffd02f4e690398b4212ead07b445b89
BLAKE2b-256 checksum
How to use checksums
781748285061cd2d4fa02b9748568f22a02684f302372bf86eba87be904dc724
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.14

Security for kaggle_benchmarks 0.6.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page