Usage of LLMs via REST API

TIRA usually executes software in a sandbox without internet access. If the organizers of a shared task explicitly allow outbound network access, you can use large language models through a REST API from within your TIRA submission.

Please contact the organizers of your shared task to confirm that this is allowed for your specific setup.

Warning

This page is still work in progress.

Example TREC-AUTO-Judge

The following example shows how to use an LLM via a REST API in TIRA for the TREC-AUTO-Judge shared task. The example uses the tinyjudge reference implementation from the auto-judge-starter-kit repository.

tinyjudge expects the model configuration via the environment variables OPENAI_API_KEY, OPENAI_BASE_URL, and OPENAI_MODEL.

  1. Export the environment variables locally:

export OPENAI_API_KEY=...
export OPENAI_BASE_URL=...
export OPENAI_MODEL=...
  1. In the auto-judge-starter-kit repository, create a TIRA code submission. The example below uses --dry-run so that you can verify the setup locally first. Remove --dry-run once everything works as expected to upload the software to TIRA.

tira-cli code-submission \
    --dry-run \
    --path . \
    --file judges/tinyjudge/Dockerfile \
    --task trec-auto-judge \
    --dataset kiddie-20260605-training \
    --forward-environment-variable OPENAI_API_KEY OPENAI_BASE_URL OPENAI_MODEL \
    --command 'auto-judge run --workflow /auto-judge/judges/tinyjudge/workflow.yml --rag-responses $inputDataset/runs/*/ --rag-topics $inputDataset/topics/*.jsonl --out-dir $outputDir'

This command tells TIRA to forward the three environment variables to the submission and to execute the tinyjudge workflow inside the container on your machine.

  1. By removing --dry-run, you can upload your software to TIRA.

The output should look similar to this:

../_images/auto-judge-example.png

Uploading the software.

  1. The uploaded software can be started in the TIRA web interface from your submission page where you can provide the environment variables.

../_images/forward-llm-environment-variables.png

Running a software in TIRA with forwarded environment variables.

  1. After the shared task, revoke the forwarded credentials or shut down the proxy that provided access to the model.