Skip to content

feat(#286): Add Smart Router infrastructure for multiple providers#438

Open
beitiataidy-ops wants to merge 9 commits intoarakoodev:tsfrom
beitiataidy-ops:feat/smart-router-bounty
Open

feat(#286): Add Smart Router infrastructure for multiple providers#438
beitiataidy-ops wants to merge 9 commits intoarakoodev:tsfrom
beitiataidy-ops:feat/smart-router-bounty

Conversation

@beitiataidy-ops
Copy link

This PR adds a unified Smart Router to EdgeChains, supporting multiple providers like OpenAI, Gemini, Cohere, Anthropic, and Mistral as requested in #286.

Current status:

  • Infrastructure for SmartRouter added.
    • Expanded ChatModel types.
    • More endpoint implementations and tests coming soon.
@github-actions
Copy link

github-actions bot commented Mar 17, 2026

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

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fc0ed0c0e1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

| "claude-3-haiku-20240307";

export type role = "user" | "assistant" | "system";
export type Provider = "openai" | "google" | "cohere" | "anthropic" | "mistral";

Choose a reason for hiding this comment

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

P1 Badge Restore exported role type for existing providers

This update drops the role export from types/index.ts, but existing modules still import it (lib/openai/openai.ts:4 and lib/llama/llama.ts:2), so type-checked builds will fail with a missing export error (TS2305). That makes this a breaking regression introduced by the new type changes, even before SmartRouter is used.

Useful? React with 👍 / 👎.

throw new Error("No endpoints configured in SmartRouter");
}

if (options.strategy === "priority" || options.strategy === "failover") {

Choose a reason for hiding this comment

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

P1 Badge Handle latency strategy in SmartRouter.chat

SmartRouterOptions includes strategy: "latency", but chat() only enters the endpoint execution loop for priority and failover; when callers pass latency, it always jumps to throw new Error("All endpoints failed...") even with valid endpoints configured. This makes the advertised latency mode unusable and causes deterministic runtime failures.

Useful? React with 👍 / 👎.

@beitiataidy-ops
Copy link
Author

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

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

Labels

None yet

1 participant