Skip to content

feat: add OrcaRouter as an LLM provider - #128

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

feat: add OrcaRouter as an LLM provider#128
Marc-oss-hub wants to merge 1 commit into
strnad:mainfrom
Marc-oss-hub:feat/orcarouter-provider

Conversation

@Marc-oss-hub

Copy link
Copy Markdown

Overview

Adds OrcaRouter as a named LLM provider in CrewAI Studio's provider picker and in the single-page export template, mirroring the existing LM Studio and Xai wiring. OrcaRouter is an OpenAI-compatible model routing gateway that exposes models from OpenAI, Anthropic, Google and other providers behind one endpoint and one API key. 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.

What this adds

  • app/llms.py: ORCAROUTER_API_KEY in the env vars loaded from .env, a new create_orcarouter_llm() factory (ChatOpenAI pointed at https://api.orcarouter.ai/v1), and an OrcaRouter entry in LLM_CONFIG with namespaced model ids (orcarouter/auto, openai/gpt-5.5, anthropic/claude-sonnet-5).
  • app/pg_export_crew.py: the same create_orcarouter_llm() factory and OrcaRouter entry in the EXPORT_LLMS_PY template so exported single-page apps keep the provider, plus the ORCAROUTER_API_KEY line in the generated .env.
  • .env_example: documented ORCAROUTER_API_KEY.
  • README.md: OrcaRouter added to the supported providers list.

Why a named provider

CrewAI Studio already ships named providers for OpenAI, Groq, Anthropic, Ollama, Grok and LM Studio, each with its own factory and env key. OrcaRouter is the same shape (an OpenAI-compatible gateway), so it gets a discoverable named slot in the dropdown instead of asking users to hand-edit an OpenAI-compatible base URL. The namespaced model ids matter here: the gateway rejects bare model names, so shipping orcarouter/auto as the first preset makes the provider work out of the box.

Files changed

File Change
app/llms.py env var + create_orcarouter_llm + LLM_CONFIG entry
app/pg_export_crew.py export template factory + LLM_CONFIG entry + generated .env line
.env_example ORCAROUTER_API_KEY
README.md provider list

How to use it

  1. Set ORCAROUTER_API_KEY in your .env.
  2. Pick OrcaRouter in the LLM provider dropdown.
  3. Choose a model id such as orcarouter/auto, openai/gpt-5.5 or anthropic/claude-sonnet-5.

Validation

  • python -m py_compile app/llms.py app/pg_export_crew.py — clean.
  • pytest tests/test_tool_ids.py — 21 passed.
  • Live test of the exact create_orcarouter_llm path (ChatOpenAI with a real ORCAROUTER_API_KEY against https://api.orcarouter.ai/v1): orcarouter/auto, openai/gpt-5.5 and anthropic/claude-sonnet-5 all returned model responses.

I'm an engineer on the OrcaRouter team.

Add OrcaRouter as a named provider in the Studio LLM picker and in the
single-page export template (app/pg_export_crew.py), mirroring the
existing LM Studio / Xai wiring. OrcaRouter is an OpenAI-compatible
gateway at https://api.orcarouter.ai/v1 with namespaced model ids, so
the provider uses ChatOpenAI with its base URL and the models are
prefixed (orcarouter/auto, openai/gpt-5.5, anthropic/claude-sonnet-5).

Includes ORCAROUTER_API_KEY in .env_example, the exported app's .env,
and the README provider list.

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