Skip to content

feat(orcarouter): add OrcaRouter chat model component - #953

Open
Marc-oss-hub wants to merge 1 commit into
cloudwego:mainfrom
Marc-oss-hub:feat/orcarouter-component
Open

feat(orcarouter): add OrcaRouter chat model component#953
Marc-oss-hub wants to merge 1 commit into
cloudwego:mainfrom
Marc-oss-hub:feat/orcarouter-component

Conversation

@Marc-oss-hub

Copy link
Copy Markdown

What does this PR do?

Adds a new components/model/orcarouter provider component to eino-ext — an OrcaRouter implementation of model.ChatModel (and model.ToolCallingChatModel), mirroring the existing components/model/openrouter wiring.

OrcaRouter is an AI gateway that serves OpenAI-compatible (/v1/chat/completions), Anthropic-compatible (/v1/messages) and embedding endpoints from one base URL, with namespaced model ids (anthropic/claude-sonnet-5, anthropic/claude-haiku-4.5, …). 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

  • components/model/orcarouter/chatmodel.go — thin wrapper over the shared eino-ext/libs/acl/openai client, with defaultBaseURL = https://api.orcarouter.ai/v1, namespaced model ids, and standard sampling parameters (temperature, top_p, max_tokens, stop, seed, …).
  • components/model/orcarouter/chatmodel_test.go — 8 unit tests (config validation, default base URL, Generate, streaming, tool calling, forced tools, reasoning_content passthrough for Anthropic thinking models).
  • components/model/orcarouter/examples/chat/main.go — runnable chat-completion example.
  • components/model/orcarouter/README.md / README_zh.md, go.mod / go.sum — standalone module (same go 1.18 + eino v0.7.13 / acl/openai v0.1.17 dependency set as the openrouter component).

Verification

  • go build ./... and go vet ./... clean; go test ./... — all 8 tests pass (Go 1.25.6, the version used by this repo's CI).
  • Live check against the real gateway through the component's own code path: Generate against https://api.orcarouter.ai/v1 (anthropic/claude-haiku-4.5) returns ORCA-OK; Stream returns STREAM-OK.

Type of change

  • Bug fix
  • New feature
  • Docs
  • Refactor / chore

Checklist

  • I have read the Contributing Guide
  • I tested this change locally
  • Code comments and docs are in English
  • Linked related issue (if any): closes #

I'm an engineer on the OrcaRouter team.

Add components/model/orcarouter, a new standalone module that wraps the
shared eino-ext libs/acl/openai client with OrcaRouter's default endpoint
(https://api.orcarouter.ai/v1) and namespaced model ids
(anthropic/claude-sonnet-5, anthropic/claude-haiku-4.5).

Implements model.ChatModel and model.ToolCallingChatModel: Generate,
Stream, tool calling, and reasoning_content passthrough for Anthropic
thinking models served by OrcaRouter. Includes unit tests, a chat
example, and README.md / README_zh.md.

Co-Authored-By: Claude <noreply@anthropic.com>
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants