feat(llm): add support for langchain partner and community chat models - #1085
Merged
Conversation
Pouyanpi
force-pushed
the
feat/lc-chat-providers
branch
from
April 2, 2025 10:29
69e3889 to
1c72e4a
Compare
Pouyanpi
commented
Apr 2, 2025
Pouyanpi
commented
Apr 2, 2025
Pouyanpi
commented
Apr 2, 2025
Pouyanpi
commented
Apr 2, 2025
Pouyanpi
commented
Apr 2, 2025
Pouyanpi
commented
Apr 2, 2025
Pouyanpi
commented
Apr 2, 2025
Pouyanpi
commented
Apr 2, 2025
Pouyanpi
commented
Apr 2, 2025
Pouyanpi
commented
Apr 2, 2025
Pouyanpi
commented
Apr 2, 2025
Pouyanpi
commented
Apr 2, 2025
4 tasks
Pouyanpi
force-pushed
the
feat/lc-chat-providers
branch
2 times, most recently
from
April 10, 2025 14:41
12de6bb to
5a7bdb0
Compare
4 tasks
Pouyanpi
marked this pull request as ready for review
April 11, 2025 12:34
4 tasks
Pouyanpi
force-pushed
the
feat/lc-chat-providers
branch
from
April 14, 2025 11:40
c88c5ff to
9cec72e
Compare
tgasser-nv
approved these changes
Apr 14, 2025
tgasser-nv
left a comment
Collaborator
There was a problem hiding this comment.
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?)
Pouyanpi
force-pushed
the
feat/lc-chat-providers
branch
3 times, most recently
from
April 16, 2025 17:34
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>
Pouyanpi
force-pushed
the
feat/lc-chat-providers
branch
from
April 17, 2025 08:41
bcf578f to
c925b04
Compare
correct regex pattern in test for model initialization
Closed
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Introduces a new abstraction layer for initializing LLM models with:
Added tests, increase number of
providersrelated 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:
chatandcompletionmode toModelclass -> allows user to avoid our selection orderchat completionsover text and if the user wants to use the text completionmode ' must be set totext`