Skip to content

feat: LiteLLM-style smart router for JS SDK#441

Open
blessuselessk wants to merge 1 commit intoarakoodev:tsfrom
blessuselessk:feat/smart-router-286
Open

feat: LiteLLM-style smart router for JS SDK#441
blessuselessk wants to merge 1 commit intoarakoodev:tsfrom
blessuselessk:feat/smart-router-286

Conversation

@blessuselessk
Copy link
Copy Markdown

@blessuselessk blessuselessk commented Mar 19, 2026

/claim #286

Summary

Fixes #286

Implements a multi-provider LLM routing system inspired by LiteLLM for the EdgeChains JS SDK.

Features

  1. Load Balancing — round-robin, least-tokens, latency-based, cost-based strategies with RPM/TPM rate limiting
  2. Streaming — AsyncGenerator-based with automatic fallback on stream errors
  3. Token Usage Tracking — per-model counters with getUsage() and resetUsageCounters()
  4. Logging — Sentry breadcrumbs + error capture, PostHog event tracking, custom callbacks

Testing

24 tests (unit + e2e with mock servers), all passing. TypeScript compiles clean.

Implements multi-provider routing with 4 strategies (round-robin,
least-tokens, latency-based, cost-based), streaming support,
token usage tracking, and logging (Sentry + PostHog + callbacks).

Fixes arakoodev#286
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 19, 2026

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@blessuselessk
Copy link
Copy Markdown
Author

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

@blessuselessk
Copy link
Copy Markdown
Author

recheck

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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