Add support for HF summarization endpoint in the websearch #319
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.
If the user has set an
HF_ACCESS_TOKEN
we use it to call up an inference endpoint trained for summarization. If the user didn't set their token, we use their LLM endpoint (could be self-hosted w/ no HF token) to try and make a summary the old way.In my local testing this returns more accurate & faster summaries and it would also help reduce the load on the LLM endpoint. (summarization takes a huge context window which is much larger than most conversations)
I'm not sure if the model I chose is optimal as there are multiple models that support summarization. I'm also not sure if we could get rate limited by the API since the calls for all users would be coming from one server using the prod HF token.