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: add LLM Router component using OpenRouter specs #5475

Merged

Conversation

raphaelchristi
Copy link
Contributor

Description

This PR adds a new LLM Router component that intelligently routes queries to the most appropriate language model based on OpenRouter specifications and task requirements.

Features

  • Automatic model specification fetching from OpenRouter API
  • Dynamic model selection based on task complexity and requirements
  • Multiple optimization modes (quality, speed, cost, balanced)
  • Robust error handling with fallback mechanisms

Usage

  1. Connect multiple LLM models to the router
  2. Add a judge LLM for selection
  3. Provide input message
  4. Select optimization preference
  5. Router will automatically select and use the most appropriate model

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request labels Dec 28, 2024
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Dec 28, 2024
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Dec 28, 2024
Copy link
Collaborator

@erichare erichare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a fantastic addition! with that said, there is a ruff style check issue, could you take a look at that?

@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Jan 17, 2025
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jan 17, 2025
@erichare erichare enabled auto-merge January 17, 2025 20:31
@erichare erichare added this pull request to the merge queue Jan 17, 2025
Merged via the queue into langflow-ai:main with commit 7cf77d3 Jan 17, 2025
42 of 44 checks passed
jhpiedrahitao pushed a commit to jhpiedrahitao/langflow that referenced this pull request Jan 24, 2025
* feat: add LLM Router component using OpenRouter specs

* [autofix.ci] apply automated fixes

* fix: resolve linting issues in LLM Router component

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants