Comparing candidate LLMs with garak before choosing a model

Use garak runs on one shared probe set, with calibrated Z-scores, to compare candidate models before selection, and treat the results as one input to a decision rather than a benchmark ranking.

On this page

Comparing candidate LLMs with garak before choosing a model

A team choosing between an open-weight model it hosts itself and a hosted API model needs a security view before committing budget and architecture. garak can run the same probe set against each candidate and report pass rates and calibrated Z-scores that can be placed side by side. The tool is the Generative AI Red-teaming and Assessment Kit, an Apache 2.0 licensed command-line tool developed in NVIDIA's GitHub organization. Its probes cover prompt injection, jailbreaks, data leakage, hallucination and toxicity generation, and its generators can reach Hugging Face Hub models, OpenAI API models, AWS Bedrock models, models behind LiteLLM and almost any REST endpoint.

The comparison only holds if every candidate is tested identically. Fix the probe selection, the generations per prompt (garak defaults to 5), the system prompt, any buffs, the detectors and the garak version before the first run, and store the configuration file with the results. Differences in a generator's sampling settings, context window or safety wrapper can move results as much as the model does, so record them for each candidate. Confirm with each hosted provider whether the endpoint can be pinned to a model version, because a silent update can change the score between your scan and your decision. Run the candidates in the same environment on the same day where possible, and rerun the shortlist after any upgrade to garak itself.

garak's Z-scores compare a target's pass rate with a calibration bag of state-of-the-art models. Positive values mean better than average, and roughly two-thirds of models fall between -1.0 and +1.0, so a small gap between two candidates is rarely a meaningful ranking. Treat garak scores as one input to a selection decision, not as a general benchmark of capability or quality. The probes measure specific failure modes under the attack patterns garak ships with, so a model that passes them may still fail your application's own injection paths, and a model that fails a probe may be acceptable behind a guardrail. Use the comparison to decide which candidates need deeper testing in your real application.

Running the same probes against open-weight and hosted candidates

Open-weight candidates are usually loaded from the Hugging Face Hub or run as quantized gguf files through llama.cpp. garak can also reach models through LiteLLM when your team already serves them behind a gateway. Local loading gives you full control over the model revision, but it also means the weights, the tokenizer and the chat template all become variables you must record.

  • Pin the revision: Record the exact Hub commit or gguf file hash for each candidate, so a later rerun tests the same weights.
  • Match the chat template: Confirm that each candidate applies the template its model card specifies, because a mismatched template changes refusal behavior.
  • Record quantization: A Q4 file and an fp16 checkpoint of the same model are different candidates. Keep the precision in the run label.
  • Use the same hardware class where possible: Timing and throughput differ across accelerators, and rate-related effects can distort long runs.
  • Keep the generator file per candidate: Store one configuration file per model, changing only the model name and path, so the diff between runs is easy to audit.

Before you compare, confirm the candidate's license terms and whether your organization's use case is permitted under them.

Which garak settings to fix across candidates and why

This table lists the garak settings that must match across every candidate model, what each one controls, and what breaks the comparison if it differs. Read each row as a rule for the shared run configuration, and treat any change to a row as a change to the whole comparison.

SettingWhen it fitsWhat breaks comparison if it varies
Probe selection by spec or tagPick the probe families that match your application's real exposure, then use the same selection for every candidate.Candidates tested on different probe sets produce Z-scores that cannot be ranked against each other. Record the exact selection in the config file.
Generations per promptKeep the generation count fixed so each candidate gets the same number of attempts per prompt before a probe is marked FAIL.A candidate given more attempts per prompt has more chances to produce undesirable output, so its failure rate rises for reasons unrelated to model quality.
System promptUse one system prompt, or none, that reflects the deployment you intend to ship, and apply it identically to each candidate.Models respond differently to the same system prompt. Changing it between candidates changes the behavior being measured, not just the model.
BuffsApply the same buffs, such as encoding or translation transforms, only when they match a threat you expect in production.A buff applied to one candidate but not another adds or removes transformed attacks, so pass rates reflect different test inputs.
HarnessUse the same harness for every run. The default probewise harness is a common starting point when you want each probe run with its recommended detectors.A different harness changes how probes are executed and grouped, so reports from different harnesses are not directly comparable.
DetectorsKeep the detector set that the harness selects, or an explicit list you have reviewed, identical across candidates.Detectors judge outputs differently. If one candidate is scored by a stricter detector, its failure rate reflects the judge, not the model.
REST generator YAMLUse the REST generator for endpoints you host or reach over HTTP. Keep one YAML file per endpoint with identical request and response handling.Differences in request templates, response parsing or retries can alter what the model returns to garak. Confirm each candidate receives the same prompt format.
Config file and versionStore the full run configuration and the garak version in version control so every candidate run can be reproduced.A different garak release can shift scores. Pin the version and rerun all candidates when you upgrade.

