feat: Adding code to call the rag_api simple reranker.#10574
feat: Adding code to call the rag_api simple reranker.#10574kalaspuffar wants to merge 1 commit intodanny-avila:mainfrom
Conversation
|
Tried with Node 20, but it did not matter; still 6k linting errors on a newly cloned repository. |
aa96c54 to
a2e3da6
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds support for a local "simple" reranker option for web search functionality, enabling users to run reranking with open-source models through the rag_api service instead of relying solely on external services like Jina or Cohere.
- Adds a new
simplereranker type to the existing reranker options (Jina, Cohere) - Introduces
simpleRerankerInstanceUrlconfiguration parameter throughout the stack - Updates UI components to allow users to configure the simple reranker instance URL
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/data-schemas/src/types/web.ts | Adds simpleRerankerInstanceUrl to web search configuration keys |
| packages/data-schemas/src/app/web.ts | Adds simple reranker auth configuration and loads the instance URL from config |
| packages/data-provider/src/types/web.ts | Adds simple to the RerankerType union and includes simpleRerankerInstanceUrl in SearchToolConfig |
| packages/data-provider/src/config.ts | Adds SIMPLE enum value and schema validation for the simple reranker configuration |
| librechat.example.yaml | Updates configuration example with simple reranker URL option and version bump |
| .env.example | Adds SIMPLE_RERANKER_URL environment variable example |
| client/src/locales/en/translation.json | Adds translation keys for simple reranker UI labels |
| client/src/hooks/Plugins/useAuthSearchTool.ts | Includes simpleRerankerInstanceUrl in the search API key form data type and submission |
| client/src/components/SidePanel/Agents/Search/ApiKeyDialog.tsx | Adds UI configuration option for simple reranker with input field |
| README.md | Documents the new local reranking capability with open-source models |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
4252a49 to
f7b4e81
Compare
|
I'm pretty happy with the last change not to have an instance URL, sadly the GUI will not allow it at this point. The selection will not stick and I can't turn on the WebSearch feature now that I don't have any value to supply to that interface. Looking for a solution but that should be a minor fix. |
f7b4e81 to
dcbf7c0
Compare
|
Problem solved, for some reason we did not allow any service to exist without any required keys. |
3d9ca05 to
64266e1
Compare
aeb24bd to
2b8578c
Compare
|
Made a small change to verify that the specific service (simple) was selected if we wanted to allow no required fields. This should satify the tests. |
ff23837 to
e5462d9
Compare
e5462d9 to
81f9111
Compare
81f9111 to
11e0cf3
Compare
Summary
This pull request was originally introduced in
#9102
We are trying to use a local model to rerank search results using a Python library and implemented as a rest api in the rag_api repository:
danny-avila/rag_api#190
Then we implement a caller in the agents repository:
danny-avila/agents#33
Lastly, we have the code in this PR that will tie it all together.
We need a param in the webSearch configuration block in librechat.yaml
Change Type
Please delete any irrelevant options.
Testing
After this PR is added and the rag_api is started with our new function, and the configuration is done in rag and in this library, a web search should be able to be done without having an external ranker configured.
Test Configuration:
Checklist
Please delete any irrelevant options.
Extra remarks
I've run all test suites and linting and get 6k linting errors on my branch and a newly cloned repository.
I have not, to my knowledge, introduced any new errors in the tests, but I get the same errors on my branch and a newly cloned repository.