How garak parallel attempts speed up scans of hosted endpoints
A team points garak at a hosted model, starts the run, and waits far longer than expected for the JSONL report. The usual cause is that garak sends requests one after another, so total time grows with the number of prompts multiplied by the generations per prompt. Parallel attempts is the setting that lets garak keep several requests in flight at once. In the configuration, system.parallel_attempts sets how many probe attempts run concurrently, and max_workers caps the worker threads used for the work. Raising them shortens wall-clock time against a hosted endpoint because most of each request is spent waiting on the network and the provider.
The setting changes how requests are sent, not what is tested. garak still makes 5 generations per prompt by default, the same probes still run, and the same detectors still score every output. A probe still reports FAIL when any attempt produces undesirable output. Before raising concurrency, confirm with your team that the scan set, generation count and detectors are the ones you intend to report on, because a faster run of the wrong set only gets you the wrong answer sooner. Parallelism is also not the fix when the slow part is local: a model loaded on a single GPU or a detector running on the same host will not gain much from more concurrent workers, and the bottleneck is then compute or memory, not request handling.
Teams need this topic when the target is a hosted or self-served endpoint with a per-request latency they can measure, and when the scan is run often enough that wait time matters. Before increasing values, ask the owner of the target endpoint what concurrency it allows, how it counts requests against quotas, and who sees the resulting traffic spike. Then raise the values in steps and watch error rates and timeouts in garak.log, since file descriptor limits on the scan host and provider rate limits both appear as failures rather than slowness. The garak user guide is the place to confirm the current parameter names for your version.
Parallelism settings and when each one fits
This table compares the serial default with the concurrency settings garak exposes, including system.parallel_attempts and max_workers, and the generator-level options that govern how many requests reach an endpoint at once. Read each row for what the setting controls, which generator types it applies to, and the risk of raising it. Confirm exact key names and defaults against the user guide for your installed garak version before editing any config.
| Setting | What it controls | When it fits | Risk of raising it |
|---|---|---|---|
| Serial default (no parallelism set) | Attempts run one after another, so only one request is in flight at a time | Local models on a single GPU, first runs on a new target, and any endpoint with a strict rate limit | Slowest option; a full scan can run for a long time, but it puts the least load on the target |
| system.parallel_attempts | Number of prompt attempts garak runs concurrently across the scan | Hosted endpoints where the owner has agreed a request rate and the scan is otherwise too slow | Multiplies concurrent requests, which can trigger rate limits, 429 responses or throttling for other users |
| max_workers | Thread or worker count used by the generator when it sends requests | Generators that support concurrent calls and where worker count is the documented limit to tune | Excess workers can exhaust local file descriptors or sockets and inflate timeouts on the endpoint side |
| Generator-level concurrency | Per-generator request handling, which varies by generator type such as REST, hosted API or local model | Mixed setups where one generator is hosted and another is local, so each needs its own limit | Settings may not apply to every generator; a value that works for one may overload another |
| Local Hugging Face or llama.cpp generators | Compute on the scan host, usually bounded by GPU memory and CPU | Single-host runs where the GPU is the bottleneck and parallel requests only queue | Raising concurrency can cause out-of-memory failures mid-run; keep it conservative |
| Hosted API generators | Requests sent to a provider or proxy, bounded by the account's rate limits | Accounts with confirmed quota headroom, ideally agreed in writing with the account owner | Consumes shared quota and budget; failures may appear as dropped attempts on the endpoint owner's side |
| Self-served or internal REST endpoints | Load placed on a service run by another team | After the endpoint owner has agreed a request rate and a scan window | Can degrade production traffic for other users; agree limits before raising any value |
| Confirmation step | Exact key names, defaults and supported generators for your garak version | Before any change to a production or shared config | Using a key name from another version may be silently ignored, so the scan runs serially without warning |
Setting up a parallel garak scan safely
This sequence moves a garak scan from a serial baseline to higher concurrency one change at a time, so you can see which setting causes errors before the target endpoint or the scan host does.
Confirm garak version and Python runtime
Confirm the scan host runs Python 3.11 or newer and that the garak version is pinned to the release your team tested. The PyPI package requires Python 3.11 or newer, and the current release noted in the project's release history is v0.17.1, released on 16 October 2026. Record the exact version with the scan configuration so later comparisons can be traced. Done means
garak --versionreturns the pinned release and the interpreter version is written into the scan notes.Run a small serial baseline
Before changing any concurrency setting, run a short scan with parallel attempts left at the default, against a limited probe set and the same generator configuration you plan to use at scale. Keep the run small enough that the endpoint owner can see it in their logs. Note the completed attempt count, the elapsed time, and any errors. Done means you have a JSONL report and a garak.log from a run with known behavior that you can use as the reference point for every later change.
Check the open file limit on the scan host
Parallel requests open network sockets, and each one uses a file descriptor. Check the per-process open file limit for the user that runs garak with
ulimit -n, and compare it with the concurrency you expect to use. Raise the limit in your service or shell configuration if it is low, and confirm the change applies to the process that runs the scan. Done means the limit is recorded and comfortably above the number of simultaneous connections you plan, and that a test invocation under that user reports the new value.Raise concurrency in small steps
Change
system.parallel_attemptsor the generator'smax_workersby a small increment, leaving every other setting identical to the baseline. Agree the planned request rate with the team that runs the target endpoint before the step runs, since they can see the load on their side. Run the same probe set and watch the scan for throttling responses or timeouts. Done means the step completes with a error rate you can explain and the endpoint owner has confirmed the request rate in their own monitoring.Verify garak.log and the JSONL report after each change
After each concurrency step, open garak.log and search for connection errors, too many open files, rate-limit responses, and retries. Then compare the completed attempt count in the JSONL report against the baseline run, since missing attempts show dropped requests even when the scan exits cleanly. Done means the attempt count matches the expected number for that probe set and the log shows no new error class. If either check fails, return to the previous setting and investigate before increasing again.
Record the settings that held
Once the highest stable concurrency is found, write the final values for
system.parallel_attempts,max_workers, the file limit, and the agreed request rate into the scan configuration file. Include the garak version, the baseline and final attempt counts, and the error summary for each step. Done means a colleague can rerun the scan with the same configuration and reach the same attempt count, and the record is stored with the scan reports.Repeat the check after changes
Rerun the verification after a garak upgrade, a change to the target endpoint, or a change to the scan host, because each can shift the safe concurrency. Compare the attempt count and error summary with the recorded values. Done means the repeat run matches the recorded baseline or the record is updated with a new reviewed value and the endpoint owner is informed of the change.
How parallel attempts move requests from garak to the endpoint
The diagram starts at the garak harness on the scan host, which runs each probe with its detectors and expands every prompt into generations. Parallel workers, set through system.parallel_attempts and max_workers, send those attempts to the target endpoint, and the provider or gateway rate limit sits in front of it on the endpoint owner's side. The trust boundary marks where your scan traffic enters infrastructure someone else runs. Check the rate limit and the worker count together, and confirm the owner's limits before raising parallelism. Results land in the JSONL report and garak.log on the scan host.
Parallel workers carry garak attempts across the trust boundary to the endpoint owner.
Why file descriptor limits cap concurrency
Each concurrent HTTP connection that garak holds open to a hosted endpoint uses a file descriptor on the scan host, and so does each log, report or temporary file the run has open at the same time. Operating systems cap how many descriptors a single user process can hold, so raising system.parallel_attempts or max_workers beyond what that cap allows does not make the scan faster. It produces connection errors and failed attempts that look like endpoint problems but originate on the scan host. Treat the descriptor limit as one of the first ceilings you hit when you raise concurrency.
On Linux, check the limit for the account that runs garak with ulimit -n in the same shell or service context the scan uses, and compare the soft and hard values with ulimit -Sn and ulimit -Hn. On macOS, run ulimit -n for the same purpose and check the system-wide ceiling with sysctl kern.maxfilesperproc. To raise the limit for a scan user on Linux, set nofile entries in /etc/security/limits.conf or the service unit (for example, LimitNOFILE in a systemd unit), then start a new session and confirm the value again before the scan. Other processes on the same host, such as proxies or log shippers, share the system-wide pool, so confirm the limit with those workloads running.
The right ceiling depends on the scan host, not on a number copied from a guide. It depends on the host's configured limits, what else runs on it, and how many connections the endpoint owner will accept at once. Confirm these values in your own environment and record them alongside the scan configuration so a later run on a different host is comparable. If you run garak in a container or Kubernetes pod, the limit may come from the runtime rather than the host, so check it inside the container. Choose a concurrency level that leaves headroom below the limit, then agree the request rate itself with the team that runs the target endpoint.
How parallelism differs by endpoint type
An endpoint your team or platform group runs, such as a model server on your own accelerators, is the case where the ceiling is most visible. You can see the queue, the accelerator memory and the worker count, so you can tune the scan against capacity you can measure. The main risk is that the server was sized for interactive users, and a burst of concurrent scan requests can stall it in ways a single chat session never would.
- Ask the server owner for concurrency limits: Confirm how many requests the server handles at once and whether extra requests queue or fail.
- Watch for queue growth and timeouts: Rising latency across a run means the scan has outpaced the server. The server log often shows this before the garak.log does.
- Raise settings in steps: Start
system.parallel_attemptsandmax_workerslow, increase them gradually, and stop at the first sign of latency growth or errors. - Protect shared hardware: A GPU host may also serve staff or other pipelines, so schedule the scan when that capacity is free.
Before you raise the settings again, compare the endpoint's queue depth and error counts with the start and finish times of the run.
A hosted model API enforces quotas per account, project or key, and the provider sets those quotas, not your scan team. Higher parallelism uses the quota faster and can make a scan look like a misbehaving client. Limits are often expressed as requests and tokens per minute, and they can differ by model and pricing tier. Confirm the current figures in the provider's console, since providers change them.
- Read the limits for the exact model and tier: Check requests and tokens per minute for the model under test, and whether the key is shared with production traffic.
- Expect HTTP 429 responses as the throttling signal: If a run continues past these responses, the report may record failures that reflect your quota rather than the model's behavior.
- Use a dedicated scan key or project: Separate credentials keep a scan from using up the quota that production applications depend on.
- Plan for billing: Parallelism shortens wall-clock time, but the number of billed requests stays set by probe selection and generations. Confirm billing terms with the provider.
Before raising parallel attempts, confirm in the provider console that the account's limits and current usage can absorb the planned request rate.
A corporate AI gateway or API proxy sits in front of several applications, teams and models. A scan using it competes with production traffic for the same capacity and the same rate limits. The gateway owner may apply limits per user, per application or per route, and may treat a sudden burst as an incident. Agree the rate with that owner before the first run and treat the scan as one more tenant of the gateway.
- Ask which limits apply to the scan identity: Find out whether limits attach to the API key, the team, the route or the upstream provider, and who can change them.
- Ask about shared upstream quotas: A single scan can exhaust a provider quota that production applications also rely on.
- Ask how dropped requests appear: Gateways may return their own status codes or error bodies for load shedding or policy blocks. Ask the owner to show you these responses so you can label them correctly in the report.
- Agree a fixed rate and stop condition in writing: Record the maximum concurrency, the time window and the point at which the scan stops, and get the gateway owner's confirmation.
Ask the gateway owner which dashboard or log will show scan traffic, so both teams see the same numbers during the run.
Security and operational risks of high request rates
Raising parallel attempts changes who feels the scan. The risks below fall on the endpoint owner, the logs, the credential store, the invoice and the disk, and each one grows with request volume. Agree the controls with the endpoint owner before the first high-concurrency run.
Overloading a production endpoint
A garak scan sends adversarial prompts that look nothing like normal traffic, and high parallelism can push a shared endpoint into latency spikes or errors for real users. Before raising system.parallel_attempts against a production service, agree a maximum request rate in writing with the endpoint owner, run the scan against a staging or canary deployment first, and confirm which dashboards the owner will watch during the run. Ask them to name a person who can stop the scan.
Harmful outputs in logs
Retries and high concurrency multiply the number of attempts, and each attempt can produce harmful text that ends up in CI job logs, shared terminals or log aggregators. Keep scan output out of general logging pipelines, restrict who can read the report directory, and decide in advance how long reports containing harmful prompts and outputs are kept. Check that any log shipper on the scan host does not collect the report or hit files by default.
Credentials in debug logs
Verbose debug logging can record request headers, endpoint configuration or environment values that include API keys, bearer tokens or client certificate passphrases. Load secrets from environment variables or a secrets manager rather than from the YAML configuration committed to a repository, and review garak.log after a test run before sharing it. Rotate any key that appears in a log file, and confirm the endpoint owner's key scope limits what a leaked key can do.
Unexpected provider charges
Charges for hosted endpoints scale with requests and generations, so a higher parallelism setting raises the spend rate even when the total request count stays the same. Ask the provider for its billing model and any spend or rate limits on the key used for scanning, and set a budget alert before the first run. Use a dedicated key so scanning spend can be separated from production usage.
Retry storms
When a rate-limited endpoint returns errors, aggressive retries from many workers arrive together and make the throttling worse, which can lock out the team's own applications. Lower max_workers when you see repeated failures instead of adding retries, and use backoff in any hosted generator you configure. Confirm with the endpoint owner which status codes they expect garak to treat as a signal to slow down.
Report files that grow quickly
Each run writes a JSONL report of every attempt and its evaluation, and higher parallelism over longer scans produces large files on the scan host. Plan disk capacity before the run, set report_dir to a volume with space and retention rules, and clean up or archive finished reports on a schedule. Check free space during long scans so a full disk does not corrupt the report mid-run.
garak READMEAgreeing request rates with the endpoint owner before the scan
Put the scan terms in writing before the first request leaves the scan host. The concurrency ceiling is the number that matters most: state the highest number of simultaneous requests the endpoint owner will accept, and set system.parallel_attempts and max_workers so the scan never exceeds it, even when a probe fires several attempts at once. Also record the source hosts (the scan host's fixed addresses, so the owner can allowlist them and tell scan traffic from real users), the scan window, and the request timeout and retry behavior you will use. Ask the owner whether their gateway adds its own retries, since a retry at both layers can double the load they see.
Agree a stop condition before the run starts. Typical triggers are a rising share of 429 or 503 responses, sustained timeouts, latency that breaks the owner's service objectives, or any alert from their monitoring. Name the person who can stop the scan and the channel they will use, and name who receives alerts from each side. Make it explicit that the scan operator stops immediately on a stop request and that the owner may block the source hosts without notice. Confirm how the owner will be reached outside business hours if the scan window is long.
Ask the endpoint owner to confirm what they see, so both sides read the same evidence. A useful shared view is request counts per minute from the scan source, the distribution of status codes, median and tail latency, and any rate-limit headers the service returns. Agree on a time base (UTC, with clock sync confirmed) so their logs line up with the garak.log timestamps and the JSONL report. Before the scan, run a short low-concurrency test and compare the counts on both sides. Any gap, such as requests counted by the scanner but missing from the gateway, should be explained before the full run.
Limits to confirm in your environment
Parallel attempts shift load from garak onto your host and onto the endpoint under test. The cards below list the settings, generator behavior, provider terms, host resources and version effects to confirm before you raise concurrency. Verify each against the installed release, not against older examples.
Parallelism setting names and defaults
Confirm the exact names and default values of the parallelism settings in the garak version you install, including system.parallel_attempts and any max_workers option that applies to a given generator. Defaults can differ between releases and between generator types. Record the values a scan actually used by reading the run's configuration output, so a later rerun can reproduce them.
Generator behavior under concurrency
Each generator handles concurrent requests differently. Some honor the parallel setting, some ignore it, and some serialize calls internally. Test each target generator with a small run and confirm that the number of in-flight requests matches your expectation before scaling up. Check how retries and errors are counted when several attempts fail at once.
Provider rate limits and quota terms
Hosted providers set request and token limits per key, per organization or per model, and these limits may change without notice. Ask the endpoint owner for the agreed request rate, the burst allowance and the daily or monthly quota that applies to the scan key. Parallel attempts multiply request rates quickly, so a setting that works on a quiet day can exhaust a shared quota during a busy window.
Memory and connection use on the host
Concurrent attempts hold open sockets, queued prompts and response buffers on the scan host. Check the operating system limit on open file descriptors for the user running garak, and confirm that raising concurrency does not exhaust it. For local models, confirm that parallel generation fits in GPU and system memory. Watch the host during a short trial run before committing to a longer one.
Score and timing changes across versions
Confirm whether a new garak release changes probe results, detector behavior or scan duration before you compare runs made with different versions. Read the release notes for the versions you plan to use and rerun a fixed baseline on the new version when you upgrade. A timing improvement alone does not show that scores are comparable across releases.
garak release notesQuestions teams ask about parallel garak scans
How much faster does a parallel garak scan run?
The speedup depends on how much of the run is spent waiting on the endpoint. Against a hosted endpoint, most time goes to network round trips and model response time, so concurrent attempts can shorten the wall-clock run. The ceiling is set by the endpoint's rate limits and concurrency caps, and by the number of requests the scan must make. That count comes from probe selection and the default of 5 generations per prompt. Local detection, evaluation and report writing do not parallelize in the same way, so the gain is smaller than the worker count suggests. Run one short scan at a few settings, record the elapsed time, and extrapolate only after confirming the endpoint owner accepts the higher load.
Does increasing parallelism change garak's results?
It should not change which prompts garak sends or how it evaluates them, because probe selection, generations and detectors set the attempts. It can change outcomes if the endpoint behaves differently under load. Throttled or timed-out requests may produce missing or failed attempts, and some models vary their answers when requests arrive faster. garak marks a probe as FAIL when any attempt produces undesirable output, so a throttled run can look different from a clean one. Before trusting a comparison, check the attempt counts in the JSONL report and the errors in garak.log against a serial baseline run on the same endpoint and model version.
How much effort does tuning parallel settings take?
Tuning is usually a short sequence of controlled test runs, and the effort grows with the number of limits the endpoint enforces. The main drivers are the kinds of limits (requests per minute, concurrent connections, token quotas), whether the endpoint is shared with production users, whether a stable test environment exists, and how many generators or endpoints the scan covers. Tuning is largely one-time, but retuning recurs after endpoint changes, garak upgrades or new rate-limit policies. When asking for a quote, request the tuning as a defined step with the number of test runs, a written record of final settings, and a handover so the team can repeat it.
What must we agree with the endpoint owner before raising parallelism?
Agree on a maximum request rate, a concurrency cap, a time window and the identity of the scanning host or API key. The owner should also know the expected request volume, which you can estimate from the probe set and generations, and who to contact to stop the scan. Confirm whether the scan runs against production or a staging copy, which logs the owner keeps, and what happens if the owner sees errors or latency rise. Write these terms down and share the chosen values for system.parallel_attempts and max_workers before the first run, so the owner can match them against their own monitoring.
Can our internal team tune parallel garak scans without a partner?
Yes, if the team has engineers comfortable with Python and command-line tools, a working garak installation, and a named counterpart at the endpoint owner. The garak user guide at docs.garak.ai covers configuration files and generator settings. The harder work is organizational: agreeing limits, instrumenting runs, and reading the JSONL report and garak.log to spot throttling. A partner is most useful when the team lacks capacity, needs the setup documented for auditors, or wants repeatable configurations across several endpoints. DeployOpen plans, documents and tests this work in your infrastructure under a written scope.
How do we fix file descriptor limit errors during parallel scans?
Lower concurrency first, then confirm the operating system limit for the user or service running garak. Each concurrent request holds a network socket, so high worker counts consume descriptors quickly. Reduce system.parallel_attempts or max_workers, rerun, and watch garak.log for "too many open files" messages. Check the current limit with ulimit -n on Linux. Raising it permanently depends on your distribution and service manager, so confirm the procedure for your host. In containers, the runtime may set the limit instead of the host, and retry loops can hold descriptors longer than expected. Record the final values with the endpoint agreement.
What should a quote for parallel garak tuning include?
A quote should list the scope and the assumptions behind it. Scope covers the target endpoints, generators, probe set, configuration files, the scan host and which settings are tuned. Deliverables usually include a tested configuration, a runbook, an endpoint agreement template and documented results. Assumptions cover who provides access, the test window, endpoint owner participation and whether retesting after changes is included. Cost components are the effort for test runs and documentation, environment access and handover. Separate one-time tuning from recurring work such as retuning after upgrades. DeployOpen agrees scope, deliverables and timelines in writing before work starts and does not publish a price list.
How DeployOpen scopes and runs garak scans against your endpoints
DeployOpen treats parallel garak scanning as an agreement between three parties: the scan host, the endpoint owner and the security team that reads the results. We scope the concurrency settings against the endpoint's documented limits, build and test the scan configuration in your environment, and hand over a runbook your team can repeat without us.
How we scope
- Confirm which endpoint, probe families and generations the scan covers, and who owns the target.
- Record the request rate, concurrency ceiling and timeout values agreed with the endpoint owner in writing.
- Agree the scan host's file descriptor limits and expected report storage before any parallel run starts.
How we build
- Configure system.parallel_attempts and max_workers in a versioned config file for the target REST or hosted generator.
- Run staged test scans at low concurrency and check the endpoint's error codes, latency and dropped requests.
- Adjust concurrency settings until the endpoint and scan host stay stable, and record the values that worked.
How we hand over
- Provide the tested config, the scan host setup notes and the agreed request-rate record for your files.
- Document how to raise or lower concurrency, what errors to watch for and who to contact on the endpoint side.
- Walk your engineers through a parallel scan run and the JSONL report, so they can repeat it without us.
How we support
- Ongoing support and upgrade work for garak configurations are available as a retainer.
- Retesting after endpoint, gateway or garak version changes can be included in a retainer scope.
- Confirm support terms, response expectations and scope boundaries in the written agreement before work starts.