Setting up a fair candidate comparison with garak

This sequence produces a set of garak runs in which every candidate model was tested with the same tool version, probe set, generation count and system prompt, so the reports can be compared with each other. It ends with reports that include Z-scores for every target and a log review that confirms the scores reflect model behavior rather than generator failures.

  1. Confirm the Python and operating system baseline

    The engineer running the comparison checks that the workstation or runner uses Linux or macOS and Python 3.11 or newer, since the PyPI package requires that version. Garak is developed on those platforms, so the team should note any other operating system as an untested choice to confirm with the garak maintainers. The step is done when the interpreter version is recorded in the comparison notes alongside the host details.

  2. Install and pin the garak version

    Install garak from PyPI into a dedicated virtual environment and pin the exact version, for example with a requirements file that names the release. The team should check the release notes on the NVIDIA garak GitHub releases page before choosing a version, because scores can shift between releases. The step is done when the pinned version appears in the comparison record and every candidate will be run from that same environment.

  3. Write one shared configuration file

    Create a single configuration file that sets the probe selection, the generations per prompt, the system prompt and any detector or harness settings. Only the generator section should differ between candidates, and each candidate gets its own endpoint or model identifier. The step is done when the team can show that a diff between two candidate configurations contains only the generator block and nothing else.

  4. Run every candidate with the identical probe set

    Run garak once per candidate using the shared configuration, with the same probes, the same detectors and the same run settings. Keep run names that identify the candidate and the date so the outputs stay separable. The step is done when each candidate has a completed run that used the same probe list, which the team can confirm by comparing the probe entries at the top of each report.

  5. Check generation and system prompt settings across runs

    Before comparing scores, the reviewer confirms that the generations setting and the system prompt are identical in every run. Garak defaults to 5 generations per prompt, so any run that deviates from the shared file will produce a failure rate that is not comparable. The step is done when a written checklist records the generations value, system prompt hash or text, and the garak version for each run, with no mismatches.

  6. Review garak.log for generator errors

    Open the garak.log file for each run and search for errors, timeouts, rate-limit responses or empty generations from the candidate endpoint. Because garak.log continues across runs, the reviewer should separate entries by run timestamp. A candidate whose endpoint failed or returned empty responses on a meaningful share of attempts needs its run repeated before any comparison. The step is done when each run has a log review note stating that generator errors were absent or were resolved and the run repeated.

  7. Collect the JSONL reports and archive them

    Gather the JSONL report that each run wrote, which contains every attempt and its evaluation, and store the reports with the configuration file, the pinned version and the log review notes. Archiving the inputs next to the outputs lets another reviewer rerun the comparison later. The step is done when the report files, configuration and notes are stored together under one comparison identifier.

  8. Confirm Z-scores are reported for each target

    Check that the output for each candidate includes a Z-score comparing its pass rate with the calibration bag, since the comparison depends on those values. If a target shows no Z-score, the reviewer should find out why before ranking candidates, and should confirm with the garak calibration documentation which targets and conditions produce one. The step is done when every candidate has a Z-score in its results, or a documented reason why one is missing and the candidate is excluded from ranking.

How candidate runs flow into a selection decision

The diagram starts with one shared garak configuration and probe set, so every candidate model is tested the same way. Each candidate gets its own generator and produces a JSONL report with a calibrated Z-score. The reviewers then combine those garak results with functional tests, cost, data residency and licence review before the selection decision is made. The key check is that the probe set and settings are identical for every candidate, and that the Z-score is read as one input among several.

Same probes and settings feed every candidate, then results meet other evidence before selection.

Why garak Z-scores are not a model benchmark

A garak Z-score tells you how a model's pass rate on garak's probes compares with a calibration bag of other models. It does not tell you how capable a model is, how accurate its answers are, or whether it fits your task. garak measures resistance to specific attack probes such as prompt injection, jailbreaks, encoding tricks and data leakage. A model that scores well has held up against those particular attacks in that particular run, and nothing more. Treat the score as a statement about attack resistance under one configuration, and record it that way in your selection file.

The calibration bag is also a limited reference point. The garak calibration bag aims for models across three parameter ranges (1-10B, 11-99B and 100B+), allows no more than two models from the same provider, and prefers open-weight models. Check the garak calibration documentation for the current membership before you read a Z-score as a ranking. A higher Z-score relative to that bag says nothing about your use case, your languages, your latency budget or your cost per request. Two candidates with similar scores can differ widely on the tasks your users run, and a model with a lower score may be the better fit once you account for those tasks.

Probe results also depend on detectors, and detector accuracy varies by probe. A detector can flag a harmless answer as a failure or miss a real one, so a difference of a few points between two models may come from the detector rather than the model. Before you compare candidates, review the detector outputs in the JSONL report for a sample of attempts and confirm they match your reading of what counts as a failure. Hosted models can also change without notice when the provider updates weights, safety tuning or routing, so a score from last quarter may not hold today. Rerun the same probe set on the model version you intend to deploy, and rerun it again after provider changes. Use the garak score as one input alongside functional evaluation on your own tasks and a documented risk review.

Security and operational considerations for candidate testing

Comparing candidate models with garak puts API keys, prompt data and compute spend into the same workflow. The cards below cover the controls that keep a model comparison trustworthy and keep the evidence it produces safe to share. Each one names a decision your team should make before the first scan starts.

Keep API keys out of configs and logs

Hosted candidates need credentials in the generator configuration, and it is easy for those keys to end up in a YAML file committed to a repository or echoed into garak.log. Load keys from environment variables or your secrets manager, and give each provider a dedicated key with a spending limit. Before sharing a run directory, search the config and log files for key patterns. Rotate any key that appears in a shared artifact.

garak user guide

Treat JSONL reports as sensitive

Each garak run writes a JSONL report of every attempt and its evaluation, so the file holds the probe prompts and the model's replies. Those replies can include content from your system prompt, retrieved documents or simulated personal data. Store reports in the same access-controlled location as other confidential test artifacts, restrict who can read them, and set a deletion date. Share comparison summaries rather than raw reports when a vendor or buyer asks for evidence.

Run open-weight candidates on isolated hosts

Open-weight models pulled from the Hugging Face Hub or served through a local runtime execute on hardware you control, and that host can reach internal networks. Run candidate models on a segregated host or VM with no route to production data, and limit outbound traffic to the model sources you have approved. Pin model revisions so a later pull does not change what you tested. Confirm that any model loader you use does not execute untrusted code from the model repository.

Control rate limits and scan cost

garak makes 5 generations per prompt by default, so a full probe set multiplies quickly across several candidates. Hosted providers bill per token and enforce rate limits, and a scan that hits a limit can produce partial results that look like failures. Estimate token volume with a small probe subset first, set provider budgets before the full run, and record the request count per candidate so comparisons use the same effort. Ask each provider which limits apply to your account tier.

Check hosted provider data terms

Probe prompts are test data, but they often contain attack payloads, simulated customer records or your own system prompt. Before sending them to a hosted candidate, read the provider's terms on training use, data retention and human review, and confirm which account tier or API setting applies. Where the terms allow training on inputs, disable that setting or choose a different candidate. Keep a record of the terms you checked and the date you checked them.

Record version and calibration context

A garak Z-score is relative to a calibration bag of models, and scores can shift after a garak upgrade or a change to the calibration set. Record the garak version, probe and detector selection, generation count, generator configuration and calibration reference alongside each result. Without that context, a later comparison may mix runs that were not measured the same way. Store the metadata in the same folder as the report so the record travels with the evidence.

Latest supplied release
v0.17.1
Calibration reference

Questions teams ask before comparing models with garak

Is garak free to use for comparing candidate models?

Yes, garak is free to use. The maintainers describe it as a free tool, and it is licensed under Apache 2.0, which governs what you may do with the code. Your costs come from the work around it: compute or hosted inference for each candidate model, the engineering hours to configure and run scans, and the review time to read the results. Check the license terms with your legal team before adopting it, and confirm any third-party model or API terms that apply to the candidates you test, since those are separate from garak's license.

How long does a candidate model comparison take, and what drives scan duration?

Duration depends mostly on how many candidates you test, how many probes you run, and how many generations each prompt receives. garak makes 5 generations per prompt by default, so the number of requests grows quickly across probes and models. Other drivers include the speed of each endpoint, rate limits on hosted APIs, and whether you run scans in parallel. Local GPU hosts and hosted endpoints behave differently, so benchmark one candidate with a small probe subset before you plan the full run. Ask any partner for a duration estimate tied to your candidate list, probe set and endpoint limits.

What effort does a model comparison need from our internal team?

