feat(ai): add OrcaRouter as a named OpenAI-compatible preset - #194
Open
XiaoHuo888-hue wants to merge 1 commit into
Open
feat(ai): add OrcaRouter as a named OpenAI-compatible preset#194XiaoHuo888-hue wants to merge 1 commit into
XiaoHuo888-hue wants to merge 1 commit into
Conversation
Add OrcaRouter to the AI quick-preset list in the settings page so it can be configured with one click (base_url https://api.orcarouter.ai/v1, model orcarouter/auto). The backend already routes any openai_compat provider through base_url, so no transport changes are needed. Also document the OrcaRouter endpoint in README, docs/configuration.md, and .env.example, and add unit tests covering base_url normalization for the OrcaRouter gateway. 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
Add OrcaRouter as a named OpenAI-compatible preset in the AI settings page. Users can now configure OrcaRouter with one click (base_url
https://api.orcarouter.ai/v1, modelorcarouter/auto) instead of manually filling in the OpenAI-compatible endpoint.OrcaRouter is a gateway that aggregates frontier models behind a single OpenAI-compatible endpoint. 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.
Changes
frontend/src/pages/settings/AI.tsx: add an OrcaRouter entry to the AI quick-preset list, mirroring the existing DeepSeek / Qwen / GLM / Kimi presets (pre-fills API address, model, and website link).docs/configuration.md: document the OrcaRouter endpoint in the AI section.README.md: mention OrcaRouter in the AI tech-stack row..env.example: add a commented OrcaRouter config example.backend/tests/test_ai_provider.py: add unit tests coveringnormalize_openai_base_urlfor the OrcaRouter gateway (/v1preserved, root gateway gets/v1appended, full/v1/chat/completionsnormalized) and confirming OrcaRouter runs through theopenai_compat(non-Codex) path.Compatibility
The backend already routes any
openai_compatprovider through a configurablebase_url, so no transport or persistence changes are needed. Existing AI configs are unaffected; the OrcaRouter preset is purely additive.Verification
python3 -m pytest tests/test_ai_provider.py→ 19 passed (incl. 2 new tests).python3 -m ruff check tests/test_ai_provider.py→ all checks passed.pnpm build(frontend,tsc -b && vite build) → clean build.git diff --check→ clean.POST https://api.orcarouter.ai/v1/chat/completionswithmodel=orcarouter/autoreturned HTTP 200 and content"hello world"(finish_reasonstop), confirming the documented endpoint/model work end-to-end.Risk & Rollback
No hot-path or data changes. Rollback is a revert of the preset row and docs.
Disclosure: I'm an engineer on the OrcaRouter team.