feat(openai): add with_orcarouter LLM factory for OrcaRouter - #6869
Open
Marc-oss-hub wants to merge 1 commit into
Open
feat(openai): add with_orcarouter LLM factory for OrcaRouter#6869Marc-oss-hub wants to merge 1 commit into
Marc-oss-hub wants to merge 1 commit into
Conversation
Mirror the OpenRouter wiring for OrcaRouter (https://www.orcarouter.ai), an OpenAI-compatible LLM routing gateway. Adds LLM.with_orcarouter() with the ORCAROUTER_API_KEY env var, base URL https://api.orcarouter.ai/v1, and HTTP-Referer/X-Title attribution headers. Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Marc-oss-hub <sjh668899@outlook.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.
Summary
Adds a
LLM.with_orcarouter()factory method to thelivekit-plugins-openaiplugin, mirroring the existingwith_openrouter()wiring for OrcaRouter, an OpenAI-compatible LLM routing gateway.ORCAROUTER_API_KEYenvironment variable (or accepts an explicitapi_key)base_urltohttps://api.orcarouter.ai/v1andmodeltoorcarouter/autoHTTP-Referer/X-Titleattribution headers whensite_url/app_nameare provided, matching the OpenRouter factoryprovider,fallback_models,plugins), which OrcaRouter does not supportAlso updates the package docstring's OpenAI-compatible provider list to include OrcaRouter.
Verification
ruff format --checkandruff checkpass (pinnedruff==0.15.22)mypy --platform linux -p livekit.plugins.openaireports no issues (the repo's CI gate)LLM.with_orcarouter().chat(...)returnedORCAROUTER_OKDisclosure
I'm an engineer on the OrcaRouter team.
This change only adds a new factory method and a docstring line; no existing behavior is modified. No credentials or secrets are involved in the diff.