Skip to content

feat: Implement SmartRouter (Unified API, Fallback, Load Balancing)#489

Open
daiquydev wants to merge 1 commit into
arakoodev:tsfrom
daiquydev:feat/smart-router
Open

feat: Implement SmartRouter (Unified API, Fallback, Load Balancing)#489
daiquydev wants to merge 1 commit into
arakoodev:tsfrom
daiquydev:feat/smart-router

Conversation

@daiquydev
Copy link
Copy Markdown

Overview

This PR implements a SmartRouter for the JS SDK, inspired by LiteLLM in Python, as requested in issue #286.

Key Features

  • Unified API: Standardizes request and response formats across different providers (OpenAI, Gemini, Llama) using an OpenAI-compatible interface.
    • Routing Strategies:
  • - **Fallback**: Automatically switches to the next available provider if the primary one fails.
    
  • - **Load Balancing**: Distributes requests across multiple providers using weighted random selection.
    
    • Provider Support: Initial support for OpenAI, Gemini, and Llama.
    • Easy Integration: Fully integrated into the @arakoodev/edgechains.js/ai module.
    • Example: Added a standalone example in examples/smart-router to demonstrate usage.

Technical Details

@github-actions
Copy link
Copy Markdown

CLA Assistant Lite bot: Thank you for your submission, we really appreciate it. Before we can accept your contribution, we ask that you sign the Arakoo Contributor License Agreement. You can sign the CLA by adding a new comment to this pull request and pasting exactly the following text.


I have read the Arakoo CLA Document and I hereby sign the CLA


Trần Đại Quý seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You can retrigger this bot by commenting recheck in this Pull Request

@daiquydev daiquydev changed the title feat(ai): Implement SmartRouter (Unified API, Fallback, Load Balancing) feat: Implement SmartRouter (Unified API, Fallback, Load Balancing) May 12, 2026
@daiquydev
Copy link
Copy Markdown
Author

I have read the Arakoo CLA Document and I hereby sign the CLA

@daiquydev
Copy link
Copy Markdown
Author

I have read the Arakoo CLA Document and I here by sign the CLA

@daiquydev daiquydev closed this May 12, 2026
@daiquydev daiquydev reopened this May 12, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators May 12, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BOUNTY: Convert the endpoints to a smart router like litellm does in python

1 participant