-
Notifications
You must be signed in to change notification settings - Fork 491
feat(llm): add support for langchain partner and community chat models #1085
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
Conversation
69e3889
to
1c72e4a
Compare
12de6bb
to
5a7bdb0
Compare
c88c5ff
to
9cec72e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, approving. We need to define a subset of models for each of the initializer types and add them to integration tests. Then we can add documentation saying that we support every Langchain model out there, and list the models we actively test against. Also we need to add integration tests calling into these providers (could you create a follow-on task for that?)
f97aa2b
to
bcf578f
Compare
Introduces a new abstraction layer for initializing LLM models with: - refactor providers module - implement model initialization logic - clear separation between text completion and chat models - proper error handling with dedicated ModelInitializationError - consistent provider name handling and discovery - type safety improvements for LangChain models fix: remove configurable fix: remove lru_cache feat(config): add mode field to Model feat(llmrails): integrate mode field from Model feat(initializer): integrate mode field from Model feat(initializer): add mode support to LangChain model initialization - introduced `ModelInitStrategy` class to encapsulate initialization strategies with supported modes. - updated `try_strategy` to skip strategies that do not support the requested mode. - enhanced logging - adjusted strategies to include supported modes for better control over initialization logic. fix(providers): change to log.debug refactor: move deprecated llm providers to a list fix: remove Langchain warnings refactor: improve langchain initialization logic and names add validation and improve model initialization add custom_chat_model registeration test add tests skip failing test as it should be run in LIVE mode Update nemoguardrails/rails/llm/config.py Signed-off-by: Pouyan <13303554+Pouyanpi@users.noreply.github.com>
bcf578f
to
c925b04
Compare
correct regex pattern in test for model initialization
Description
Introduces a new abstraction layer for initializing LLM models with:
Added tests, increase number of
providers
related tests from 2 to 69.Requires:
Following PRs must get merged first (those are cherry-picked to this PR)
#1084
#1083
Resolves
#1055
#1044
#1070
#124
#902
#753
#520
#865
might resolve #933
need to check #992
TODO:
chat
andcompletion
mode toModel
class -> allows user to avoid our selection orderchat completions
over text and if the user wants to use the text completionmode ' must be set to
text`