Skip to content

feat: Allow configuring OpenRouter API base via openrouter_api_base s…#381

Merged
crmne merged 2 commits intocrmne:mainfrom
graysonchen:feature/add_openrouter_api_base
Mar 2, 2026
Merged

feat: Allow configuring OpenRouter API base via openrouter_api_base s…#381
crmne merged 2 commits intocrmne:mainfrom
graysonchen:feature/add_openrouter_api_base

Conversation

@graysonchen
Copy link
Contributor

@graysonchen graysonchen commented Sep 1, 2025

image

What this does

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Performance improvement

Scope check

  • I read the Contributing Guide
  • This aligns with RubyLLM's focus on LLM communication
  • This isn't application-specific logic that belongs in user code
  • This benefits most users, not just my specific use case

Quality check

  • I ran overcommit --install and all hooks pass
  • I tested my changes thoroughly
  • I updated documentation if needed
  • I didn't modify auto-generated files manually (models.json, aliases.json)

API changes

  • Breaking change
  • New public methods/classes
  • Changed method signatures
  • No API changes

Related issues

@crmne
Copy link
Owner

crmne commented Sep 1, 2025

Why?

@graysonchen
Copy link
Contributor Author

Hey @crmne Yep, for integrate Cloudflare AI Gateway

With this, we can quickly pinpoint issues and access logs.
image

@crmne
Copy link
Owner

crmne commented Sep 3, 2025

I see. Since it's OpenAI compatible, instead of adding another configuration option to the library, can't you do the following and use the OpenAI provider instead?

RubyLLM.configure do |config|
  config.openai_api_base = '<cloudflare api gateway url>'
  config.openai_use_system_role = true
end

@crmne crmne merged commit e0d6595 into crmne:main Mar 2, 2026
19 checks passed
@codecov
Copy link

codecov bot commented Mar 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.97%. Comparing base (9ae73f7) to head (85c0ec8).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #381   +/-   ##
=======================================
  Coverage   80.97%   80.97%           
=======================================
  Files         114      114           
  Lines        5215     5215           
  Branches     1353     1353           
=======================================
  Hits         4223     4223           
  Misses        992      992           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

2 participants