Skip to main content

jtc-client

jtc-client is a small, standalone Python client for Judges That Code tool services. The first public client is JudgeClient, which calls the /judge endpoint exposed by a JTC/LiteRegistry gateway.

The package intentionally contains no model-serving or dataset code. Its only runtime dependency is aiohttp.

Install

pip install jtc-client

For local development:

pip install -e ".[test,publish]"

Judge one output

import asyncio
import json

from jtc_client import JudgeClient


async def main() -> None:
    client = JudgeClient(
        "http://127.0.0.1:1212/judge",
        service_model_path="judge",
        timeout=600,
        max_retries=3,
    )
    response = await client.verify_output(
        input="What is the capital of France?",
        output="The capital of France is Paris.",
        rubrics=[
            "The response correctly identifies Paris as the capital of France."
        ],
        model="/models/my-rubric-judge",
    )
    print(json.dumps(response, indent=2))


asyncio.run(main())

model selects the LLM that performs the judgment. service_model_path selects the /judge service pool through the gateway. They are intentionally separate fields.

Lion-4B example

See examples/lion4b.py for the concrete Lion-4B judge configuration used by JTC.

The example expects a local LiteRegistry gateway on port 1212. For the existing Jupiter registry, launch one with:

literegistry gateway \
  --registry redis://jupiter-cs-aus-183.reviz.ai2.in:59936 \
  --port 1212

The Lion-4B model pool and the service registered as rubrichub-lion4b-step800-per-rubric-judge must already be alive in that registry.

Request contract

The client sends this JSON object to /judge:

{
  "input": "original task",
  "output": "candidate response",
  "rubrics": ["one or more textual criteria"],
  "model": "/registered/judge/model",
  "model_path": "judge-service-name"
}

The complete JSON object returned by the server is returned unchanged. It normally contains one judgment and trace per supplied rubric.

Build and publish

python -m build
python -m twine check dist/*
python -m twine upload dist/*

Publishing requires a PyPI account and token. Verify that the distribution name jtc-client is available before the first upload.

Metadata

Release files for jtc-client 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 jtc-client 0.1.0
File Size Uploaded
jtc_client-0.1.0.tar.gz 7.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for jtc-client 0.1.0
File Interpreter ABI Platform
jtc_client-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 14.6 kB

Release files / jtc_client-0.1.0.tar.gz

Download URL jtc_client-0.1.0.tar.gz
Size 7.9 kB
Tags Source
SHA-256 checksum
How to use checksums
ee812dca48ee548b8d3f60cc2bd157c3d3f44f8b23399cd7bb271a6389cf23f2
BLAKE2b-256 checksum
How to use checksums
ff592d3e148c50b437b5af832b0525e39fccf950050e7152bf8774219cbf7bfb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Release files / jtc_client-0.1.0-py3-none-any.whl

Download URL jtc_client-0.1.0-py3-none-any.whl
Size 6.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
37fdda7afc544ad7a8bc53f70e35b4e38633cfb5f98b8c1d3ef6b57135921e7c
BLAKE2b-256 checksum
How to use checksums
723db87647f0b56dbbc279a4c1d0171ced0a0aa5cf8a5ecccc29b37cf2c5312e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Release history Release notifications | RSS feed

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