Skip to content

feat: add OrcaRouter as a first-class provider - #85

Open
putraperdana1207-pixel wants to merge 1 commit into
VRSEN:mainfrom
putraperdana1207-pixel:feat/orcarouter-provider
Open

feat: add OrcaRouter as a first-class provider#85
putraperdana1207-pixel wants to merge 1 commit into
VRSEN:mainfrom
putraperdana1207-pixel:feat/orcarouter-provider

Conversation

@putraperdana1207-pixel

Copy link
Copy Markdown

Reason: Add OrcaRouter as a first-class provider so the swarm can run on the OrcaRouter OpenAI-compatible AI gateway. OrcaRouter is an OpenAI-compatible AI gateway built for both models and agents. Like OpenRouter, it exposes a provider/model namespace across many models — but it also combines adaptive routing, automatic failover, zero-markup inference, observability, guardrails, and agent-tool governance behind the same endpoint. Adding orcarouter as a named provider means OpenSwarm users can use that stack directly, without treating OrcaRouter as an anonymous custom base URL. 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

  • config.py: resolve orcarouter/<model> through LiteLLM like the existing litellm/ provider pattern (used today for Anthropic and Gemini), but bind ORCAROUTER_API_KEY and the https://api.orcarouter.ai/v1 base URL explicitly, since OrcaRouter has its own credential namespace. Non-OrcaRouter resolution is unchanged. Also adds is_orcarouter_provider() for agent settings that branch on the provider.
  • .env.example: document ORCAROUTER_API_KEY under the provider section and add a DEFAULT_MODEL=orcarouter/<model> example.
  • README.md: list ORCAROUTER_API_KEY as an alternative primary provider.
  • tests/test_config.py: unit tests covering bare-model passthrough, orcarouter/ routing to LiteLLM with the gateway credentials, and unchanged litellm/ / bare provider/model behavior.

Checks

  • python -m pytest tests/ — 13 passed, 4 subtests passed (full suite, including the pre-existing Slides model routing tests)
  • python -m py_compile config.py
  • Live call through the new orcarouter/ route (config.get_default_model() with DEFAULT_MODEL=orcarouter/gpt-5.6-luna) hit https://api.orcarouter.ai/v1 and returned a completion.

Questions or feedback welcome — Discord: discord.gg/YEubt8enRA · X: https://x.com/OrcaRouter

I'm an engineer on the OrcaRouter team.

Add orcarouter/ model prefix routing in config.py so DEFAULT_MODEL
can point the whole swarm at the OrcaRouter OpenAI-compatible gateway.
Mirrors the existing litellm/ provider pattern but binds ORCAROUTER_API_KEY
and the gateway base URL explicitly, since OrcaRouter has its own
credential namespace.

Includes unit tests, .env.example docs, and a README entry.

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant