feat: Add OrcaRouter as a supported LLM provider - #231
Open
clementguarino06510-glitch wants to merge 1 commit into
Open
feat: Add OrcaRouter as a supported LLM provider#231clementguarino06510-glitch wants to merge 1 commit into
clementguarino06510-glitch wants to merge 1 commit into
Conversation
Mirror the existing OpenAI provider wiring so the GenAI Stack can use OrcaRouter models through the same LangChain ChatOpenAI integration. Set LLM=orcarouter/<model> (for example orcarouter/fusion-mini) and add ORCAROUTER_API_KEY to the .env file. Live-tested against the OrcaRouter API (HTTP 200). Signed-off-by: clementguarino06510-glitch <clementguarino06510-glitch@users.noreply.github.com> Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: clementguarino06510-glitch <clementguarino06510-glitch@users.noreply.github.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.
Add OrcaRouter as a supported LLM provider
The GenAI Stack connects to OpenAI through LangChain's
ChatOpenAIinchains.py, and to Bedrock throughChatBedrockand Ollama throughChatOllama. OrcaRouter speaks the same OpenAI-compatible protocol onhttps://api.orcarouter.ai/v1, so this PR wires it in as a first-class provider using the exact sameChatOpenAIintegration — no custom base URL juggling, no generic any-endpoint passthrough.What's added
chains.py— a new named branch inload_llm(): anyLLM=orcarouter/<model>(e.g.orcarouter/fusion-mini) is routed toChatOpenAIpointed at the OrcaRouter base URL, mirroring the existing OpenAI case directly above it.api.py,bot.py,pdf_bot.py— readORCAROUTER_BASE_URLandORCAROUTER_API_KEYfrom the environment and pass them intoload_llm()'s config, exactly likeOLLAMA_BASE_URLis threaded through today.docker-compose.yml— forwardORCAROUTER_BASE_URL(defaulthttps://api.orcarouter.ai/v1) andORCAROUTER_API_KEYto thebot,pdf_bot, andapiservices, alongside the existingOPENAI_API_KEY/OLLAMA_BASE_URLentries.env.example— a new OrcaRouter section documenting both variables.readme.md— documentedORCAROUTER_BASE_URL/ORCAROUTER_API_KEYin the env table and added a note under LLM Configuration.Why OrcaRouter
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 first-class provider means this project's 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.
Verification
python -m py_compilepasses on all changed Python files;docker-compose.ymlparses cleanly.load_llm()path with a real key againsthttps://api.orcarouter.ai/v1—LLM=orcarouter/fusion-minireturns HTTP 200 and a valid completion.To try it: set
LLM=orcarouter/fusion-miniandORCAROUTER_API_KEY=sk-orca-...in your.env, thendocker compose up.I'm an engineer on the OrcaRouter team.
Discord: discord.gg/YEubt8enRA · X: https://x.com/OrcaRouter