feat: add OrcaRouter as a first-class provider - #85
Open
putraperdana1207-pixel wants to merge 1 commit into
Open
feat: add OrcaRouter as a first-class provider#85putraperdana1207-pixel wants to merge 1 commit into
putraperdana1207-pixel wants to merge 1 commit into
Conversation
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>
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.
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
orcarouteras 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: resolveorcarouter/<model>through LiteLLM like the existinglitellm/provider pattern (used today for Anthropic and Gemini), but bindORCAROUTER_API_KEYand thehttps://api.orcarouter.ai/v1base URL explicitly, since OrcaRouter has its own credential namespace. Non-OrcaRouter resolution is unchanged. Also addsis_orcarouter_provider()for agent settings that branch on the provider..env.example: documentORCAROUTER_API_KEYunder the provider section and add aDEFAULT_MODEL=orcarouter/<model>example.README.md: listORCAROUTER_API_KEYas an alternative primary provider.tests/test_config.py: unit tests covering bare-model passthrough,orcarouter/routing to LiteLLM with the gateway credentials, and unchangedlitellm// bareprovider/modelbehavior.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.pyorcarouter/route (config.get_default_model()withDEFAULT_MODEL=orcarouter/gpt-5.6-luna) hithttps://api.orcarouter.ai/v1and returned a completion.Questions or feedback welcome — Discord: discord.gg/YEubt8enRA · X: https://x.com/OrcaRouter
I'm an engineer on the OrcaRouter team.