Skip to main content

PaperLab.space core

pip install paperlab-space

Evaluate LLMs on your own spreadsheet data and get paper-ready results.

Give it an Excel or CSV file, say which columns are inputs and answers, pick models and metrics, and get back an Excel workbook of outputs and scores, a LaTeX table for your paper, and a reproducibility config. paperlab-space is the open-source engine behind PaperLab.space; use it from the command line or from Python.

  • Spreadsheets in: .xlsx (any sheet), .csv, .tsv, with encoding detection and Unicode-safe handling for non-Latin scripts. Validation catches empty cells, duplicate IDs, and garbled text before you spend API calls.
  • Any model: OpenRouter (including free models), Gemini, OpenAI, Anthropic, Ollama, and everything else LiteLLM supports, run side by side. You bring your own API keys.
  • Robust runs: per-model rate limits tuned for free tiers, retries with backoff, and resume after interruption. A cost and time estimate is shown before anything is sent.
  • Metrics: exact match, accuracy (with label extraction from chatty answers), precision/recall/F1, token F1. Tokenisation handles Chinese, Japanese, Thai, and Burmese.
  • Paper-ready output: Excel, a booktabs LaTeX table, and a YAML config recording model versions, prompt, seed, metric settings, and a hash of your data.

PyPI

Status: early release (0.1). See PLAN.md for the roadmap: BLEU/chrF/ROUGE, LLM-as-judge, and significance tests are next.

Install

pip install paperlab-space

This installs both the Python library and the paperlab-space command.

Quickstart (command line)

export OPENROUTER_API_KEY=sk-or-...   # free key from https://openrouter.ai
export GEMINI_API_KEY=...             # free key from https://aistudio.google.com

paperlab-space init my_data.xlsx            # writes run.yaml, guessing the column roles
paperlab-space validate my_data.xlsx -i question -e answer   # check the data, preview JSONL
paperlab-space estimate run.yaml            # tokens, cost, and time; no requests sent
paperlab-space run run.yaml                 # writes results-run/

run.yaml looks like this (see examples/sentiment):

dataset:
  path: data.csv
mapping:
  input: text            # column(s) available to the prompt
  context: [language]    # extra columns available to the prompt
  expected: label        # the answer key (never shown to the model)
  id: id
prompt: |-
  Classify the sentiment of this {language} text as "positive" or "negative".
  Text: {text}
models:
  - openrouter/nvidia/nemotron-3-super-120b-a12b:free
  - id: gemini/gemini-2.5-flash
    temperature: 0
metrics:
  - name: accuracy
    labels: [positive, negative]
  - f1
seed: 42

The output folder contains:

File What it is
results.xlsx Summary sheet (scores, failures, cost), per-row outputs and scores, and the config
table.tex A booktabs table to \input{} into your paper
run.yaml The reproducibility config: re-run with paperlab-space run run.yaml
results.json Everything, for paperlab-space run run.yaml --resume results.json after an interruption

Free models change often; paperlab-space run stops a model early with a clear message if its ID no longer exists. Browse current free models at openrouter.ai/models.

Quickstart (Python)

from paperlab_space import ColumnMapping, RunConfig, estimate, export, load_dataset, run

data = load_dataset("my_data.xlsx", sheet="test")
config = RunConfig(
    mapping=ColumnMapping(input="question", expected="answer"),
    prompt="Answer briefly: {question}",
    models=["openrouter/nvidia/nemotron-3-super-120b-a12b:free", "gemini/gemini-2.5-flash"],
    metrics=["exact_match", "token_f1"],
)
print(estimate(config, data))
results = run(config, data)
print(results.scores["gemini-2.5-flash"]["exact_match"].value)
export.write_all(results, "results/")

run works in scripts and Jupyter notebooks. Use await arun(...) inside your own async code.

Metrics

Run paperlab-space metrics for the list. Every metric takes normalisation options in the config:

metrics:
  - exact_match                         # case-insensitive, trims punctuation like "Paris."
  - name: exact_match
    label: exact_match_strict           # same metric again with different options
    ignore_case: false
    trim_punctuation: false
  - name: f1
    average: macro                      # macro | micro | weighted

Custom metrics subclass paperlab_space.metrics.Metric and use the @register decorator.

Citing

If paperlab-space helps your research, please cite it. See CITATION.cff, or use "Cite this repository" on GitHub.

Development

uv sync
uv run pytest                   # unit tests, no network
uv run pytest -m live           # real-provider smoke tests (needs API keys)
uv run ruff check . && uv run ruff format --check .
uv run mypy src tests

License

Apache 2.0

Metadata

Release files for paperlab-space 0.1.1

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

Source distribution (sdist)

Source distribution for paperlab-space 0.1.1
File Size Uploaded
paperlab_space-0.1.1.tar.gz 287.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for paperlab-space 0.1.1
File Interpreter ABI Platform
paperlab_space-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 334.8 kB

Release files / paperlab_space-0.1.1.tar.gz

Download URL paperlab_space-0.1.1.tar.gz
Size 287.0 kB
Tags Source
SHA-256 checksum
How to use checksums
0456f1c67b9bdf569302f1dfd8f831b18e16cba416a3e800f7bfcbfb74665163
BLAKE2b-256 checksum
How to use checksums
83980a128ab0793a64d3bb3ad9c4be74ab380f4fff19a718e4db85a7fb408106
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 17, 2026.

Transparency log

Release files / paperlab_space-0.1.1-py3-none-any.whl

Download URL paperlab_space-0.1.1-py3-none-any.whl
Size 47.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c6bdae55f4d32ade037f0ad2ee18a5420d4bd7d9db2fa3a110075c948a988647
BLAKE2b-256 checksum
How to use checksums
4fa0f96ae281ab7449253acdddc839d2f601a6654d137b877a16398fda0757c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 17, 2026.

Transparency log

Release history Release notifications | RSS feed

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

This release

0.1.1 This release

2 release files

0.1.0

2 release files

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