You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "kuswardhanietidims-svg (via GitHub)" <gi...@apache.org> on 2026/08/28 01:37:56 UTC

[PR] [Feature][CLI] Add OrcaRouter AI gateway LLM provider [seatunnel]

kuswardhanietidims-svg opened a new pull request, #11997:
URL: https://github.com/apache/seatunnel/pull/11997

   This adds **OrcaRouter** as a first-class LLM provider in the SeaTunnel AI CLI, so users can point `AI_PROVIDER=orcarouter` and immediately generate production-ready SeaTunnel pipeline configs through the gateway — instead of treating it as an anonymous `OPENAI_BASE_URL` override.
   
   [OrcaRouter](https://www.orcarouter.ai) is an OpenAI-compatible AI gateway built for both models and agents. Like OpenRouter, it exposes a provider/model namespace across many models — but it also combines adaptive routing, automatic failover, zero-markup inference, observability, guardrails, and agent-tool governance behind the same endpoint. Adding `orcarouter` as a first-class provider means SeaTunnel users can use that stack directly, without treating OrcaRouter as a custom base URL.
   
   It also runs gateway-level, zero-trust security for AI agents on the same endpoint — screening every prompt/response and governing every tool call on a default-deny basis, with no application code changes.
   
   The provider mirrors the existing `openai` provider exactly: OrcaRouter speaks the OpenAI Chat Completions protocol, so `OrcaRouterProvider` subclasses `OpenAIProvider` and only overrides the base URL (`https://api.orcarouter.ai/v1`), the credential env var (`ORCAROUTER_API_KEY`), and the default model (`orcarouter/auto`, which auto-grades and auto-routes each request). Model IDs use the gateway's `provider/model` namespace (e.g. `deepseek/deepseek-v4-pro`, `openai/gpt-5.5-pro`).
   
   Changes:
   - `seatunnel-cli/seatunnel_cli/llm_provider.py` — `OrcaRouterProvider`, registered in `_PROVIDERS`, `_auto_detect_provider`, and the config-file model-override path.
   - `seatunnel-cli/seatunnel_cli/cli.py` — `orcarouter` added to `--provider` choices, the `--init` wizard, `/config`, and `/status`.
   - `seatunnel-cli/tests/test_llm_provider_orcarouter.py` (new) + `test_cli_provider_routing.py` — unit tests covering the provider, CLI routing, and config-file overrides.
   - Docs: `seatunnel-cli/README.md` / `README.zh-CN.md`, `env.example.sh`, `setup.sh`, `docs/en/ai-cli/*` and `docs/zh/ai-cli/*`.
   
   Verification:
   - `python3 -m pytest tests/` — 82 passed (was 76 before this PR).
   - L3 live test against the real endpoint (`AI_PROVIDER=orcarouter`): streaming chat, non-streaming chat, and the CLI's tool-calling loop (connector lookup) all returned 200/valid responses; a full single-shot generation produced a valid MySQL→S3 Parquet config through the multi-agent pipeline.
   
   Discord: discord.gg/YEubt8enRA · X: https://x.com/OrcaRouter
   
   I'm an engineer on the OrcaRouter team.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][CLI] Add OrcaRouter AI gateway LLM provider [seatunnel]

Posted by "davidzollo (via GitHub)" <gi...@apache.org>.
davidzollo commented on PR #11997:
URL: https://github.com/apache/seatunnel/pull/11997#issuecomment-5459847337

   +1 if CI passes.
   LGTM
   
   Thanks for your contribution! This is a solid addition to the project, and your attention to detail really shows. Contributors like you are what keep this community moving forward. Feel free to keep the PRs coming — we're always glad to have you here!
   
   Please ignore the following message if you have joined in the Slack~
   
   To facilitate focused communication among contributors, we’ve created a brand-new dedicated #contributors channel in official Slack workspace.
   Slack workspace link: https://s.apache.org/seatunnel-slack
   
   This channel is designed for technical discussions, feature design brainstorming, roadmap sync and direct communication with project core Contributors. Everyone who contributes code, docs, test cases or community ideas is warmly invited to join, share thoughts and collaborate together under The Apache Way. Welcome to join 😄


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][CLI] Add OrcaRouter AI gateway LLM provider [seatunnel]

Posted by "davidzollo (via GitHub)" <gi...@apache.org>.
davidzollo commented on PR #11997:
URL: https://github.com/apache/seatunnel/pull/11997#issuecomment-5459828584

   Good job.
   
   Thanks a lot for your valuable contribution to Apache SeaTunnel!
   
   To pass the automated CI checks for this PR, could you please enable CI workflows in your forked repository first? You can refer to the check run link below as a reference for the required CI configuration  
   [[Pull Request Labeler / Build (pull_request_target)](https://github.com/apache/seatunnel/pull/11997/checks?check_run_id=98728221019)](https://github.com/apache/seatunnel/pull/11997/checks?check_run_id=98728221019)
   
   If you run into any trouble enabling CI or encounter related errors during the process, feel free to leave a comment here. Contributors are always ready to offer help~
   
   <img width="2412" height="1472" alt="image" src="https://github.com/user-attachments/assets/6abd2ea1-da45-4d78-a81c-0158f2d7a851" />


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][CLI] Add OrcaRouter AI gateway LLM provider [seatunnel]

Posted by "SEZ9 (via GitHub)" <gi...@apache.org>.
SEZ9 commented on PR #11997:
URL: https://github.com/apache/seatunnel/pull/11997#issuecomment-5469330291

   Thanks @DanielLeens for the thorough re-verification — diffing `4a576f78e..9be70636c` directly rather than relying on the description is exactly the kind of confirmation that helps here. Good to see Issues 1–3 closed, and the new `ORCAROUTER_ECHO_REASONING_CONTENT` env var plus the `test_echo_reasoning_content_env_override` test is a clean resolution for the reasoning-replay toggle.
   
   That said, the new commit also partially unblocks two of my earlier documentation findings, and a few asks from my previous round remain open. Concretely:
   
   1. **Reasoning-content docs (F7/F8):** now that `ORCAROUTER_ECHO_REASONING_CONTENT` exists in `9be70636c`, please document it in `seatunnel-cli/README.md` and `docs/en/ai-cli/quickstart.md`, and clarify whether `OPENAI_ECHO_REASONING_CONTENT` has any effect when `AI_PROVIDER=orcarouter`.
   2. **Base-URL scoping (F1/F5):** please document how an already-exported `OPENAI_BASE_URL` interacts with the OrcaRouter provider, and either add an `ORCAROUTER_BASE_URL` override in `seatunnel-cli/env.example.sh` or state explicitly that the gateway endpoint is fixed. Requests carrying `ORCAROUTER_API_KEY` must not be redirectable to an arbitrary host via the inherited OpenAI var.
   3. **Fail-fast behavior (F2):** a missing `openai` package or a missing/empty `ORCAROUTER_API_KEY` should raise an orcarouter-specific error in `seatunnel-cli/seatunnel_cli/cli.py` instead of surfacing OpenAI-oriented messages at runtime.
   4. **Data-handling caveat for `orcarouter/auto` (F3):** since prompts routinely contain database credentials and the default model routes dynamically to unspecified downstream vendors, `docs/en/ai-cli/quickstart.md` needs an explicit caveat.
   5. **Model fallback semantics (F4):** document the precedence between `ORCAROUTER_MODEL` / `ORCAROUTER_SMALL_FAST_MODEL`, the inherited `OPENAI_MODEL` vars, and the config-file override path in `seatunnel-cli/README.md`.
   6. **Provider selection with multiple credentials (F6):** document which provider wins when several API keys are exported, so users aren't silently switched to orcarouter.
   
   None of these require code churn beyond items 2–3; the rest are documentation additions. Happy to take another look once those land.
   
   <!-- streview-comment:683 -->


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][CLI] Add OrcaRouter AI gateway LLM provider [seatunnel]

Posted by "kuswardhanietidims-svg (via GitHub)" <gi...@apache.org>.
kuswardhanietidims-svg commented on PR #11997:
URL: https://github.com/apache/seatunnel/pull/11997#issuecomment-5463051387

   Thanks for the thorough re-review. I've addressed all three non-blocking items in commit `9be70636c`:
   
   **Issue 1 — `ORCAROUTER_ECHO_REASONING_CONTENT` env var (parity with `OpenAIProvider`)**
   `OrcaRouterProvider.__init__` now reads `ORCAROUTER_ECHO_REASONING_CONTENT` via the existing `_env_bool()` helper, defaulting to `true` (same default as `OPENAI_ECHO_REASONING_CONTENT`):
   ```python
   self._echo_reasoning_content = _env_bool("ORCAROUTER_ECHO_REASONING_CONTENT", True)
   ```
   Added a unit test (`test_echo_reasoning_content_env_override`) covering `false`, `true`, and the unset-default path.
   
   **Issue 2 — redundant `if not os.environ.get(...)` guard before `setdefault`**
   Dropped the existence checks in `create_provider()` for both `ORCAROUTER_MODEL` and `ORCAROUTER_SMALL_FAST_MODEL`; the bare `os.environ.setdefault(...)` now matches the tighter form used elsewhere in the file.
   
   **Issue 3 — temp dir leak in `test_config_model_override_is_independent`**
   Switched from `tempfile.mkdtemp()` to `tempfile.TemporaryDirectory()` with `tmp.cleanup()` in the existing `finally` block.
   
   The new `ORCAROUTER_ECHO_REASONING_CONTENT` var is also documented in `env.example.sh`, `README.md`/`README.zh-CN.md` (env-var reference table), and the `docs/en+zh/ai-cli/quickstart.md` examples.
   
   Verification: `python3 -m pytest tests/` → 83 passed (was 82), all existing tests green, no new dependencies. The branch is rebased on latest `dev` and force-push was not needed for this commit (it's an additive commit on top of `4a576f78e`).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][CLI] Add OrcaRouter AI gateway LLM provider [seatunnel]

Posted by "kuswardhanietidims-svg (via GitHub)" <gi...@apache.org>.
kuswardhanietidims-svg commented on PR #11997:
URL: https://github.com/apache/seatunnel/pull/11997#issuecomment-5461598878

   Thanks for the review. Two things were needed and are now done:
   
   - GitHub Actions was disabled on my fork, so no workflow runs were being created and the `Build` check could not be detected. I have enabled Actions on the fork (all workflows, including `build_main.yml`, are now indexed and active).
   - The branch was behind the latest `dev`, so I rebased it onto the current `apache/seatunnel` `dev` and force-pushed.
   
   The `Build` workflow is now running on the fork and has been picked up as the PR's `Build` check; I'll confirm here once it passes.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][CLI] Add OrcaRouter AI gateway LLM provider [seatunnel]

Posted by "kuswardhanietidims-svg (via GitHub)" <gi...@apache.org>.
kuswardhanietidims-svg commented on PR #11997:
URL: https://github.com/apache/seatunnel/pull/11997#issuecomment-5466608668

   Thanks for the third-pass review and for verifying `9be70636c` against each affected file rather than taking the changelog summary at face value — the diff-level confirmation is appreciated.
   
   Agreed on all three items: `ORCAROUTER_ECHO_REASONING_CONTENT` now has full env-var parity with `OPENAI_ECHO_REASONING_CONTENT` via the shared `_env_bool()` helper, the redundant `if not os.environ.get(...)` guards are collapsed to bare `setdefault` calls matching the rest of `create_provider()`, and the test temp-dir leak is fixed. The new test covers explicit `false`/`true` plus the unset-default path.
   
   No further changes are planned on this branch. The PR is ready for the formal approval whenever a maintainer with write access can submit it.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Feature][CLI] Add OrcaRouter AI gateway LLM provider [seatunnel]

Posted by "davidzollo (via GitHub)" <gi...@apache.org>.
davidzollo merged PR #11997:
URL: https://github.com/apache/seatunnel/pull/11997


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org