From 3b684f28aed86b81b29aec3d29cb177a33043e88 Mon Sep 17 00:00:00 2001 From: XiaoHuo888 Date: Tue, 18 Aug 2026 10:58:58 +0800 Subject: [PATCH] feat(llm): register OrcaRouter in the provider profile system 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 --- README.md | 29 +++++++++++++++++++++++++++++ README_zh.md | 29 +++++++++++++++++++++++++++++ src/sirchmunk/llm/openai_chat.py | 2 ++ 3 files changed, 60 insertions(+) diff --git a/README.md b/README.md index 6f6b5f37..36d2602f 100644 --- a/README.md +++ b/README.md @@ -301,6 +301,25 @@ llm = OpenAIChat( +
+Using with OrcaRouter + +[OrcaRouter](https://www.orcarouter.ai) is an OpenAI-compatible router exposing +200+ models behind a single API key. Model ids use the router's own +`provider/model` format, e.g. `openai/gpt-4o`: + +```python +from sirchmunk.llm import OpenAIChat + +llm = OpenAIChat( + api_key="sk-orca-...", + base_url="https://api.orcarouter.ai/v1", + model="openai/gpt-4o" # or "openai/gpt-4o-mini" / "deepseek/deepseek-v4-flash" +) +``` + +
+ ### Command Line Interface @@ -1089,6 +1108,7 @@ Sirchmunk takes an **indexless approach**: Any OpenAI-compatible API endpoint, including (but not limited to): - OpenAI (GPT-5.2, ...) - [MiniMax](https://platform.minimax.io) (MiniMax-M3, MiniMax-M2.7, MiniMax-M2.7-highspeed) +- [OrcaRouter](https://www.orcarouter.ai) (openai/gpt-4o, openai/gpt-4o-mini, deepseek/deepseek-v4-flash, ...) - DeepSeek, Moonshot, Mistral, Groq, Together AI, Cohere - Google Gemini, Zhipu (GLM), Baichuan, Yi, SiliconFlow, Volcengine - Azure OpenAI @@ -1104,6 +1124,15 @@ LLM_MODEL_NAME=MiniMax-M3 For more details, see [MiniMax OpenAI-Compatible API](https://platform.minimax.io/docs/api-reference/text-openai-api). +To use OrcaRouter, configure: +```bash +LLM_BASE_URL=https://api.orcarouter.ai/v1 +LLM_API_KEY=your-orcarouter-api-key +LLM_MODEL_NAME=openai/gpt-4o +``` + +OrcaRouter exposes 200+ models (OpenAI, Anthropic, Google, DeepSeek, ...) behind a single API key; model ids use the router's own `provider/model` format (e.g. `openai/gpt-4o`, `deepseek/deepseek-v4-flash`). +
diff --git a/README_zh.md b/README_zh.md index 9b1b2ea0..c54ac238 100644 --- a/README_zh.md +++ b/README_zh.md @@ -299,6 +299,25 @@ llm = OpenAIChat(
+
+使用 OrcaRouter + +[OrcaRouter](https://www.orcarouter.ai) 是 OpenAI 兼容路由器,一个 API key 即可 +访问 200+ 模型。模型 id 使用路由器自身的 `provider/model` 格式,例如 +`openai/gpt-4o`: + +```python +from sirchmunk.llm import OpenAIChat + +llm = OpenAIChat( + api_key="sk-orca-...", + base_url="https://api.orcarouter.ai/v1", + model="openai/gpt-4o" # 或 "openai/gpt-4o-mini" / "deepseek/deepseek-v4-flash" +) +``` + +
+ ### 命令行界面 @@ -1087,6 +1106,7 @@ Sirchmunk 采用 **无索引** 方法: 任何 OpenAI 兼容 API 端点,包括但不限于: - OpenAI(GPT-5.2, ...) - [MiniMax](https://platform.minimax.io)(MiniMax-M3、MiniMax-M2.7、MiniMax-M2.7-highspeed) +- [OrcaRouter](https://www.orcarouter.ai)(openai/gpt-4o、openai/gpt-4o-mini、deepseek/deepseek-v4-flash、...) - DeepSeek、Moonshot、Mistral、Groq、Together AI、Cohere - Google Gemini、智谱(GLM)、百川、零一万物、硅基流动、火山引擎 - Azure OpenAI @@ -1103,6 +1123,15 @@ LLM_MODEL_NAME=MiniMax-M3 详见 [MiniMax OpenAI 兼容 API 文档](https://platform.minimax.io/docs/api-reference/text-openai-api)。 +使用 OrcaRouter 的配置示例: +```bash +LLM_BASE_URL=https://api.orcarouter.ai/v1 +LLM_API_KEY=your-orcarouter-api-key +LLM_MODEL_NAME=openai/gpt-4o +``` + +OrcaRouter 一个 API key 即可访问 200+ 模型(OpenAI、Anthropic、Google、DeepSeek 等);模型 id 使用路由器自身的 `provider/model` 格式(如 `openai/gpt-4o`、`deepseek/deepseek-v4-flash`)。 +
diff --git a/src/sirchmunk/llm/openai_chat.py b/src/sirchmunk/llm/openai_chat.py index 05874df8..698b5f70 100644 --- a/src/sirchmunk/llm/openai_chat.py +++ b/src/sirchmunk/llm/openai_chat.py @@ -74,6 +74,7 @@ class _ProviderProfile: "groq": _ProviderProfile("groq"), "cohere": _ProviderProfile("cohere"), "minimax": _ProviderProfile("minimax"), + "orcarouter": _ProviderProfile("orcarouter"), } # URL substring → provider name. More specific patterns must precede less @@ -96,6 +97,7 @@ class _ProviderProfile: ("cohere", "cohere"), ("baichuan-ai.com", "baichuan"), ("minimax", "minimax"), + ("orcarouter.ai", "orcarouter"), ] _DEFAULT_PROFILE = _ProviderProfile("generic")