-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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: LLM routing integration via NotDiamond #4543
Conversation
CodSpeed Performance ReportMerging #4543 will degrade performances by 28.56%Comparing Summary
Benchmarks breakdown
|
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.
Hey @barabasicsongor
This is looking good. Thanks!
What do you think about using a HandleInput with is_list=True
and allow the User to pass the LLM instances into NotDiamondComponent and using a function like get_model_name
(https://github.com/langflow-ai/langflow/blob/main/src/backend/base/langflow/base/models/model_utils.py#L1) you could get the names, validate them and even call the LLM by passing it to get_chat_result
(https://github.com/langflow-ai/langflow/blob/main/src/backend/base/langflow/base/models/chat_result.py#L40).
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.
Hi @ogabrielluiz , that's is a great suggestion! I've just updated the PR, if you could have a look please 😄
I've also extended the supported Anthropic models list as they were missing the latest versions.
There is 1 minor thing which I haven't figured out yet, so if you have any suggestion would be amazing:
How to access the stream
value from previous nodes in my Not Diamond node, so I can pass it on? Currently I only get access to the Langchain Runnable models, which don't contain that.
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
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.
Regarding the FE side - new bundle added.
LGTM
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
* WIP * Integrate Notdiamond via API call * Fix frontend lock * Update * Update ND integration to use HandleInput for LLM models * Move NotDiamond out into bundles and add fallback call * Update src/backend/base/langflow/components/notdiamond/notdiamond.py Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org> * Update src/backend/base/langflow/components/notdiamond/notdiamond.py Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org> * Update src/frontend/src/icons/NotDiamond/NotDiamondIcon.jsx Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org> --------- Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
Overview
Hi there Langflow team! I am a big fan of
Langflow
and would love to integrate Not Diamond into it. In case you're unfamiliar with Not Diamond, it automatically routes your prompts to the AI model best-suited to respond to that prompt. By using Not Diamond as an AI "meta-model," you can achieve state-of-the-art performance that beats every foundation model on every major benchmark.*For
Langflow
we would like to integrate our router into your app as a component, so that users can automatically route their prompts across multiple models.Description of approach
We have integrated NotDiamond as a new component under the Prototypes group. The call to NotDiamond is happening as a POST request API call. We have decided to go down this route, as integrating our Python SDK caused conflicts - since both ours and your library is inheriting from Langchain.
Users can choose the Not Diamond Router component, it accepts an input text/message/prompt, and the output will be a string that represents the model they should call next.
This output will be integrating perfectly with your conditional component soon.
Screenshots:
Other relevant notes
*If you’d like to learn more about our routing, check out this example walkthrough video with Tomas, our CEO. You can also
see how we work by using our Chat app,
learn more at our website, or
read our docs.