feat: LLM routing integration via NotDiamond
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.
CodSpeed Performance Report
Merging #4543 will degrade performances by 28.56%
Comparing Not-Diamond:nd-integration (9c0e8a8) with main (ab71e2f)
Summary
❌ 1 regressions
✅ 14 untouched benchmarks
:warning: Please fix the performance issues or acknowledge them on CodSpeed.
Benchmarks breakdown
| Benchmark | main |
Not-Diamond:nd-integration |
Change | |
|---|---|---|---|---|
| ❌ | test_successful_run_with_input_type_text |
380 ms | 531.9 ms | -28.56% |