A reasonable comparison needs engineers who can install garak from PyPI, which requires Python 3.11 or newer, and write a YAML configuration for each candidate endpoint. Someone must also decide which probe families match your real exposure, keep the same probe set and settings across candidates, and review the JSONL reports and garak.log output. Most of the effort goes into making runs identical and reading failures honestly, not into the scan itself. Plan time for the review of results with security and product owners, because a Z-score alone does not show whether a failure matters for your application.

Can our team run a model comparison with garak on its own?

Yes, a team with Python, Linux or macOS experience and access to the candidate endpoints can run garak without outside help. The harder parts are controlling variables, such as system prompts, generation counts and detector settings, so that every candidate faces the same test, and interpreting results in the context of your application. Teams often choose a partner when they lack capacity, need an independent view for a procurement file, or want the scan wired into a repeatable pipeline. Decide early which parts you will own and which you want reviewed.

Can garak scores go into a procurement decision?

garak scores can inform a procurement decision, but they should not be the only input. garak reports a Z-score that compares a target's pass rate with a calibration bag of state-of-the-art models, where positive values mean better than average and roughly two-thirds of models fall between -1.0 and +1.0. The calibration bag covers several parameter ranges, limits models per provider, and prefers open-weight models, so it is not a complete market survey. Record the garak version, probe set, generation count and endpoint configuration with each score so the comparison can be reproduced and defended.

What changes after a garak upgrade, and does it affect comparisons?

A garak upgrade can shift scores, probe behavior and detector results, so a comparison run before an upgrade may not match one run after it. Check the release notes on the NVIDIA/garak releases page, such as the v0.17.1 release dated 16 October 2026, before moving versions. If you are comparing candidates across time, either rerun all candidates on the new version or keep the old version pinned for the comparison. Store the JSONL reports and the version used so that score changes can be traced to the tool rather than the model.

What does partner help cost, and what does it depend on?

Partner help is priced from a written scope, not from a fixed rate card, and DeployOpen does not publish a price list. The scope sets the candidate models, the endpoints and access you provide, the probe families and generation settings, whether results need an interpretation report, and whether the scan must be repeatable in your pipeline. Ask for the scope, deliverables and timeline in writing, and confirm what happens if a candidate fails access checks or needs rescans after a garak upgrade. Ongoing reruns are usually quoted separately as a retainer.

Where to read the official garak documentation

Start with the NVIDIA/garak README for the authoritative description of the tool, its plugin categories and the default probewise harness, which is the run behavior most model comparisons depend on. The README is also where the Apache 2.0 license and the Python 3.11 requirement are stated, so check both against your environment before installing on the hosts you will use for comparison runs. Because the README is maintained alongside the code, it is the first place to see if a default has changed.

Check the garak releases page before you lock a comparison to a version. Each release note records changes that can shift scores between runs, so a candidate model scanned on one release and a second model scanned on another may not be directly comparable. The current release at the time of writing is v0.17.1, released on 16 October 2026. Pin the version in your comparison record, and confirm with the release notes whether any probe or detector change affects the families you plan to run. The garak package on PyPI gives the installable version history for the same tool, and the garak user guide covers configuration of generators and run options.

For Z-score meaning, read the garak calibration reference before you put any Z-score in a selection memo. It explains how the calibration bag is built and what a positive or negative score is compared against. Confirm the calibration set your version uses, since the reference describes the bag, and record in your report which calibration data was used so that a later reader can reproduce the comparison.

How DeployOpen works on this

DeployOpen plans and runs garak model comparisons as fixed-scope engagements inside the client's own infrastructure. The work covers which candidate models are compared, on which probe set and endpoints, and how the results are documented so the selection decision can be reviewed later by the client's security and compliance teams.

How we scope

  • Agree in writing which candidate models, hosted or open-weight, are in the comparison.
  • Define the probe families and the probe set that every candidate runs against, so results are comparable.
  • Confirm how each candidate is reached, including endpoint access, credentials and where the scan host runs.

How we build

  • Install garak in the client's environment and pin the release version used for every run.
  • Configure identical generations, system prompts and detectors for each candidate to keep the comparison fair.
  • Run each candidate, retain the JSONL reports and garak.log files, and record any endpoint errors or skipped probes.

How we hand over

  • Deliver a written comparison report that states what garak measured and what it did not measure.
  • Document the exact configuration, release version and calibration settings so a later run can be reproduced.
  • Walk the client's engineers through the reports and explain how to read Z-scores alongside the application's own risks.

How we support

  • Offer ongoing support and scheduled rescans as a retainer when candidate models or versions change.
  • Rerun the same probe set after a model upgrade or fine-tune, so changes in scores can be traced.
  • Confirm with the client which findings need follow-up testing on the full application before a model is approved.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.