Skip to content

feat: Add compatibility for Openrouter Endpoints #69

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 23 commits into
base: main
Choose a base branch
from

Conversation

akshaypardhanani
Copy link

@akshaypardhanani akshaypardhanani commented Aug 12, 2025

Overview

Changes here:

  1. Add OpenRouter API support alongside existing OpenAI compatibility.
  2. Add uv as a package and environment manager

Key Features

  1. OpenRouter API Integration
    Open router can be called through the OpenAI sdk. We set the base url to the openrouter endpoint to enable this.
    This enables multiple models that can be used. Through the development of the changes I have tested with the following:
  • Qwen3 coder: Openrouter model is qwen/qwen3-coder:free
  • Kimi dev: Openrouter model is moonshotai/kimi-dev-72b:free
  • GLM z1 32B: Openrouter model is thudm/glm-z1-32b:free 👈 this is not available for free anymore
  1. API Key Management
    Created amadeusgpt/utils/api_key_util.py for centralized API key handling
    Supports OPENAI_API_KEY, and OPENROUTER_API_KEY, to be specified as environment variables

Testing

  • Tested out the package through the notebooks. I have added version suffixed with _openrouter to replicate the existing demos with an openrouter API KEY
  • Tested manually via the streamlit app - This was breaking due to a compatibility mismatch between the latest version(s) of streamlit and streamlit-drawable-canvas (which is now archived and read only). As a result I minimally cloned it locally to be used as a local module.
  • Ran unit tests in the tests folder - Tests with SuperAnimal in the test_superanimal.py suite are not fully tested yet since they use a vision language model (to my understanding) I am working on the fixes needed to get that working (which is why I am marking this Pull request as Draft for now).

akshaypardhanani and others added 23 commits August 4, 2025 21:18
…notebooks

Feat/add openrouter demo notebooks
…t-working

Fix/streamlit examples not working
@akshaypardhanani akshaypardhanani marked this pull request as ready for review August 13, 2025 20:27
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