[GH-ISSUE #3464] [Other] one OpenAI-compatible address in front of several providers, next to the local server #1413

Closed
opened 2026-11-04 01:51:05 +07:00 by bsakaguchi · 3 comments
Owner

Originally created by @Buddychek on GitHub (Oct 20, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/3464

Problem. People running Strata next to a hosted model have no single address for both. A client either talks to the local server or to a provider, and if one is down the client fails. The only workaround today is to run two clients and pick by hand in the application code.

Proposed behaviour. tools/busbar_gateway.py (already written, stdlib only, no GPU and no engine) listens on one OpenAI-compatible /v1 address. A name like fast stands for a pool of members with weights: 80 of 100 requests go to Claude, 20 to GPT, spread evenly by smooth weighted round robin rather than in clumps. A member that fails is tried on the next member, then on the pools named in failover, and is put on cooldown after max_fails failures in a row. Anthropic answers are converted to the OpenAI shape, SSE streams pass through. --plan prints the routing for the next N requests and sends nothing.

Tradeoffs. It is a separate tool, not part of the Strata server: nothing in the default path changes, and the gateway needs no engine. It is single-process and holds no provider keys beyond the config and environment. It does not retry a member more than once per request, and it does not limit request body size.

Evidence so far. 34 unit tests run without network or provider keys (python -m unittest tools.test_busbar_gateway), covering the exact split, the spread, failover, cooldown, both wires, the Anthropic-to-OpenAI conversion, streaming in both directions, and the HTTP routes. Code is in tools/busbar_gateway.py, tools/busbar.example.json and docs/BUSBAR.md on the branch tools/busbar-gateway.

Ask. Is a standalone gateway in tools/ in scope for this repository, or should it live as a separate project? If it is in scope, I will open the pull request against this issue.

Originally created by @Buddychek on GitHub (Oct 20, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/3464 **Problem.** People running Strata next to a hosted model have no single address for both. A client either talks to the local server or to a provider, and if one is down the client fails. The only workaround today is to run two clients and pick by hand in the application code. **Proposed behaviour.** `tools/busbar_gateway.py` (already written, stdlib only, no GPU and no engine) listens on one OpenAI-compatible `/v1` address. A name like `fast` stands for a pool of members with weights: 80 of 100 requests go to Claude, 20 to GPT, spread evenly by smooth weighted round robin rather than in clumps. A member that fails is tried on the next member, then on the pools named in `failover`, and is put on cooldown after `max_fails` failures in a row. Anthropic answers are converted to the OpenAI shape, SSE streams pass through. `--plan` prints the routing for the next N requests and sends nothing. **Tradeoffs.** It is a separate tool, not part of the Strata server: nothing in the default path changes, and the gateway needs no engine. It is single-process and holds no provider keys beyond the config and environment. It does not retry a member more than once per request, and it does not limit request body size. **Evidence so far.** 34 unit tests run without network or provider keys (`python -m unittest tools.test_busbar_gateway`), covering the exact split, the spread, failover, cooldown, both wires, the Anthropic-to-OpenAI conversion, streaming in both directions, and the HTTP routes. Code is in `tools/busbar_gateway.py`, `tools/busbar.example.json` and `docs/BUSBAR.md` on the branch `tools/busbar-gateway`. **Ask.** Is a standalone gateway in `tools/` in scope for this repository, or should it live as a separate project? If it is in scope, I will open the pull request against this issue.
bsakaguchi 2026-11-04 01:51:05 +07:00
Author
Owner

@github-actions[bot] commented on GitHub (Oct 20, 2026):

Thanks for the issue. To keep the tracker readable, every item needs an area prefix in the title and the parts of the issue form filled in. This one is missing:

  • Add the Strata version (Settings > About, or strata --version).

Edit the issue (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment /reopen.

Details: CONTRIBUTING.md

<!-- gh-comment-id:6294578716 --> @github-actions[bot] commented on GitHub (Oct 20, 2026): Thanks for the issue. To keep the tracker readable, every item needs an area prefix in the title and the parts of the issue form filled in. This one is missing: - [ ] Add the Strata version (Settings > About, or `strata --version`). Edit the issue (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment `/reopen`. Details: [CONTRIBUTING.md](https://github.com/Niko1221/Strata/blob/main/CONTRIBUTING.md)
Author
Owner

@Niko1221 commented on GitHub (Oct 22, 2026):

Thanks a lot for this, it's a well-built tool and the tests are thorough. We'd like Strata's repository to stay focused on running models locally, so a gateway that routes across hosted providers fits best as its own project. Please publish it on its own; once it's out, tell us the link and we'll gladly mention it in our docs as something that works with Strata's local OpenAI-compatible server. If anything on Strata's side gets in the way of using it with the local server, open an issue and we'll look at it.

<!-- gh-comment-id:6341575428 --> @Niko1221 commented on GitHub (Oct 22, 2026): Thanks a lot for this, it's a well-built tool and the tests are thorough. We'd like Strata's repository to stay focused on running models locally, so a gateway that routes across hosted providers fits best as its own project. Please publish it on its own; once it's out, tell us the link and we'll gladly mention it in our docs as something that works with Strata's local OpenAI-compatible server. If anything on Strata's side gets in the way of using it with the local server, open an issue and we'll look at it.
Author
Owner

@github-actions[bot] commented on GitHub (Oct 26, 2026):

Closing this issue because it still did not follow the format after 5 days. That is housekeeping, not a rejection.

To bring it back: fix the title (area prefix) and the missing parts, then comment /reopen. A check runs and reopens it, or tells you what is still missing. See CONTRIBUTING.md.

<!-- gh-comment-id:6413530180 --> @github-actions[bot] commented on GitHub (Oct 26, 2026): Closing this issue because it still did not follow the format after 5 days. That is housekeeping, not a rejection. To bring it back: fix the title (area prefix) and the missing parts, then comment `/reopen`. A check runs and reopens it, or tells you what is still missing. See [CONTRIBUTING.md](https://github.com/Niko1221/Strata/blob/main/CONTRIBUTING.md).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#1413
No description provided.