Run an Anonymizer Job
This tutorial walks through the anonymizer.run job: defining a run spec, submitting it to NeMo Helix Jobs worker, and loading the parquet artifacts it produces.
For detection, rewrite, and replacement strategy details, see the open-source library documentation.
Prerequisites
Complete the tutorials prerequisites, which cover:
- A running NeMo Helix cluster with the
nemo anonymizerCLI available (see Setup). - An inference provider configured (default examples use
nvidia-build). - A fileset named
anonymizer-inputscontaininganonymizer-input.csvin your current workspace. Upload a CSV withidandbiographycolumns before running this notebook; see Upload an Input Fileset.
What run Does
anonymizer.run executes the full Anonymizer pipeline on every record of an input file and writes the output as job artifacts.
The CLI exposes one run command:
Job artifacts (under the artifacts/ directory):
Step 1: Build an AnonymizerRequest
Set NVIDIA_MODEL and NHX_ANON_GENERAL_MODEL to override the thinking and general-purpose model IDs below. Use exact IDs from the chosen provider’s catalog, with credentials authorized for both models; the role aliases stay unchanged.
AnonymizerRequest contains the execution fields shared by preview and run (config, data, model_configs, and selected_models). A run processes the full input file, so it does not include num_records:
Step 2: Write the Spec to YAML
The CLI run command reads a YAML spec file. Serialize the AnonymizerRequest directly:
Step 3: Run the Job
Submit the spec to NeMo Helix Jobs worker:
The command prints the assigned job name. You need that name to poll status and download artifacts in Step 4.
The SDK equivalent is anonymizer.run(request). It posts the request to the plugin’s /jobs/run endpoint and returns an AnonymizerJobResource:
The run path rejects local file paths in data.source — use a fileset reference (<fileset>#<path>) or http(s) URL. It also requires explicit model_configs referencing Inference Gateway providers.
Step 4: Get Results
For the SDK job created in Step 3, wait for completion and download its artifacts before loading them. The job is ready for artifact download when its status is completed:
get_job_status() reads the current status, check_if_complete() tests whether artifacts are ready, wait_until_done() blocks until a terminal state, and download_artifacts() downloads and extracts the result.
CLI equivalent
If you submitted the job with the CLI instead, track the job using the name it printed:
To download from the CLI, fetch the artifacts result and extract it:
Load the Downloaded Results
Both download methods produce an artifacts directory under the extraction root. The SDK flow above sets output_dir to a fresh directory. If you used only the CLI, set output_dir to the directory you extracted into, as shown in the comment below, before running this block:
AnonymizerJobResults exposes load_dataset(), load_trace(), load_failed_records(), and display_record() over the same underlying files. See SDK Resources.
How the Job Compiles
For each request, the plugin:
- Validates the Anonymizer library
AnonymizerConfig. - Validates the input source (rejects local paths; checks fileset refs).
- Validates that
selected_modelsoverrides also havemodel_configs. - Resolves
model_configsproviders through the Inference Gateway. - Renders a unified
model_configsYAML body for the library. - Stores the resolved providers and YAML in the internal
AnonymizerStepConfigconsumed by the Jobs worker.
Provider endpoints are re-resolved at runtime so the job uses the in-cluster Inference Gateway address rather than the address captured at submission time.
Next Steps
- Iterate faster with preview before scaling to a full job.
- Refer to SDK Resources for
AnonymizerJobResourceandAnonymizerJobResultsdetails. - Replacement strategy parameters and rewrite mode are documented in the library docs.