Skip to main content

The TIRA Client

This is a python client for TIRA.io. Please find the documentation online.

Setup REST Client to Access Non-Public Endpoints

To get your API key, please navigate to the task for which you want to submit, click on "Submit" -> "Code Submission" or "Docker Submission" and the UI will show you your access token. With this, you can login:

tira-cli login --token YOUR-TOKEN-HERE

Admin-Only: Setup REST Client to Access Non-Public Endpoints

For admin-access to non-public endpoints, you will need an authentication via an API key to ensure that you have the correct access credentials. Please generate your admin API key online at tira.io/admin/api/keys and login your tira client:

tira-cli login --token YOUR-TOKEN-HERE

Admin-Only: Batch-Execution of jobs

To execute all approaches that have a positive review on one dataset on all datasets of a task, please run:

tira-cli admin batch-execution --task TASK

Admin-Only: Dataset submission

When preparing a dataset for tira-cli dataset-submission, the dataset card in README.md must define tira_configs.default_upload_name. This is the default file name participants should upload for the dataset and the dataset submission fails if it is missing.

tira_configs:
  default_upload_name: predictions.jsonl

Download The results of some Submission

You can download runs of published and unblinded submissions via:

from tira.rest_api_client import Client

tira = Client()
output = tira.get_run_output('<task>/<team>/<approach>', '<dataset>')

As an example, you can download all baseline BM25 runs submitted to TIREx via:

from tira.rest_api_client import Client
from tira.tirex import TIREX_DATASETS

tira = Client()

for dataset in TIREX_DATASETS:
    output = tira.get_run_output('ir-benchmarks/tira-ir-starter/BM25 Re-Rank (tira-ir-starter-pyterrier)', dataset)

Overview of public submissions

As an example, you can see all public software submissions submitted to TIREx via:

from tira.rest_api_client import Client

tira = Client()
submissions = tira.all_softwares("ir-benchmarks")

Export datasets

You can export datasets if you are the owner or if the dataset is public. Export a dataset via the cli:

tira-run --export-dataset '<task>/<tira-dataset>' --output-directory tira-dataset

Export a dataset via the python API:

from tira.rest_api_client import Client

tira = Client()
tira.download_dataset('<task>', '<tira-dataset>')

Running Jupyter Notebooks with TIRA

docker build -t tira/submission-base-image:1.0.0 -f Dockerfile .

Testing the model locally can be done using the following command:

tira-run \
  --input-directory ${PWD}/input \
  --output-directory ${PWD}/output \
  --image tira/submission-base-image:1.0.0 \
  --command 'tira-run-notebook --input $inputDataset --output $outputDir /workspace/template-notebook.ipynb'

Afterwards you can push the image to TIRA

docker push tira/submission-base-image:1.0.0

and set the command:

tira-run-notebook --input $inputDataset --output $outputDir /workspace/template-notebook.ipynb

Finally, if the actual processing in notebook is toggled via is_running_as_inference_server() (as seen in the template notebook) and your notebook defines a function named predict in the format

def predict(input_list: List) -> List:

you can start an inference server for your model with:

PORT=8001

docker run --rm -it --init \
  -v "$PWD/logs:/workspace/logs" \
  -p $PORT:$PORT \
  tira/submission-base-image:1.0.0 \
  tira-run-inference-server --notebook /workspace/template-notebook.ipynb --port $PORT

Exemplary request for a server running on localhost:8001 are

# POST (JSON list as payload)
curl -X POST -H "application/json" \
  -d "[\"element 1\", \"element 2\", \"element 3\"]" \
  localhost:8001

and

# GET (JSON object string(s) passed to the 'payload' parameter)
curl "localhost:8001?payload=\"element+1\"&payload=\"element+2\"&payload=\"element+3\""

Metadata

Release files for tira 0.0.207

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

Source distribution (sdist)

Source distribution for tira 0.0.207
File Size Uploaded
tira-0.0.207.tar.gz 1.4 MB Details

Built distribution (wheel)

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

Total release size: 5.1 MB

Release files / tira-0.0.207.tar.gz

Download URL tira-0.0.207.tar.gz
Size 1.4 MB
Tags Source
SHA-256 checksum
How to use checksums
063c093a2953588c1c0a907981e95ec5ca1098ad95c1a580962beed0388b7ed7
BLAKE2b-256 checksum
How to use checksums
390c1481367ee4f79df22451ccf88acf51a65d2b85f0b16baf9f89ac354d6e1f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.7

Release files / tira-0.0.207-py3-none-any.whl

Download URL tira-0.0.207-py3-none-any.whl
Size 3.7 MB
Tags Python 3
SHA-256 checksum
How to use checksums
33cd3780a3d7aac6106e98980044f57d3baa3cfa0da7d8af50ce57ad5ad532a6
BLAKE2b-256 checksum
How to use checksums
1c0e8ec95b7c0e45874ef983ee1460a37a3461bab7f7b012a742fa440c9c97dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.7

Release history Release notifications | RSS feed

This release

0.0.207 This release

2 release files

0.0.99

2 release files

0.0.98

2 release files

0.0.97

2 release files

0.0.96

2 release files

0.0.95

2 release files

0.0.94

2 release files

0.0.93

2 release files

0.0.92

2 release files

0.0.91

2 release files

0.0.90

2 release files

0.0.89

2 release files

0.0.88

2 release files

0.0.87

2 release files

0.0.86

2 release files

0.0.85

2 release files

0.0.84

2 release files

0.0.83

2 release files

0.0.82

2 release files

0.0.81

2 release files

0.0.80

2 release files

0.0.79

2 release files

0.0.78

2 release files

0.0.77

2 release files

0.0.76

2 release files

0.0.65

2 release files

0.0.64

2 release files

0.0.63

2 release files

0.0.62

2 release files

0.0.61

2 release files

0.0.59

2 release files

0.0.58

2 release files

0.0.57

2 release files

0.0.56

2 release files

0.0.55

2 release files

0.0.54

2 release files

0.0.53

2 release files

0.0.52

2 release files

0.0.51

2 release files

0.0.50

2 release files

0.0.49

2 release files

0.0.48

2 release files

0.0.47

1 release file

0.0.46

2 release files

0.0.38

2 release files

0.0.37

2 release files

0.0.36

2 release files

0.0.35

2 release files

0.0.34

2 release files

0.0.33

2 release files

0.0.32

2 release files

0.0.30

2 release files

0.0.29

2 release files

0.0.26

2 release files

0.0.25

2 release files

0.0.24

2 release files

0.0.21

2 release files

0.0.20

2 release files

0.0.19

2 release files

0.0.18

2 release files

0.0.17

2 release files

0.0.16

2 release files

0.0.15

2 release files

0.0.14

2 release files

0.0.13

2 release files

0.0.12

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

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