refactor: reduce configuration sprawl (dead run-mode/chunking config + unify LanceDB table name)#2297
Draft
jdye64 wants to merge 4 commits into
Draft
refactor: reduce configuration sprawl (dead run-mode/chunking config + unify LanceDB table name)#2297jdye64 wants to merge 4 commits into
jdye64 wants to merge 4 commits into
Conversation
chunk_bundle.py imported TextChunkParamsByType from common.params.models, a symbol that does not exist, so the module raised ImportError if ever loaded. Nothing referenced coalesce_text_chunk_bundle. Removing it drops a broken, redundant chunking-config path (report suggestion: consolidate the three ways chunking is currently expressed). Co-authored-by: Jeremy Dyer <jdye64@gmail.com>
ModelRunMode ("local" | "NIM" | "build-endpoint") and the abstract
model_runmode property were dead metadata: every BaseModel subclass hard
-coded "local" and the property was only ever read in tests. Real
local/NIM/hosted selection happens in operators/operator_archetype.py via
*_invoke_url presence and GPU detection, not on the model classes.
Removing it eliminates one of the four competing "run mode" vocabularies
in the repo (report suggestion #2). Updated tests to assert the alias is
gone instead of checking its members.
Co-authored-by: Jeremy Dyer <jdye64@gmail.com>
The default LanceDB table name was spelled three different ways across the codebase: "nv-ingest" (params, graph retriever, vdb operators/stage/bulk, harness config), "nemo-retriever" (ingest plan, query options, CLIs, harness resolution), and "nemo_retriever" (service vectordb + Helm). A default ingest and a default query could therefore silently target different tables. Introduce a single canonical constant common.vdb.DEFAULT_LANCEDB_TABLE_NAME = "nemo-retriever" (matching the user-facing ingest/query CLI defaults, which are unchanged) and route every default through it: LanceDbParams, IngestStorageOptions, QueryStorageOptions, graph Retriever fallback, LanceDB operator/stage/bulk, ingest & query CLIs, recall tooling, service VectorDbConfig + vectordb_app + Helm values, harness config/resolution, and benchmark_registry.DEFAULT_TABLE_NAME. Implements report suggestion #6. Note: this changes the service vectordb default table name from 'nemo_retriever' to 'nemo-retriever'; existing Helm/service deployments that relied on the old default will point at a new table and should set serviceConfig.vectordb.tableName explicitly to keep reading pre-existing data. Evaluation tools that deliberately default to 'nv-ingest' pre-ingested benchmark tables are intentionally left unchanged. Co-authored-by: Jeremy Dyer <jdye64@gmail.com>
Removing the test_model_runmode methods left test_model_type directly adjacent to test_input_batch_size, which black flags. Re-add the PEP8/black-required blank line between the methods. Co-authored-by: Jeremy Dyer <jdye64@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Incremental reduction of configuration sprawl in the repo. Grouped into logical commits; each addresses a specific finding from the configuration audit.
1. Remove dead
ModelRunModerun-mode vocabularyModelRunMode = "local" | "NIM" | "build-endpoint"was dead metadata: everyBaseModelsubclass hard-codedmodel_runmode → "local", and.model_runmodewas only ever read in tests. Real local/NIM/hosted selection happens per-stage inoperators/operator_archetype.pyvia*_invoke_urlpresence + GPU detection. Removed the type alias, the abstract property onBaseModel, and its 10 concrete overrides; tests updated. This removes one of the four competing "run mode" vocabularies. (Report suggestion #2)2. Remove broken
common/params/chunk_bundle.pyImported
TextChunkParamsByType(a symbol that does not exist), so it raisedImportErrorif ever loaded; nothing referenced it. Leftover of an incomplete refactor and a redundant third way to express chunking. (Report suggestion #24)3. Unify the default LanceDB table name behind one constant
The default table name was spelled three different ways:
nv-ingest(params, graph retriever, vdb operators/stage/bulk, harness config),nemo-retriever(ingest plan, query options, CLIs, harness resolution), andnemo_retriever(service vectordb + Helm). A default ingest and a default query could therefore silently target different tables — a latent bug.Introduced
common.vdb.DEFAULT_LANCEDB_TABLE_NAME = "nemo-retriever"(matching the user-facing ingest/query CLI defaults, which are unchanged) and routed every default through it:LanceDbParams,IngestStorageOptions,QueryStorageOptions, the graphRetrieverfallback, the LanceDB operator/stage/bulk writers, the ingest & query CLIs, recall tooling, serviceVectorDbConfig/vectordb_app/Helm values, harnessconfig/resolution, andbenchmark_registry.DEFAULT_TABLE_NAME. (Report suggestion #6)Intentionally NOT changed
local_ingest_embed_backenddefault (vllmfor ingest vshffor query) — investigated and left as-is. This divergence is intentional (vLLM for batch-ingest throughput vs HF for low-latency single-query embedding); forcing them equal would likely regress one path.Validation
nemo-retriever.test_root_cli_workflow,test_root_query_cli,test_query_workflow_options,test_ingest_empty_validation,test_type_aliases,test_beir_evaluation,test_evaluation_retrievers,test_nv_ingest_vdb_operator,test_service_vectordb_app,test_service_vectordb_evidence_integration,test_helm_vectordb_embed_required,test_harness_agentic_eval,test_split_config*(170+ tests). GPU/[local]-extra tests were compile-checked only (torch not available in CI env).Checklist