Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: let LLM choose whether to retrieve context #62

Merged
merged 11 commits into from
Dec 15, 2024
Merged

feat: let LLM choose whether to retrieve context #62

merged 11 commits into from
Dec 15, 2024

Conversation

lsorber
Copy link
Member

@lsorber lsorber commented Dec 9, 2024

Changes:

  • Add support for tool use to the llama.cpp LiteLLM integration.
  • The rag or async_rag functions now update the message history with tool use and the assistant response.
  • Let LLM choose whether to retrieve context through tool use. Details:
    • Tool use is skipped if RAG context is already provided.
    • Llama.cpp models cannot stream the response with tool_choice="auto" (which lets the LLM choose whether or not to call a tool), so we add a workaround that forces tool use but lets them skip tool execution with a skip=True argument.
    • To help llama.cpp models plan their tool use response, the final message is extended with the tools' JSON schema.
  • Fix registering of llama.cpp model_info with LiteLLM.
  • Improve RAG generation test cases.
  • Improve LLM-embedder test coverage.

@lsorber lsorber requested a review from undo76 December 9, 2024 16:11
@lsorber lsorber merged commit 574e407 into main Dec 15, 2024
2 checks passed
@lsorber lsorber deleted the ls-tools branch December 15, 2024 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants