Skip to content

Refactoring of backend server and reranker utils.#207

Merged
iv1111 merged 23 commits intoIBM:mainfrom
iv1111:doc-logs-debug
Jan 13, 2026
Merged

Refactoring of backend server and reranker utils.#207
iv1111 merged 23 commits intoIBM:mainfrom
iv1111:doc-logs-debug

Conversation

@iv1111
Copy link
Copy Markdown
Collaborator

@iv1111 iv1111 commented Dec 8, 2025

  • lower log level for document excerpts
  • lower log level for score threshold
  • moved logging start to earlier time in backend server
  • parametrised backend server logging level
  • removed unused main function
  • removed default function values

…eshold

Signed-off-by: Isgandar Valizada <isgandar.valizada@de.ibm.com>
@iv1111 iv1111 requested a review from Niharika0306 December 8, 2025 13:23
@iv1111 iv1111 self-assigned this Dec 8, 2025
@iv1111 iv1111 added the refactor label Dec 8, 2025
@iv1111 iv1111 changed the title Lower log level to debug for documents. Lower some logging levels to "debug" Dec 8, 2025
Copy link
Copy Markdown
Member

@mkumatag mkumatag left a comment

Choose a reason for hiding this comment

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

make sure we bump the version in the makefile and template to not to override the existing image.

Signed-off-by: Isgandar Valizada <isgandar.valizada@de.ibm.com>
@iv1111
Copy link
Copy Markdown
Collaborator Author

iv1111 commented Dec 8, 2025

make sure we bump the version in the makefile and template to not to override the existing image.

Bumped up the version.

Comment thread spyre-rag/src/retrieve/backend_utils.py
@dharaneeshvrd
Copy link
Copy Markdown
Member

dharaneeshvrd commented Dec 8, 2025

can we please add the changes to enable debug log for backend server?
Like its enabled for ingestion

here

Signed-off-by: Isgandar Valizada <isgandar.valizada@de.ibm.com>
@iv1111
Copy link
Copy Markdown
Collaborator Author

iv1111 commented Dec 8, 2025

can we please add the changes to enable debug log for backend server? Like its enabled for ingestion

here

This is what you meant? I will check if backend reads it.

@iv1111
Copy link
Copy Markdown
Collaborator Author

iv1111 commented Dec 8, 2025

@dharaneeshvrd Looks like back-end already reads this env variable. In future we should probably offload this to settings.json, the corresponding class will handle loading and validation.

https://github.com/iv1111/project-ai-services/blob/fcfbaaef5b8bc97789d3f97b26c61cb647fb680a/spyre-rag/src/retrieve/backend_server.py#L198-L205

Signed-off-by: Isgandar Valizada <isgandar.valizada@de.ibm.com>
Signed-off-by: Isgandar Valizada <isgandar.valizada@de.ibm.com>
@iv1111 iv1111 requested a review from dharaneeshvrd December 8, 2025 17:13
Copy link
Copy Markdown
Member

@dharaneeshvrd dharaneeshvrd left a comment

Choose a reason for hiding this comment

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

@iv1111 once we add the config in values.yaml, we have to refer it in pod deployment like this
Please make necessary changes

Comment thread ai-services/assets/applications/rag/values.yaml Outdated
@dharaneeshvrd
Copy link
Copy Markdown
Member

@iv1111 can we please remove the default values here

model: str = "/wca4z-pvc-ckpt/HF_cache/models--BAAI--bge-reranker-large/snapshots/55611d7bca2a7133960a6d3b71e083071bbfc312",
?
@mkumatag hope we can accommodate this minor cleanup!

@Niharika0306
Copy link
Copy Markdown
Contributor

@iv1111 can we please remove the default values here

model: str = "/wca4z-pvc-ckpt/HF_cache/models--BAAI--bge-reranker-large/snapshots/55611d7bca2a7133960a6d3b71e083071bbfc312",

?
@mkumatag hope we can accommodate this minor cleanup!

+1

@mkumatag
Copy link
Copy Markdown
Member

mkumatag commented Dec 9, 2025

@iv1111 can we please remove the default values here

model: str = "/wca4z-pvc-ckpt/HF_cache/models--BAAI--bge-reranker-large/snapshots/55611d7bca2a7133960a6d3b71e083071bbfc312",

?
@mkumatag hope we can accommodate this minor cleanup!

we are always overriding it right? and there is one more line post that also need to be altered. If functionality wise it is not making any impact - please avoid making any change for now.

@dharaneeshvrd
Copy link
Copy Markdown
Member

yes @Niharika0306 please confirm once.

Comment thread ai-services/assets/applications/rag/values.yaml Outdated
@Niharika0306
Copy link
Copy Markdown
Contributor

Niharika0306 commented Dec 9, 2025

@iv1111 can we please remove the default values here

model: str = "/wca4z-pvc-ckpt/HF_cache/models--BAAI--bge-reranker-large/snapshots/55611d7bca2a7133960a6d3b71e083071bbfc312",

?
@mkumatag hope we can accommodate this minor cleanup!

we are always overriding it right? and there is one more line post that also need to be altered. If functionality wise it is not making any impact - please avoid making any change for now.

Yes, we are always overriding it. These are some public instance links that was pointed by research team.
but yes, as you said - its not super important now.

@mkumatag mkumatag added this to the v0.1 milestone Dec 9, 2025
@dharaneeshvrd
Copy link
Copy Markdown
Member

@iv1111 We have to move this block https://github.com/IBM/project-ai-services/blob/main/spyre-rag/src/retrieve/backend_server.py#L198toL205 before importing other modules, to propagate the log level to those modules, can you please take care of this as well?

@mkumatag mkumatag modified the milestones: v0.1, .Next Dec 10, 2025
iv1111 and others added 2 commits December 11, 2025 13:27
* moved logging to top in backend_server.py

Signed-off-by: Isgandar Valizada <isgandar.valizada@de.ibm.com>
Signed-off-by: Isgandar Valizada <isgandar.valizada@de.ibm.com>
@iv1111
Copy link
Copy Markdown
Collaborator Author

iv1111 commented Dec 11, 2025

@iv1111 We have to move this block https://github.com/IBM/project-ai-services/blob/main/spyre-rag/src/retrieve/backend_server.py#L198toL205 before importing other modules, to propagate the log level to those modules, can you please take care of this as well?

@dharaneeshvrd Done, PTAL.

Yes, we are always overriding it. These are some public instance links that was pointed by research team.
but yes, as you said - its not super important now.

@Niharika0306 but it looks like here we call it without passing last three params relying on default values: https://github.com/iv1111/project-ai-services/blob/2a865c06399b6be6d80548c7929a583b59736128/spyre-rag/src/retrieve/reranker_utils.py#L69
@mkumatag Since this PR won't go into GA1, thus I could handle the change here right away.

yes, which is called only when the script is invoked separately. Nonetheless, if this PR is not being merged for GA1, we can go ahead and remove the call and the defaults too.

I removed the default values from reranker utils. As for invocation, I removed the whole main function there, it is not needed.

@iv1111 iv1111 marked this pull request as ready for review December 11, 2025 12:30
@iv1111 iv1111 requested a review from dharaneeshvrd December 11, 2025 12:30
@iv1111
Copy link
Copy Markdown
Collaborator Author

iv1111 commented Dec 11, 2025

@dharaneeshvrd, @Niharika0306 PTAL and each approve if changes are ok.

Comment thread spyre-rag/src/retrieve/backend_server.py Outdated
iv1111 and others added 2 commits December 11, 2025 21:23
Fixing a typo.

Co-authored-by: Dharaneeshwaran Ravichandran <17947543+dharaneeshvrd@users.noreply.github.com>
Signed-off-by: Isgandar Valizada <isgandar.valizada@de.ibm.com>
Signed-off-by: Isgandar Valizada <isgandar.valizada@de.ibm.com>
@iv1111 iv1111 changed the title Lower some logging levels to "debug" Refactoring of backend server and reranker utils. Dec 11, 2025
dharaneeshvrd
dharaneeshvrd previously approved these changes Jan 5, 2026
dharaneeshvrd and others added 2 commits January 5, 2026 13:58
Signed-off-by: Isgandar Valizada <isgandar.valizada@de.ibm.com>
@dharaneeshvrd
Copy link
Copy Markdown
Member

dharaneeshvrd commented Jan 13, 2026

make sure we bump the version in the makefile and template to not to override the existing image.

please do this.
Otherwise lgtm, will approve post above change.

iv1111 and others added 2 commits January 13, 2026 09:34
Signed-off-by: Isgandar Valizada <isgandar.valizada@de.ibm.com>
Copy link
Copy Markdown
Member

@dharaneeshvrd dharaneeshvrd left a comment

Choose a reason for hiding this comment

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

Need approval from @mkumatag

@iv1111 iv1111 merged commit 5219e78 into IBM:main Jan 13, 2026
4 checks passed
@iv1111 iv1111 deleted the doc-logs-debug branch January 13, 2026 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants