Skip to content

Commit 7017dcf

Browse files
committed
Switched default model to gpt-4.1-nano
1 parent beb03ae commit 7017dcf

File tree

36 files changed

+1226
-1267
lines changed

36 files changed

+1226
-1267
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ end
118118
## Have great conversations
119119

120120
```ruby
121-
# Start a chat with the default model (GPT-4o-mini)
121+
# Start a chat with the default model (gpt-4.1-nano)
122122
chat = RubyLLM.chat
123123

124124
# Or specify what you want
@@ -169,7 +169,7 @@ class ToolCall < ApplicationRecord
169169
end
170170

171171
# In a background job
172-
chat = Chat.create! model_id: "gpt-4o-mini"
172+
chat = Chat.create! model_id: "gpt-4.1-nano"
173173

174174
# Set personality or behavior with instructions (aka system prompts) - they're persisted too!
175175
chat.with_instructions "You are a friendly Ruby expert who loves to help beginners"

docs/guides/chat.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ You can specify which model to use when creating a chat:
3434

3535
```ruby
3636
# Create a chat with a specific model
37-
chat = RubyLLM.chat(model: 'gpt-4o-mini')
37+
chat = RubyLLM.chat(model: 'gpt-4.1-nano')
3838

3939
# Use Claude instead
4040
claude_chat = RubyLLM.chat(model: 'claude-3-5-sonnet-20241022')

docs/guides/getting-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ RubyLLM.models.embedding_models.each do |model|
9494
end
9595

9696
# Find info about a specific model
97-
gpt = RubyLLM.models.find('gpt-4o-mini')
97+
gpt = RubyLLM.models.find('gpt-4.1-nano')
9898
puts "Context window: #{gpt.context_window}"
9999
puts "Max tokens: #{gpt.max_tokens}"
100100
puts "Pricing: $#{gpt.input_price_per_million} per million input tokens"

docs/guides/models.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ The simplest way to use a model is to specify it when creating a chat:
2121
chat = RubyLLM.chat
2222

2323
# Specify a model
24-
chat = RubyLLM.chat(model: 'gpt-4o-mini')
24+
chat = RubyLLM.chat(model: 'gpt-4.1-nano')
2525

2626
# Change models mid-conversation
2727
chat.with_model('claude-3-5-sonnet')
@@ -157,7 +157,7 @@ anthropic_chat = RubyLLM.models.by_provider('anthropic').chat_models
157157
Find a specific model by ID to see its capabilities:
158158

159159
```ruby
160-
model = RubyLLM.models.find('gpt-4o-mini')
160+
model = RubyLLM.models.find('gpt-4.1-nano')
161161

162162
puts "Model: #{model.display_name}"
163163
puts "Provider: #{model.provider}"

docs/guides/rails.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ Once your models are set up, you can use them like any other Rails model:
111111

112112
```ruby
113113
# Create a new chat
114-
chat = Chat.create!(model_id: 'gpt-4o-mini')
114+
chat = Chat.create!(model_id: 'gpt-4.1-nano')
115115

116116
# Ask a question
117117
chat.ask "What's the capital of France?"
@@ -134,7 +134,7 @@ Instructions help guide the AI's behavior throughout a conversation. With Rails
134134

135135
```ruby
136136
# Create a new chat
137-
chat = Chat.create!(model_id: 'gpt-4o-mini')
137+
chat = Chat.create!(model_id: 'gpt-4.1-nano')
138138

139139
# Add instructions (these are persisted)
140140
chat.with_instructions("You are a helpful Ruby programming assistant. Always include code examples in your responses and explain them line by line.")
@@ -198,7 +198,7 @@ end
198198
You can stream responses while still persisting the final result:
199199

200200
```ruby
201-
chat = Chat.create!(model_id: 'gpt-4o-mini')
201+
chat = Chat.create!(model_id: 'gpt-4.1-nano')
202202

203203
chat.ask "Write a short poem about Ruby" do |chunk|
204204
# Stream content to the user
@@ -317,7 +317,7 @@ class Weather < RubyLLM::Tool
317317
end
318318

319319
# Add the tool to your chat
320-
chat = Chat.create!(model_id: 'gpt-4o-mini')
320+
chat = Chat.create!(model_id: 'gpt-4.1-nano')
321321
chat.with_tool(Weather)
322322

323323
# Ask a question that requires calculation
@@ -389,7 +389,7 @@ class Chat < ApplicationRecord
389389
end
390390

391391
# Usage
392-
user.chats.create!(model_id: 'gpt-4o-mini').ask("Hello!")
392+
user.chats.create!(model_id: 'gpt-4.1-nano').ask("Hello!")
393393
```
394394

395395
### Metadata and Tagging
@@ -407,7 +407,7 @@ end
407407

408408
# Usage
409409
chat = Chat.create!(
410-
model_id: 'gpt-4o-mini',
410+
model_id: 'gpt-4.1-nano',
411411
metadata: {
412412
purpose: 'customer_support',
413413
category: 'billing',

docs/guides/streaming.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ class Chat < ApplicationRecord
195195
acts_as_chat
196196
end
197197

198-
chat = Chat.create!(model_id: 'gpt-4o-mini')
198+
chat = Chat.create!(model_id: 'gpt-4.1-nano')
199199

200200
# Stream responses while persisting the final result
201201
chat.ask("Tell me about Ruby") do |chunk|

docs/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ claude_chat.ask "Summarize this document", with: { pdf: "contract.pdf" }
134134
## Have great conversations
135135

136136
```ruby
137-
# Start a chat with the default model (GPT-4o-mini)
137+
# Start a chat with the default model (gpt-4.1-nano)
138138
chat = RubyLLM.chat
139139

140140
# Or specify what you want
@@ -177,7 +177,7 @@ class ToolCall < ApplicationRecord
177177
end
178178

179179
# In a background job
180-
chat = Chat.create!(model_id: "gpt-4o-mini")
180+
chat = Chat.create!(model_id: "gpt-4.1-nano")
181181
chat.ask("What's your favorite Ruby gem?") do |chunk|
182182
Turbo::StreamsChannel.broadcast_append_to(
183183
chat,

docs/installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ RubyLLM.configure do |config|
6464
config.bedrock_session_token = ENV.fetch('AWS_SESSION_TOKEN', nil)
6565

6666
# Optional: Set default models
67-
config.default_model = 'gpt-4o-mini' # Default chat model
67+
config.default_model = 'gpt-4.1-nano' # Default chat model
6868
config.default_embedding_model = 'text-embedding-3-small' # Default embedding model
6969
config.default_image_model = 'dall-e-3' # Default image generation model
7070

lib/ruby_llm/configuration.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def initialize
3939
@retry_interval_randomness = 0.5
4040

4141
# Default models
42-
@default_model = 'gpt-4o-mini'
42+
@default_model = 'gpt-4.1-nano'
4343
@default_embedding_model = 'text-embedding-3-small'
4444
@default_image_model = 'dall-e-3'
4545
end

spec/fixtures/vcr_cassettes/chat_audio_models_openai_gpt-4o-mini-audio-preview_can_understand_audio.yml

Lines changed: 14 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)