feat: add OrcaRouter as a first-class provider in the LiteLLM backend - #1367
Open
kuswardhanietidims-svg wants to merge 1 commit into
Open
feat: add OrcaRouter as a first-class provider in the LiteLLM backend#1367kuswardhanietidims-svg wants to merge 1 commit into
kuswardhanietidims-svg wants to merge 1 commit into
Conversation
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 first-class provider in the LiteLLM backend
Lighteval's
lighteval endpoint litellmbackend already treats a few gateways as named providers (OpenRouter gets special handling inlitellm_model.pyfor context-length estimation). This PR adds OrcaRouter the same way: a first-classorcarouterprovider, instead of making users point an anonymousbase_urlat it.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.
Changes
src/lighteval/models/endpoints/litellm_model.pyLiteLLMModelConfig+LiteLLMClient: whenprovider="orcarouter"and nobase_urlis given, default tohttps://api.orcarouter.ai/v1(mirrors how OpenRouter is wired through the same backend).__call_api: route OrcaRouter completions through litellm as an OpenAI-compatible endpoint (custom_llm_provider="openai"), keeping theorcarouter/...model prefix for model selection._estimate_orcarouter_context_length: fetch the model context length from OrcaRouter's/models/{id}API, mirroring the existing OpenRouter context-length estimation.max_length: use the OrcaRouter estimator whenprovider="orcarouter".examples/model_configs/orcarouter_litellm_model.yaml: example config showing theorcarouterprovider in use.Validation
ruff format --check .andruff check .pass on the whole repo.provider=orcarouter,model_name=orcarouter/fusion-flash): chat completion returned a normal response and the context-length lookup returned200000.Usage
lighteval endpoint litellm "provider=orcarouter,model_name=orcarouter/fusion-flash" gsm8kI'm an engineer on the OrcaRouter team.
Discord: discord.gg/YEubt8enRA · X: https://x.com/OrcaRouter