feat(llm): register OrcaRouter in the provider profile system - #174
Open
XiaoHuo888-hue wants to merge 1 commit into
Open
feat(llm): register OrcaRouter in the provider profile system#174XiaoHuo888-hue wants to merge 1 commit into
XiaoHuo888-hue wants to merge 1 commit into
Conversation
Add OrcaRouter as a named provider profile in OpenAIChat's capability negotiation. OrcaRouter (https://www.orcarouter.ai) is an OpenAI-compatible router exposing 200+ models behind a single API key; model ids use its own provider/model format (e.g. openai/gpt-4o). It already worked through the generic OpenAI-compatible path (LLM_BASE_URL), but a named profile makes it first-class in provider auto-detection: the base URL https://api.orcarouter.ai/v1 is recognized and stream_options negotiation applies the generic-safe defaults (stream_options enabled, no thinking param). - src/sirchmunk/llm/openai_chat.py: add "orcarouter" to _PROVIDERS and ("orcarouter.ai", "orcarouter") to _URL_PATTERNS. - README.md / README_zh.md: list OrcaRouter in the supported providers, add an env config example, and a "Using with OrcaRouter" Python SDK example. Co-Authored-By: Claude <noreply@anthropic.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.
What
Registers OrcaRouter as a named provider in Sirchmunk's capability
negotiation, alongside the existing named providers (DeepSeek, MiniMax,
SiliconFlow, etc.).
OrcaRouter (https://www.orcarouter.ai) is an
OpenAI-compatible router exposing 200+ models (OpenAI, Anthropic, Google,
DeepSeek, ...) behind a single API key. Model ids use the router's own
provider/modelformat (e.g.openai/gpt-4o). It already worked throughthe generic OpenAI-compatible path (
LLM_BASE_URL), and this change makesit first-class:
src/sirchmunk/llm/openai_chat.py: added"orcarouter"to the_PROVIDERScapability profiles and("orcarouter.ai", "orcarouter")to_URL_PATTERNS, so a base URL ofhttps://api.orcarouter.ai/v1isauto-detected and negotiated with the generic-safe profile
(
stream_optionsenabled, no thinking parameter).providers, added an env config example (
LLM_BASE_URL,LLM_API_KEY,LLM_MODEL_NAME), and a "Using with OrcaRouter" Python SDK example.Why
OrcaRouter users previously had to type the endpoint manually into the
generic OpenAI-compatible path. A named profile presets the endpoint,
correctly negotiates streaming options, and surfaces OrcaRouter in the
documented provider list — the same treatment the other named providers get.
How to Test
OpenAIChat(api_key="sk-orca-...", base_url="https://api.orcarouter.ai/v1", model="openai/gpt-4o").chat(...)returns "hello from orcarouter" (non-streaming and streaming, with usage).
OpenAIChat._detect_provider("https://api.orcarouter.ai/v1")returns the
orcarouterprofile.uvx --from ruff@0.8.4 ruff check src/sirchmunk/llm/openai_chat.py— clean.Related Issue
None.
Checklist
py_compileclean; provider registration + detection verifiedOpenAIChat, both return usage)ruff(repo-pinned v0.8.4) clean on the changed fileblack— note: the changed file is not black-formatted atmain(pre-existing, whole file), so the diff matches the file's existing
alignment style rather than reformatting the file.