feat(llm): add OrcaRouter as a named OpenAI-compatible gateway - #205
Open
XiaoHuo888-hue wants to merge 1 commit into
Open
feat(llm): add OrcaRouter as a named OpenAI-compatible gateway#205XiaoHuo888-hue wants to merge 1 commit into
XiaoHuo888-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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.