Skip to content

Add OpenRouter support to litellm_model_interface#23

Draft
Copilot wants to merge 4 commits intomainfrom
copilot/add-openrouter-support
Draft

Add OpenRouter support to litellm_model_interface#23
Copilot wants to merge 4 commits intomainfrom
copilot/add-openrouter-support

Conversation

Copy link
Contributor

Copilot AI commented Jan 15, 2026

Adds OpenRouter as a supported provider in the litellm inference module.

Changes

  • Added openrouter_api_key field to LiteLLMInferenceModelConfig
  • Set OPENROUTER_API_KEY environment variable in set_os_env()
  • Improved env var handling to only set when keys are non-empty (prevents overwriting existing vars)
  • Added test coverage for OpenRouter configuration

Usage

config = LiteLLMInferenceModelConfig(
    model_name="openrouter/anthropic/claude-2",
    openrouter_api_key="sk-or-v1-..."
)
model = LiteLLMInferenceModel(config)

Models follow the openrouter/provider/model format per litellm convention.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • docs.litellm.ai
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>litellm_model_interface miss openrouter support</issue_title>
<issue_description>Add openrouter support to litellm module:

  • just need to add the api key, then the models are accessed with openrouter/model_provider/model_name </issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits January 15, 2026 13:36
Co-authored-by: francescortu <90980154+francescortu@users.noreply.github.com>
Co-authored-by: francescortu <90980154+francescortu@users.noreply.github.com>
Co-authored-by: francescortu <90980154+francescortu@users.noreply.github.com>
Copilot AI changed the title [WIP] Add openrouter support to litellm module Add OpenRouter support to litellm_model_interface Jan 15, 2026
Copilot AI requested a review from francescortu January 15, 2026 13:40
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.

litellm_model_interface miss openrouter support

2 participants