Skip to main content

PaperLab.space core

pip install 'paperlab-space[cli]'

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.

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[cli]'

Until the first PyPI release, install from GitHub:

pip install 'paperlab-space[cli] @ git+https://github.com/paperlab-space/paperlab-core'

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.0

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.0
File Size Uploaded
paperlab_space-0.1.0.tar.gz 287.0 kB Details

Built distribution (wheel)

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

Total release size: 335.0 kB

Release files / paperlab_space-0.1.0.tar.gz

Download URL paperlab_space-0.1.0.tar.gz
Size 287.0 kB
Tags Source
SHA-256 checksum
How to use checksums
d386d0dc11e05eedf2853b1ecf78566b0d06206d74e0b1eeb2b633514cd79ecb
BLAKE2b-256 checksum
How to use checksums
3c0b796d918cb1d7fcdaaa7b3140ef4be5115586861e8faf06c25d8a79003e0d
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.0-py3-none-any.whl

Download URL paperlab_space-0.1.0-py3-none-any.whl
Size 48.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6a115e7aaec07a4c66c63aeeb19cf2a0bd64dc3ac363e774a816896ebb75f316
BLAKE2b-256 checksum
How to use checksums
b92f8334df9196c9bf295de201c3036cc303a92e26b2e18f8e2dd18e36c8bf93
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

0.1.1

2 release files

This release

0.1.0 This release

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