Repository navigation
Fail loudly on ignored flags: fast-text conflicts, embed endpoint aliases, stage API keys, method=audio - #2856
Conversation
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>
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
[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. SummaryThis PR tightens embedding endpoint checks, fixes stage API-key precedence, and removes the legacy audio extraction method.
Reviews (8) · Last reviewed commit: "Remove fast-text conflict validation fro..." · Reviewed by Greptile |
Signed-off-by: Jacob Ioffe <jioffe@nvidia.com>
Document stage credential selection and fast-text override validation arguments, return values, and errors.
|
Superseded by #2861, which batches the release fixes into one PR, one commit per original PR. This change is commit-for-commit identical there. |
|
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) |
There was a problem hiding this comment.
[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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
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>
Description
Second flag-cleanup pass: options that used to be silently overridden or ignored now fail or take effect.
EmbedParamsrejectsembed_invoke_urlandembedding_endpointset to different values. Either name alone still works. Batch tuning now treatsembedding_endpointas remote embedding, so the embed actor no longer reserves a GPU in that case.ExtractParams.page_elements_api_keynow reaches page-element detection (falls back toapi_key). NewExtractParams.stage_api_key()picks the key for page elements and OCR: an explicit per-stage key wins, then an explicitapi_key, then a stage key auto-filled fromNVIDIA_API_KEY/NGC_API_KEY(an explicitos.environ/...stage reference still counts as explicit). On main, an env key overrode an explicitapi_keyfor OCR because the unsetocr_api_keywas auto-filled from the environment first. Saved and cloned graphs keep which stage keys were auto-filled, so the same precedence applies aftersave_graph/clone_graph.ExtractParams.methoddrops"audio"; audio inputs useGraphIngestor.extract_audio()/ audio input detection. Themethodand--methodhelp say it selects how PDF pages are read (withnemotron_parsealso extracting the enabled tables, charts, and infographics).text_depthfrom two legacy examples and a staleextract_method="audio"README note.Scope: param validation and API-key/endpoint wiring only. The
fast-textprofile 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
NVIDIA_API_KEYset.378fda86vs this branch, directretrieverCLI/SDK:method="audio"rejected,embedding_endpoint-only remote embed reserves no GPU,extract_audio()gives identical rows on both.mkdocs build --strictpasses.Checklist
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