Skip to content

Commit 06a8ff3

Browse files
committed
Update documentation for OpenRouter support
1 parent 142c1f3 commit 06a8ff3

File tree

7 files changed

+23
-8
lines changed

7 files changed

+23
-8
lines changed

.github/workflows/cicd.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ jobs:
128128
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
129129
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
130130
DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_API_KEY }}
131+
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
131132
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
132133
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
133134

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ A delightful Ruby way to work with AI. No configuration madness, no complex call
1212
<img src="https://registry.npmmirror.com/@lobehub/icons-static-svg/latest/files/icons/bedrock-color.svg" alt="Bedrock" height="40">
1313
<img src="https://registry.npmmirror.com/@lobehub/icons-static-svg/latest/files/icons/bedrock-text.svg" alt="Bedrock" height="40" width="120">
1414
&nbsp;&nbsp;
15+
<img src="https://registry.npmmirror.com/@lobehub/icons-static-svg/latest/files/icons/openrouter.svg" alt="OpenRouter" height="40">
16+
<img src="https://registry.npmmirror.com/@lobehub/icons-static-svg/latest/files/icons/openrouter-text.svg" alt="OpenRouter" height="40" width="120">
17+
&nbsp;&nbsp;
1518
<img src="https://upload.wikimedia.org/wikipedia/commons/e/ec/DeepSeek_logo.svg" alt="DeepSeek" height="40" width="120">
1619
</div>
1720

@@ -30,7 +33,7 @@ RubyLLM fixes all that. One beautiful API for everything. One consistent format.
3033

3134
## Features
3235

33-
- 💬 **Chat** with OpenAI, Anthropic, Gemini, AWS Bedrock Anthropic, and DeepSeek models
36+
- 💬 **Chat** with OpenAI, Anthropic, Gemini, AWS Bedrock Anthropic, OpenRouter, and DeepSeek models
3437
- 👁️ **Vision and Audio** understanding
3538
- 📄 **PDF Analysis** for analyzing documents
3639
- 🖼️ **Image generation** with DALL-E and other providers

bin/console

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ RubyLLM.configure do |config|
1212
config.anthropic_api_key = ENV.fetch('ANTHROPIC_API_KEY', nil)
1313
config.gemini_api_key = ENV.fetch('GEMINI_API_KEY', nil)
1414
config.deepseek_api_key = ENV.fetch('DEEPSEEK_API_KEY', nil)
15+
config.openrouter_api_key = ENV.fetch('OPENROUTER_API_KEY', nil)
1516
config.bedrock_api_key = ENV.fetch('AWS_ACCESS_KEY_ID', nil)
1617
config.bedrock_secret_key = ENV.fetch('AWS_SECRET_ACCESS_KEY', nil)
1718
config.bedrock_region = ENV.fetch('AWS_REGION', nil)
1819
config.bedrock_session_token = ENV.fetch('AWS_SESSION_TOKEN', nil)
19-
config.openrouter_api_key = ENV.fetch('OPENROUTER_API_KEY', nil)
2020
end
2121

2222
IRB.start(__FILE__)

docs/configuration.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ After reading this guide, you will know:
3030

3131
## Global Configuration (`RubyLLM.configure`)
3232

33+
{: .note-title }
34+
> Coming in v1.3.0
35+
>
36+
> OpenRouter support is coming in v1.3.0
37+
3338
The primary way to configure RubyLLM is using the `RubyLLM.configure` block. This typically runs once when your application starts (e.g., in `config/initializers/ruby_llm.rb` for Rails apps, or at the top of a script).
3439

3540
```ruby
@@ -43,6 +48,7 @@ RubyLLM.configure do |config|
4348
config.anthropic_api_key = ENV.fetch('ANTHROPIC_API_KEY', nil)
4449
config.gemini_api_key = ENV.fetch('GEMINI_API_KEY', nil)
4550
config.deepseek_api_key = ENV.fetch('DEEPSEEK_API_KEY', nil)
51+
config.openrouter_api_key = ENV.fetch('OPENROUTER_API_KEY', nil)
4652

4753
# --- AWS Bedrock Credentials ---
4854
# Uses standard AWS credential chain (environment, shared config, IAM role)
@@ -82,6 +88,7 @@ Set the corresponding `*_api_key` attribute for each provider you want to enable
8288
* `anthropic_api_key`
8389
* `gemini_api_key`
8490
* `deepseek_api_key`
91+
* `openrouter_api_key`
8592
* `bedrock_api_key`, `bedrock_secret_key`, `bedrock_region`, `bedrock_session_token` (See AWS documentation for standard credential methods if not set explicitly).
8693

8794
## Custom OpenAI API Base (`openai_api_base`)
@@ -128,8 +135,8 @@ Adjust these based on network conditions and provider reliability.
128135
## Scoped Configuration with Contexts
129136
{: .d-inline-block }
130137

131-
New (v1.3.0)
132-
{: .label .label-green }
138+
Coming in v1.3.0
139+
{: .label .label-yellow }
133140

134141
While `RubyLLM.configure` sets global defaults, `RubyLLM.context` allows you to create temporary, isolated configuration scopes for specific API calls. This is ideal for situations requiring different keys, endpoints, or timeouts temporarily without affecting the rest of the application.
135142

docs/guides/models.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ permalink: /guides/models
99
# Working with AI Models
1010
{: .no_toc }
1111

12-
RubyLLM provides a unified interface to a wide array of AI models from different providers like OpenAI, Anthropic, Google, AWS Bedrock, and DeepSeek. This guide covers how RubyLLM discovers, manages, and allows you to interact with these models, including advanced scenarios like custom endpoints.
12+
RubyLLM provides a unified interface to a wide array of AI models from different providers like OpenAI, Anthropic, Google, AWS Bedrock, OpenRouter and DeepSeek. This guide covers how RubyLLM discovers, manages, and allows you to interact with these models, including advanced scenarios like custom endpoints.
1313
{: .fs-6 .fw-300 }
1414

1515
## Table of contents

docs/index.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ permalink: /
1212
<iframe src="https://ghbtns.com/github-btn.html?user=crmne&repo=ruby_llm&type=star&count=true&size=large" frameborder="0" scrolling="0" width="170" height="30" title="GitHub" style="vertical-align: middle; display: inline-block;"></iframe>
1313
</div>
1414

15-
A delightful Ruby way to work with AI through a unified interface to OpenAI, Anthropic, Google, AWS Bedrock Anthropic, and DeepSeek.
15+
A delightful Ruby way to work with AI through a unified interface to OpenAI, Anthropic, Google, AWS Bedrock Anthropic, OpenRouter, and DeepSeek.
1616
{: .fs-6 .fw-300 }
1717

1818

@@ -29,6 +29,10 @@ A delightful Ruby way to work with AI through a unified interface to OpenAI, Ant
2929
<img src="https://registry.npmmirror.com/@lobehub/icons-static-svg/latest/files/icons/bedrock-color.svg" alt="Bedrock" height="40">
3030
<img src="https://registry.npmmirror.com/@lobehub/icons-static-svg/latest/files/icons/bedrock-text.svg" alt="Bedrock" height="40" width="120">
3131
</div>
32+
<div>
33+
<img src="https://registry.npmmirror.com/@lobehub/icons-static-svg/latest/files/icons/openrouter.svg" alt="OpenRouter" height="40">
34+
<img src="https://registry.npmmirror.com/@lobehub/icons-static-svg/latest/files/icons/openrouter-text.svg" alt="OpenRouter" height="40" width="120">
35+
</div>
3236
<img src="https://upload.wikimedia.org/wikipedia/commons/e/ec/DeepSeek_logo.svg" alt="DeepSeek" height="40" width="120">
3337
</div>
3438

@@ -52,7 +56,7 @@ RubyLLM fixes all that. One beautiful API for everything. One consistent format.
5256

5357
## Features
5458

55-
- 💬 **Chat** with OpenAI, Anthropic, Gemini, AWS Bedrock Anthropic, and DeepSeek models
59+
- 💬 **Chat** with OpenAI, Anthropic, Gemini, AWS Bedrock Anthropic, OpenRouter, and DeepSeek models
5660
- 👁️ **Vision and Audio** understanding
5761
- 📄 **PDF Analysis** for analyzing documents
5862
- 🖼️ **Image generation** with DALL-E and other providers

ruby_llm.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
1111
spec.summary = 'Beautiful Ruby interface to modern AI'
1212
spec.description = 'A delightful Ruby way to work with AI. Chat in text, analyze and generate ' \
1313
'images, understand audio, and use tools through a unified interface to ' \
14-
'OpenAI, Anthropic, Google, AWS Bedrock Anthropic, and DeepSeek. Built for ' \
14+
'OpenAI, Anthropic, Google, AWS Bedrock Anthropic, OpenRouter, and DeepSeek. Built for ' \
1515
'developer happiness with automatic token counting, proper streaming, and ' \
1616
'Rails integration. No wrapping your head around multiple APIs - just clean ' \
1717
'Ruby code that works.'

0 commit comments

Comments
 (0)