Skip to content

Fail loudly on ignored flags: fast-text conflicts, embed endpoint aliases, stage API keys, method=audio - #2856

Merged
jperez999 merged 12 commits into
mainfrom
devin/1794339271-flag-cleanup-pass2
Nov 20, 2026
Merged

jperez999 merged 12 commits into
mainfrom
devin/1794339271-flag-cleanup-pass2

Conversation

@jioffe502

@jioffe502 jioffe502 commented Nov 14, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Second flag-cleanup pass: options that used to be silently overridden or ignored now fail or take effect.

  • EmbedParams rejects embed_invoke_url and embedding_endpoint set to different values. Either name alone still works. Batch tuning now treats embedding_endpoint as remote embedding, so the embed actor no longer reserves a GPU in that case.
  • ExtractParams.page_elements_api_key now reaches page-element detection (falls back to api_key). New ExtractParams.stage_api_key() picks the key for page elements and OCR: an explicit per-stage key wins, then an explicit api_key, then a stage key auto-filled from NVIDIA_API_KEY/NGC_API_KEY (an explicit os.environ/... stage reference still counts as explicit). On main, an env key overrode an explicit api_key for OCR because the unset ocr_api_key was auto-filled from the environment first. Saved and cloned graphs keep which stage keys were auto-filled, so the same precedence applies after save_graph/clone_graph.
  • ExtractParams.method drops "audio"; audio inputs use GraphIngestor.extract_audio() / audio input detection. The method and --method help say it selects how PDF pages are read (with nemotron_parse also extracting the enabled tables, charts, and infographics).
  • Removes text_depth from two legacy examples and a stale extract_method="audio" README note.

Scope: param validation and API-key/endpoint wiring only. The fast-text profile is removed separately in #2864, so this PR no longer validates it. Unchanged: output of default and valid configurations (see E2E), GPU stage code, service mode, model_name / embed_model_name (left as is). Batch-size knobs are a separate follow-up.

Tests

  • Unit: params, embed params, ingest plan/service, CLI workflow and graph registry suites: 555 passed. Also merged on top of main + Remove the fast-text ingest profile #2864 without conflicts: 614 passed. Earlier full suite: 4,482 passed, 168 skipped, 1 unrelated local failure (local vLLM older than the lock). Targeted suites also pass with NVIDIA_API_KEY set.
  • E2E on 1x H100 NVL, jp20 (20 PDFs, 1,940 pages), main 378fda86 vs this branch, direct retriever CLI/SDK:
    • Default profile: 3,196 rows on both; recall@1/5/10 identical (0.6957 / 0.9304 / 0.9739). Candidate vs main A: 47 pages differ; main B vs main A: 55 pages differ (OCR noise floor).
    • SDK: conflicting endpoint aliases rejected, either alone accepted, method="audio" rejected, embedding_endpoint-only remote embed reserves no GPU, extract_audio() gives identical rows on both.
    • The e2e found the env-key precedence bug above; fixed and covered by unit tests, including graph save/load and clone round trips (no GPU path changes).
  • Docs: mkdocs build --strict passes.

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

Link to Devin session: https://nvidia-cloud.devinenterprise.com/sessions/1a26768094554997905f04cfc7e6a53a
Open in Devin Desktop: https://nvidia-cloud.devinenterprise.com/desktop/session/1a26768094554997905f04cfc7e6a53a?variant=devin
Requested by: @jioffe502


🟢 Devin Review found nothing to fix · View findings · Follow Devin's work

Devin Review

Signed-off-by: Jacob Ioffe <jioffe@nvidia.com>
…y, drop method=audio

Signed-off-by: Jacob Ioffe <jioffe@nvidia.com>
Signed-off-by: Jacob Ioffe <jioffe@nvidia.com>
Signed-off-by: Jacob Ioffe <jioffe@nvidia.com>
Signed-off-by: Jacob Ioffe <jioffe@nvidia.com>
Signed-off-by: Jacob Ioffe <jioffe@nvidia.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@greptile-apps

greptile-apps Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The changes affect PDF and audio ingest configuration, remote embedding setup, and credentials for two extraction stages.

Restore the fast-text checks or honor the requested extraction options before merging.

Summary

This PR tightens embedding endpoint checks, fixes stage API-key precedence, and removes the legacy audio extraction method.

  • The extraction method now chooses how PDF pages are read, while audio inputs use the audio path.
  • Remote embedding accepts either endpoint name and rejects conflicting values.
  • OCR and page detection use their own API keys with a shared-key fallback.
  • The legacy examples no longer pass the unused text_depth setting.

Reviews (8) · Last reviewed commit: "Remove fast-text conflict validation fro..." · Reviewed by Greptile

greptile-apps[bot]

This comment was marked as resolved.

Signed-off-by: Jacob Ioffe <jioffe@nvidia.com>

@devin-ai-integration devin-ai-integration Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

Document stage credential selection and fast-text override validation arguments, return values, and errors.
@devin-ai-integration

Copy link
Copy Markdown
Contributor

Superseded by #2861, which batches the release fixes into one PR, one commit per original PR. This change is commit-for-commit identical there.

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Reopened: keeping the release fixes as individual PRs for review. #2861 is closed.

if (
stage_key
and self.api_key
and self._api_key_was_env_defaulted(field_name)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] Preserve automatic-key provenance through graph serialization

The new precedence rule depends on _api_key_env_defaulted, but the graph serializer saves every auto-filled stage key as an explicit os.environ/NVIDIA_API_KEY reference. Loading it clears this private flag, so the same params select a different credential after save/load (or clone_graph). Reproduced with NVIDIA_API_KEY="env-key", SHARED_TEST_KEY="shared-key", and ExtractParams(api_key="os.environ/SHARED_TEST_KEY"): stage_api_key("ocr_api_key") and the page-elements equivalent return shared-key before _encode_value/_decode_value, then env-key afterward. A loaded multi-type graph can consequently send requests with the wrong key or fail authentication. Preserve the distinction between auto-defaulted and explicitly supplied stage references in the existing graph codec, and add a round-trip regression test.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in ee360a4. The graph codec now saves which _ParamsModel API-key fields were filled from the environment and restores that on load, so stage_api_key() returns the same key before and after _encode_value/_decode_value, save/load, and clone_graph. Saved graphs without the new field load as before. tests/test_graph_pipeline_registry.py adds your repro for both the OCR and page-elements keys, plus the case where an explicit stage key still wins.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. ee360a4 stores which keys were env-defaulted in the params envelope (api_key_env_defaulted) and restores those markers on decode. It includes round-trip tests over codec, save_graph/load_graph and clone_graph, for both stages, with explicit and defaulted stage keys.

1c01707 handles a related case: a graph saved without NVIDIA_API_KEY and loaded with it set. Previously the decoder replaced the markers that validation had just set, so the freshly env-filled stage key won over an explicit shared api_key. The decoder now merges the saved markers into the existing ones. A regression test covers this; it fails without the change.

…-cleanup-pass2

# Conflicts:
#	nemo_retriever/src/nemo_retriever/common/params/models.py
greptile-apps[bot]

This comment was marked as resolved.

Persist API-key default provenance in the existing params envelope so graph save/load and clone retain shared-key precedence. Cover explicit stage references and older payloads without the optional metadata.

Signed-off-by: Jacob Ioffe <jioffe@nvidia.com>
Merge saved API-key default provenance into the markers set during validation instead of replacing them, so a graph saved without NVIDIA_API_KEY and loaded with it still prefers an explicit shared api_key.

Signed-off-by: Jacob Ioffe <jioffe@nvidia.com>
Leave profile removal to its separate change while retaining endpoint alias validation, stage credentials and graph provenance, and PDF method validation.

Signed-off-by: Jacob Ioffe <jioffe@nvidia.com>
@jperez999
jperez999 merged commit 26381a6 into main Nov 20, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants