Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,25 @@ llm = OpenAIChat(

</details>

<details>
<summary><b>Using with OrcaRouter</b></summary>

[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"
)
```

</details>


### Command Line Interface

Expand Down Expand Up @@ -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
Expand All @@ -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`).

</details>

<details>
Expand Down
29 changes: 29 additions & 0 deletions README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,25 @@ llm = OpenAIChat(

</details>

<details>
<summary><b>使用 OrcaRouter</b></summary>

[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"
)
```

</details>


### 命令行界面

Expand Down Expand Up @@ -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
Expand All @@ -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`)。

</details>

<details>
Expand Down
2 changes: 2 additions & 0 deletions src/sirchmunk/llm/openai_chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -96,6 +97,7 @@ class _ProviderProfile:
("cohere", "cohere"),
("baichuan-ai.com", "baichuan"),
("minimax", "minimax"),
("orcarouter.ai", "orcarouter"),
]

_DEFAULT_PROFILE = _ProviderProfile("generic")
Expand Down