Code librariesReviewed · HowieHwong

TrustLLM: trustworthiness benchmark toolkit for large language models

TrustLLM is a Python toolkit and benchmark for researchers and developers who want to measure how trustworthy a large language model is across six dimensions. Its main catches are that full scoring may need an API judge model that can cost money, and that 0.4 runs are not automatically equivalent to the original paper's settings. It installs from GitHub, downloads a benchmark dataset, generates responses from an API or local Hugging Face model, and scores them for truthfulness, safety, fairness, robustness, privacy and ethics.

Researched 14 Nov 2026

In short.

TrustLLM is an open-source Python toolkit and benchmark for researchers and developers who need to evaluate large language models for trustworthiness. Its main catches are that scoring can rely on an API judge whose calls can incur charges, and that generation formatting and model integrations changed; new runs are not automatically equivalent to the original paper's settings. Technically, the README documents four command-line commands: download the dataset, list tasks, generate responses from an API or local model, then evaluate the saved responses. Its Python example separately demonstrates only two functions, download_dataset and generate. Six scoring pipelines cover truthfulness, safety, fairness, robustness, privacy and ethics. This report is based only on the README and the MIT licence file; nothing was installed or run.

Researched and written by an AI model and checked by a second AI model. How it works

The selected scope is only the README.md file at [https://github.com/HowieHwong/TrustLLM/blob/main/README.md], captured at revision c3edca246f39f778f666366c1e30cfdb95b2e43e with a complete capture of that file. The LICENSE file (MIT) at the same revision was captured as a related notice beside it but is outside the selected scope. Excluded and not reviewed: the source code, linked documentation guides, the dataset, paper, leaderboard, changelog, CI and images. Behaviour of the package (installation, generation, scoring, costs and results) is untested; everything about it is the README's description.

The overview

What this resource is

TrustLLM is an open research toolkit for evaluating the trustworthiness of large language models. The README ties it to an ICML 2024 paper [https://arxiv.org/abs/2401.05561] and links a documentation site [https://howiehwong.github.io/TrustLLM/], a dataset on Hugging Face [https://huggingface.co/datasets/TrustLLM/TrustLLM-dataset] and a leaderboard [https://trustllmbenchmark.github.io/TrustLLM-Website/leaderboard.html].

The package is a Python library with a command line, run as python -m trustllm. The README says the install is the 0.4 source version taken directly from the GitHub repository (HowieHwong/TrustLLM), under the subdirectory trustllm_pkg. The copyright line in the licence names Yue Huang (2024). The README links six translated README versions, but detailed guides are English only.

Overall assessment

On the evidence read, this is a substantive, well-documented evaluation toolkit with a clear workflow, explicit install commands, a Python API and stated caveats. It is most useful for people who need a structured, repeatable way to probe a model on trust-related behaviours rather than a single score from an ad hoc test.

The main catches are cost and comparability. Scoring can use an API judge whose calls may be charged, and the README states that new 0.4 runs are not automatically equivalent to the original paper's settings. Whether results match published leaderboard numbers is therefore not established. Nothing was run for this report, so install success, runtime and score quality are untested.

Who it is for

The README frames the toolkit as a research tool, so it suits LLM researchers, model developers and evaluation or safety teams who want to benchmark an API-served or locally hosted model across six dimensions. It also addresses people automating evaluations with an AI agent, pointing to an agent integration guide (docs/guides/agents.md) and a machine-readable index at [https://howiehwong.github.io/TrustLLM/llms.txt].

It assumes comfort with a terminal, Python packaging, environment variables and Git. Beginners can follow the short smoke-test commands, but interpreting the dimensions, judge models and scoring needs some background in model evaluation. It is not an end-user chat tool.

What it can do

The README lists four commands: download (fetch the benchmark data), tasks (list tasks), generate (collect model responses) and evaluate (score them). The README demonstrates download_dataset and generate in Python.

The six dimensions and their focus areas are: Truthfulness (misinformation, hallucination, sycophancy), Safety (jailbreaks, misuse, exaggerated safety), Fairness (stereotypes, preferences, disparagement), Robustness (adversarial perturbations, out-of-domain inputs), Privacy (privacy awareness, information leakage) and Ethics (moral judgments, moral choices).

Generation works with two backends: an API backend using text-only Chat Completions against an OpenAI-compatible endpoint (including a local server), and a local backend for Hugging Face Transformers causal language models that uses the tokenizer's chat template when available. According to the 0.4 notes, it accepts arbitrary model IDs, retries API calls a bounded number of times, writes per-sample checkpoints, records explicit failures, supports a guarded --resume, and saves dataset hashes, settings, dependency versions and usage where the API returns it. Generation runs also produce an HTML report (report.html) with completion counts.

Using it

What you need

Stated requirements: Python with pip, and Git (the install pulls from GitHub). For API generation, an endpoint set via OPENAI_BASE_URL or the base_url Python argument, plus an API key via OPENAI_API_KEY or the api_key argument when the endpoint requires authentication; the README says an API key is optional for a local OpenAI-compatible server that does not require one. For local weights, the optional local extra, Hugging Face model access, and enough hardware for the chosen model. For scoring, the optional eval extra, and for some tasks a downloaded classifier, embeddings or an API judge selected through OPENAI_JUDGE_MODEL.

Not stated in the README: the supported Python versions, operating systems, disk space for the dataset and classifiers, GPU memory needs, or how long a full run takes. These are unknown from the captured evidence and may be covered in the unreviewed linked guides.

How it works

The workflow separates generation from scoring. First the benchmark data is downloaded to a local folder. Then generate sends each sample from the chosen task to the model, through an API or local weights, and writes JSON response files plus a generation report. Then evaluate reads a complete directory of responses and writes scores.json and scores.html; it rejects incomplete responses.

The README says the six scoring pipelines retain the original benchmark methods, and that depending on the task scoring uses rules, a downloaded classifier, embeddings, or an API judge. JSON response files stay compatible with the existing res-based evaluators. The original generation engine is archived under trustllm.generation.legacy, with an optional legacy dependency set. The README links docs/benchmark.md as a dataset and metric reference and docs/guides/evaluation.md as a scoring guide; their contents are not established by the retained evidence.

Setup steps

The README gives these steps. One: install the base package with pip from the GitHub URL (no GPU libraries needed), and replace main with a commit SHA for reproducible runs. Two: run python -m trustllm download --output data, then python -m trustllm tasks. Three: set OPENAI_API_KEY and OPENAI_BASE_URL and run generate with --backend api, a model ID, a task such as safety, the data path, and options like --limit and --concurrency.

For local models, install the local extra and run generate with --backend local and a Hugging Face ID or a local checkpoint path, choosing a device with --device (auto, cpu, cuda:0 or mps). For scoring, install the eval extra and run python -m trustllm evaluate --task safety --data followed by the full-run output directory. The README points to docs/guides/running.md for JSON configs, retries, model revisions, token settings and resuming, and to docs/guides/evaluation.md before a full run.

Worked example from the README

The README's own smoke test: after downloading the data, set the credentials and run python -m trustllm generate --backend api --model your-model-id --task safety --data data/dataset --limit 5 --concurrency 4 --output runs/api-safety. The --limit 5 option takes five samples per dataset file, not five in total. Then open runs/api-safety/report.html to see completion counts. That report tracks generation, not benchmark scores.

For a full run you remove the limit, use a new output directory and then run evaluate against that directory. For a local OpenAI-compatible server the README suggests [http://localhost:8000/v1] as the base URL and the served model ID; an API key is optional if the server does not need one. This example is quoted from the documentation and was not run for this report.

Assessment & evidence

Limitations and risks

Stated by the README: API mode is text-only Chat Completions; local loading supports Transformers causal language models; generation formatting and model integrations changed in 0.4, so new runs are not automatically equivalent to the original paper's settings; the generation report does not show scores; evaluation rejects incomplete responses; and judge-based scoring depends on a judge model available to your account and may be charged.

Also from the README: the install tracks the main branch unless you pin a commit SHA, so results can change between installs. Not assessed: install reliability, correctness of scoring, agreement of 0.4 results with published leaderboard numbers, and the content of the dataset. Because the Safety dimension covers jailbreaks and misuse, the data may contain harmful or offensive prompts; this was not reviewed, so handle datasets and model outputs with that in mind. Detailed guides were not captured.

Why this assessment

The assessment rests on two captured files: the README at revision c3edca246f39f778f666366c1e30cfdb95b2e43e and the MIT licence file. The README is specific: it gives exact commands, option names, environment variables, extras, output file names and a changelog of 0.4, which supports a concrete description of what the toolkit does.

Its stated trade-offs are taken at face value and reported as the project's own claims: generation formatting and model integrations changed, so new runs are not automatically equivalent to the original paper's settings; judge calls can incur charges; and API mode is text-only. Anything the README does not establish, such as performance, runtime, hardware needs, dataset licences and result quality, is marked unknown rather than inferred.

Alternatives

The README does not compare TrustLLM with other tools, and no alternatives were assessed for this report. Other options for checking model behaviour include general-purpose LLM evaluation harnesses or hand-built test suites; whether those cover all six of TrustLLM's dimensions is not established here.

TrustLLM's distinguishing points, from the README, are its coverage of six trust-related dimensions in one benchmark, support for both API and local models, a published paper and leaderboard, and a command line plus Python interface with machine-readable documentation for agent-driven use.

Evidence reviewed

Evidence reviewed: the full README.md (7173 bytes) at revision c3edca246f39f778f666366c1e30cfdb95b2e43e, and the repository LICENSE file (1066 bytes, MIT) at the same revision. Both were read in full.

Not reviewed: the linked guides (docs/guides/agents.md, running.md, evaluation.md), docs/benchmark.md, the source code, the dataset, the paper, the leaderboard, CITATION.bib, CONTRIBUTING.md and the CI results. Claims about those come only from how the README describes them. Nothing was installed, executed or tested.

Access & freshness

Costs

The toolkit code is available free of charge under the MIT licence. API generation may incur provider charges; generation pricing is not stated. The README explicitly warns that judge calls during scoring can incur charges. Local weights are downloaded from Hugging Face on first use and run on hardware you supply.

Actual amounts are unknown. The README gives no token counts, dataset size, number of samples, price estimates or compute time for a full run, so neither a generation nor a scoring budget can be calculated from this evidence. The README describes --limit 5 as selecting five samples per dataset file for a smoke test whose report.html shows completion counts; its documented purpose is checking generation.

Licence and rights

The code is under the MIT Licence, copyright (c) 2024 Yue Huang. It permits use, copying, modification, merging, publishing, distribution, sublicensing and selling of the software and associated documentation files, provided the copyright and permission notice is kept in all copies. It is provided as is, without warranty.

The README states that dataset terms remain with the original sources. The dataset is a collection assembled from other sources, and the licences of those sources are not captured here, so rights to reuse the benchmark data are unknown and should be checked before redistribution or commercial use. The README also reminds users that model access, hardware capacity and architecture compatibility still apply to the models they test.

Freshness

The evidence was captured on 2026-11-14 at revision c3edca246f39f778f666366c1e30cfdb95b2e43e, and the README describes the 0.4 source version installed from GitHub. The README cites an ICML 2024 paper and links a changelog (docs/changelog.md) that was not captured.

The commit date, release dates and how actively the project is maintained are not shown in the captured files. Because the recommended install follows the main branch, later changes may differ from what this report describes; pin a commit SHA and re-read the README at that revision.

Suggested next steps

Before a full run: pin a commit SHA in the install command, run generate with --limit 5 (five samples per dataset file) and open report.html to check completion counts, then choose a new output directory for the full run. Read the running and scoring guides linked from the README.

Keep generation and scoring costs separate. The limited run produces completion counts for generation only; it does not establish judge-scoring costs, which remain unknown, and evaluation expects a full-run output directory and rejects incomplete responses. Check which scoring tasks need an API judge, and set OPENAI_JUDGE_MODEL only for a judge available to your account whose possible charges you accept.

Check the original dataset sources' terms if you plan to redistribute data or use it commercially, and decide how you will handle potentially harmful prompts and outputs from the safety tasks. If you compare results with the leaderboard or paper, note the README's warning that new runs are not automatically equivalent to the original paper's settings.

Evidence for this report

LICENSEnotice · checked 2026-11-14
README.mdselected · checked 2026-11-14