feat(as_llm): add named OrcaRouter provider - #462
Open
XiaoHuo888-hue wants to merge 1 commit into
Open
Conversation
Add an OrcaRouter chat-model provider alongside the existing OpenAI-compatible wrappers. OrcaRouter is an OpenAI-compatible gateway at https://api.orcarouter.ai/v1; users can now select it with LLM_BACKEND=orcarouter instead of pointing an OpenAI wrapper at a custom base_url. - OrcaRouterCredential: subclass of OpenAICredential with a default base_url of https://api.orcarouter.ai/v1 and an empty-string fallback for the shared ${LLM_BASE_URL:-} config key - OrcaRouterAsLLM: registered as backend "orcarouter" in the as_llm registry - docs: README (en/zh), quick start (en/zh), example.env - tests: unit coverage for registration, defaults, and fallback behavior Live-verified against the OrcaRouter chat/completions endpoint with model orcarouter/auto. Signed-off-by: XiaoHuo888-hue <jinhao.song@myflashcloud.com>
|
XiaoHuo888-hue seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
Member
|
Thank you for the contribution and for providing tests and documentation. Could you clarify why a dedicated LLM_BACKEND=openai
LLM_MODEL_NAME=orcarouter/auto
LLM_API_KEY=sk-orca-...
LLM_BASE_URL=https://api.orcarouter.ai/v1Thanks again! |
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 a named OrcaRouter provider to the
as_llmcomponent registry, mirroring the existing OpenAI-compatible wrappers.OrcaRouter is an OpenAI-compatible gateway (base URL
https://api.orcarouter.ai/v1). Until now, ReMe users could only reach it by repurposing theopenaibackend with a customLLM_BASE_URLand a non-obviousmodelvalue. This PR registers a first-classorcarouterbackend so the provider is visible and selectable by name:LLM_BASE_URLstays optional and defaults tohttps://api.orcarouter.ai/v1.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
reme/components/as_llm/__init__.pyOrcaRouterCredential:OpenAICredentialsubclass with a defaultbase_urlofhttps://api.orcarouter.ai/v1and an empty-string fallback, so the sharedbase_url: ${LLM_BASE_URL:-}config key works without forcing users to setLLM_BASE_URL.OrcaRouterAsLLM: registered as backendorcarouterin the built-in component registry.README.md,README_ZH.md,docs/en/quick_start.md,docs/zh/quick_start.md,example.env: document the new backend.tests/unit/test_orcarouter_provider.py: registration, default, fallback, and custom-base-url coverage.Verification
pytest tests/unit→ 1078 passed (2 pre-existing failures intest_codex_agent_wrapper.pyreproduce on cleanmain; they are sandbox-environment issues with the Codex MCP stdio bridge, unrelated to this change).OrcaRouterAsLLMwith a real OrcaRouter key and hithttps://api.orcarouter.ai/v1/chat/completionswith modelorcarouter/auto; the provider returned a valid completion.Disclosure: I'm an engineer on the OrcaRouter team.