feat(llm): add OrcaRouter as a named OpenAI-compatible gateway - #205
feat(llm): add OrcaRouter as a named OpenAI-compatible gateway#205XiaoHuo888-hue wants to merge 1 commit into
Conversation
Add a named OrcaRouter provider to the transcript-driven LLM clipping routing, mirroring the existing atlascloud/minimax gateways. Selecting any orcarouter/ model in the LLM Model Name dropdown routes requests to https://api.orcarouter.ai/v1/chat/completions with the ORCAROUTER_API_KEY environment variable (or pasted APIKEY). Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: XiaoHuo888-hue <jinhao.song@myflashcloud.com>
LauraGPT
left a comment
There was a problem hiding this comment.
Focused integration tests passed (18/18), and the four documented model slugs are valid. One blocking documentation issue remains: the two READMEs describe optional security controls as active by default.
|
|
||
| Besides the transcript-based LLMs above, FunClip can route LLM-assisted clipping through [OrcaRouter](https://www.orcarouter.ai), an OpenAI-compatible smart-routing gateway. Select any `orcarouter/` model in the **LLM Model Name** dropdown (`orcarouter/auto` routes each request to the best model for the task), paste an OrcaRouter API key in the **APIKEY** box, and click 'LLM Inference' — FunClip sends the transcript and prompts to `https://api.orcarouter.ai/v1/chat/completions`, and the returned segments work with the existing 'AI Clip' button unchanged. | ||
|
|
||
| OrcaRouter exposes one endpoint for all frontier and open-weight models, so you can switch routing targets without changing FunClip. 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. |
There was a problem hiding this comment.
[P1] Make the security guarantee conditional on configuration
This integration only supplies the base URL, API key, and model; it does not attach a Guardrail or Firewall policy or apply the tight autonomy posture. OrcaRouter documents that with neither a key attachment nor a workspace default there is no enforcement, and that default-deny requires explicitly applying tight. It also scopes Firewall coverage to tool calls that cross or report through the gateway, not every tool call. As written, users can reasonably believe selecting OrcaRouter protects every prompt, response, and action automatically. Please qualify this paragraph in both READMEs, link the security setup, and avoid the unconditional every-tool-call claim.
References: https://docs.orcarouter.ai/features/guardrails#scoping-and-the-workspace-default, https://docs.orcarouter.ai/features/firewall#scoping-and-resolution, https://docs.orcarouter.ai/security/concepts/quickstart, https://docs.orcarouter.ai/security/concepts/shared-responsibility
Summary
Adds OrcaRouter as a named, OpenAI-compatible smart-routing gateway for FunClip's transcript-driven LLM clipping — mirroring the existing
atlascloud/andminimax/gateway routes.Users can now select any
orcarouter/model in the LLM Model Name dropdown (orcarouter/auto,orcarouter/fusion,orcarouter/fusion-flash,orcarouter/fusion-mini), paste an OrcaRouter API key in the APIKEY box, and run 'LLM Inference'. FunClip sends the transcript and prompts tohttps://api.orcarouter.ai/v1/chat/completions, and the returned segments work with the existing 'AI Clip' button unchanged.funclip/llm/openai_api.py:orcarouter/prefix branch in_resolve_model_config()→ORCAROUTER_API_BASE(https://api.orcarouter.ai/v1, overridable viaORCAROUTER_API_BASE) +ORCAROUTER_API_KEYenv fallback. Model IDs are sent verbatim with theorcarouter/prefix, as the gateway routes by namespace.funclip/launch.py:SUPPORT_LLM_PREFIX+ dispatch branch + 4 gateway model dropdown entries.tests/test_orcarouter_api.py,tests/test_orcarouter_launch_integration.py: unit tests mirroring the MiniMax/AtlasCloud conventions.README.md/README_zh.md: "Using OrcaRouter as your LLM gateway (optional)" section.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.
User impact
FunClip users get a one-dropdown way to route LLM-assisted clipping through a single gateway that can switch routing targets (frontier and open-weight models) without touching FunClip configuration.
Validation
python3 -m pytest -q tests/test_openai_api.py tests/test_minimax_api.py tests/test_minimax_launch_integration.py tests/test_orcarouter_api.py tests/test_orcarouter_launch_integration.py→ 18 passedpython3 -m py_compile funclip/launch.py funclip/videoclipper.py funclip/utils/subtitle_utils.py funclip/llm/openai_api.py→ OKgit diff --check→ cleantwelvelabs/gradio) identical on cleanmain; zero regressions.openai_call()code path →orcarouter/auto→https://api.orcarouter.ai/v1/chat/completions→ 200ORCA-LIVE-OK;_resolve_model_config("orcarouter/auto")resolves base_urlhttps://api.orcarouter.ai/v1and preserves the full model ID.Screenshots or clips
No UI visuals — the change adds dropdown entries and a routing branch. The dropdown now lists
orcarouter/auto,orcarouter/fusion,orcarouter/fusion-flash,orcarouter/fusion-mini.Notes for reviewers
orcarouter/prefix (a bareautois not routable), so unlike AtlasCloud/MiniMax the prefix is intentionally preserved in the wire request.Disclosure: I'm an engineer on the OrcaRouter team.