Add provider-level round-robin proxy pools for keyless providers, with per-key and per-account overrides

Open
#9,102 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
typescript
Domain
api, backend

Research direction

Start from the provider-level outbound proxy introduced in #5289 and the routing discussion in #5324, which the issue cites for context. The issue names no concrete source files, so first locate where a provider's proxy is chosen per request and how streams are held open. Done means a keyless provider with a three-proxy round-robin pool sends successive requests through P1, P2, P3, P1, and an in-flight stream keeps its original proxy.

Written by the indexing model from the issue text.

Description

account-pool enhancement
Area

Proxy and routing / Dashboard

What are you trying to accomplish?

I would like to manage outbound proxies in a Proxy tab under each provider. A provider that accepts unauthenticated requests should be able to rotate through multiple proxies without registering an API key, an OAuth account, or a dummy credential.

What prevents this today?

#5289 introduced a provider-level outbound proxy. A single fixed proxy does not cover a pool of exits for one provider. #5324 discussed per-account routing and invited a smaller opt-in proposal.

What should OpenCodex do?
  • Let a provider select a fixed proxy or an ordered round-robin proxy pool.
  • For a keyless provider, choose the next proxy when a new request starts. Keep the chosen proxy for the lifetime of that request, including its stream. Concurrent requests should retain their own selection.
  • For providers that use credentials, let each API key or stored OAuth account inherit the provider default, select a fixed proxy, or select its own round-robin pool. Proxy rotation should work independently of credential rotation.
Example usage or interface

In Providers → Example → Proxy, add P1, P2, and P3 and select Round robin. With zero credentials configured, four successive requests should exit through P1, P2, P3, and P1. If the first request is still streaming when the second starts, the first stream stays on P1.

For an authenticated provider, Key A could inherit that pool while Key B stays pinned to P2.

Suggested first slice

Start with an opt-in provider-level pool and the four-request keyless example above. Per-key and per-OAuth-account overrides can build on that provider default.

Dominant language
TypeScript
Stars
16.9k
Forks
1.3k
Avg merge
1d 4h
Merged PRs (30d)
814

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from lidge-jun/opencodex

All issues in lidge-jun/opencodex

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.