Nemotron retrieval recipes

From NVIDIA-NeMo/Nemotron · View interactive version

Nemotron retrieval recipes is an AI agent skill from the GitHub repository NVIDIA-NeMo/Nemotron. Use for Nemotron embed/rerank recipes, including Nemotron 3.5 multimodal SDG, tuning, evaluation, and deployment. Not for generic retrieval.

How to use this skill

Skill file

Nemotron Retrieval Recipes

Invocation: $nemotron-retrieval-recipes.

Purpose

Use this skill to plan, run, and debug public Nemotron embedding and reranking recipes. The bundled references support planning without a Nemotron checkout or network access. Before execution, verify the installed CLI's capabilities and the selected configuration because recipe interfaces can change.

Use it only for tasks tied to the public Nemotron embed or rerank recipe flow. If the request is unrelated retrieval theory, generic vector database selection, generic benchmark advice, or non-recipe Docker/Slurm/NIM troubleshooting, stop with a short scope note and do not inspect recipe files in that turn.

Security Notes

Use Bash for repo-scoped inspection, help, dry-run, and user-approved execution commands. Do not run API, GPU, Docker, Slurm, NIM, or other long-running work unless the user explicitly asks for it. Before Stage 0 SDG for either family, confirm the user's data-governance policy permits sending corpus content to the configured inference endpoints; otherwise use an approved private or air-gapped path. Never run broad environment dumps or commands that expose secret values. Prefer dotlist overrides and config review over editing recipe defaults.

Runtime and Source Priority

Resolve references/ links relative to this skill folder, not the working

directory. External source links are optional, commit-pinned background.

Do not require repository documentation to answer a planning question.

Execution examples assume a prepared Nemotron checkout. At the bundled

revision, the CLI resolves recipe scripts from the working directory: run

from the checkout root even if nemotron is installed globally. Use

uv run nemotron there, or nemotron directly in an activated environment.

Do not run uv sync in an unrelated project. Without a checkout or runtime,

provide a plan from the bundled references and identify setup as an execution

prerequisite. Never require a checkout just to explain the workflow.

For a new execution workspace, this setup selects the bundled revision. Use

the user's existing checkout and revision when they already chose one:

git clone https://github.com/NVIDIA-NeMo/Nemotron.git
cd Nemotron
git checkout db6312b2d2aac53a341afd6b45c7784ee966b47c
uv sync --python 3.12

Resolve conflicts in this order:

  1. User-selected runtime: installed CLI help and resolved configs, plus source files when a matching checkout is available.
  2. Bundled references in this skill.
  3. User-provided docs or saved snippets.
  4. Memory.

Before execution, confirm the command, profile, input paths, and required

environment exist. Missing runtime dependencies block execution, not planning.

Inputs

Gather only what the requested task needs:

Instructions

  1. Identify the recipe family.
  1. Choose the model profile within the selected family.
  1. Choose the model family to tune from the retrieval failure mode.
  1. Identify the intent: plan a run, execute a stage, debug a failure, tune hyperparameters, interpret metrics, export/deploy a model, inspect configs, or propose dotlist overrides. Select any additional references below for that task before composing commands.
  2. Before execution, inspect CLI help and dry runs. When a matching checkout is available, use these optional implementation locations for debugging:

Prerequisites

Check only the prerequisites for the requested stage:

Safe Workflow

  1. Resolve the inputs above and verify the family reference's stage contracts.
  2. When the runtime is available, start with cheap checks before expensive work. Otherwise, present these as checks to run after installation:
  1. Use dotlist overrides instead of editing defaults unless the user asks for reusable config changes. Keep the selected profile, artifact root, sequence length, prefixes, pooling/normalization, prompt templates, and hard-negative counts consistent across stages.
  2. Avoid launching API, GPU, Docker, Slurm, NIM, or long-running jobs unless the user explicitly asked to run them. Offer or run dry-runs, config review, and small pilots first.
  3. For local Python execution, scope requested GPU IDs with CUDA_VISIBLE_DEVICES=<ids>. For Docker deployment, select the host GPU explicitly with gpus='device=0', replacing 0 with the requested device; CUDA_VISIBLE_DEVICES in the shell does not select the container's GPU. For --run or --batch, configure scheduler resources such as gpus_per_node in the selected env.toml profile and let the scheduler assign devices; do not assume submit-shell CUDA_VISIBLE_DEVICES propagates remotely.
  4. For supported multi-stage runs, use uv run nemotron <family> run -c <profile> --from <stage> --to <stage>. Check the family reference for profile-specific stage and executor restrictions. Stop at evaluation before choosing export or deployment.
  5. When evaluating quality, compare against the base model on a fixed held-out evaluation set before recommending deployment. Do not substitute a standalone public-benchmark eval for the recipe's own Stage 3 evaluation.
  6. For long-running SDG, prep, finetune, or eval work, start the process in a session-safe way and poll at human-scale intervals: roughly 60 seconds for small pilots and 120-300 seconds for larger runs.

Troubleshooting

Localize the failing stage, then inspect its config, required inputs, output

directory, and corresponding CLI wrapper or run_uv.py. Use the family reference's

recovery guidance before rerunning or replacing artifacts.

References

Select only the guidance needed for the chosen profile and stage. All bundled

references are linked here; the individual guides contain procedures and contracts.

Examples

User asks: "Recall is decent, but nDCG is poor and the right passage is around rank 40. Should I tune embed or rerank?"

Load references/rerank.md and references/evaluation.md, explain that acceptable recall with poor top-rank ordering points to reranker tuning, then offer a cheap preview before training.

uv run nemotron rerank run -c default -d --from prep --to eval

Limitations

Output Style

For planning or debugging recommendations, use this shape when it helps: Decision, Why, Required inputs, Preview command, Execution command, Avoid, and Next step. Omit fields that are irrelevant to a short answer.

Give concrete commands and file paths. State assumptions, expected inputs, expected outputs, and the cheapest validation step that proves the next action is ready. For long-running stages, separate preview commands from execution commands so the user can choose deliberately.

When reporting a dry-run or real run, include a compact run report: command, mode, config, dotlist overrides, input paths, output paths, validation signal or metric file, and next cheapest check. Include the checkout commit when it is available.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.