Skip to content

feat(ai): add OrcaRouter as a named OpenAI-compatible preset - #194

Open
XiaoHuo888-hue wants to merge 1 commit into
shy3130:mainfrom
XiaoHuo888-hue:add-orcarouter-provider
Open

feat(ai): add OrcaRouter as a named OpenAI-compatible preset#194
XiaoHuo888-hue wants to merge 1 commit into
shy3130:mainfrom
XiaoHuo888-hue:add-orcarouter-provider

Conversation

@XiaoHuo888-hue

Copy link
Copy Markdown

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, model orcarouter/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 covering normalize_openai_base_url for the OrcaRouter gateway (/v1 preserved, root gateway gets /v1 appended, full /v1/chat/completions normalized) and confirming OrcaRouter runs through the openai_compat (non-Codex) path.

Compatibility

The backend already routes any openai_compat provider through a configurable base_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.py19 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.
  • Live test: POST https://api.orcarouter.ai/v1/chat/completions with model=orcarouter/auto returned HTTP 200 and content "hello world" (finish_reason stop), 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.

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant