From f796f14ebe12ab7a365f6b3cbb59203a8cab50e4 Mon Sep 17 00:00:00 2001 From: Supernova Date: Mon, 5 Oct 2026 15:55:54 +0000 Subject: [PATCH 1/2] Add Claude Sonnet 5.5 model definitions and alias Registers claude-sonnet-5-5 for anthropic, bedrock (base, us., eu., global., au., jp.) and vertexai, one entry per existing Sonnet 5 entry. Pricing is unchanged from Sonnet 5 (AWS Marketplace rate card, checked 2026-10-05). Reasoning is effort-only with no toggle option, since Sonnet 5.5 rejects thinking: {type: "disabled"}; capabilities follow the Opus 5.5 entries. Co-Authored-By: Claude Opus 5.5 Co-authored-by: Sam Boland --- lib/ruby_llm/aliases.json | 5 + lib/ruby_llm/models.json | 529 ++++++++++++++++++++++++ spec/ruby_llm/models_sonnet_5_5_spec.rb | 50 +++ 3 files changed, 584 insertions(+) create mode 100644 spec/ruby_llm/models_sonnet_5_5_spec.rb diff --git a/lib/ruby_llm/aliases.json b/lib/ruby_llm/aliases.json index 185579fc50..5ae5c7ec49 100644 --- a/lib/ruby_llm/aliases.json +++ b/lib/ruby_llm/aliases.json @@ -125,6 +125,11 @@ "bedrock": "us.anthropic.claude-sonnet-5", "vertexai": "claude-sonnet-5" }, + "claude-sonnet-5-5": { + "anthropic": "claude-sonnet-5-5", + "bedrock": "us.anthropic.claude-sonnet-5-5", + "vertexai": "claude-sonnet-5-5" + }, "deepseek-chat": { "deepseek": "deepseek-chat", "openrouter": "deepseek/deepseek-chat" diff --git a/lib/ruby_llm/models.json b/lib/ruby_llm/models.json index ede2c31bd5..56bf6332c5 100644 --- a/lib/ruby_llm/models.json +++ b/lib/ruby_llm/models.json @@ -1787,6 +1787,73 @@ "knowledge": "2026-01-31" } }, + { + "id": "claude-sonnet-5-5", + "name": "Claude Sonnet 5.5", + "provider": "anthropic", + "family": "claude-sonnet", + "created_at": "2026-09-28 00:00:00 UTC", + "context_window": 1000000, + "max_output_tokens": 128000, + "knowledge_cutoff": null, + "modalities": { + "input": [ + "text", + "image", + "pdf" + ], + "output": [ + "text" + ] + }, + "capabilities": [ + "function_calling", + "structured_output", + "reasoning", + "vision" + ], + "pricing": { + "text_tokens": { + "standard": { + "input_per_million": 2, + "output_per_million": 10, + "cache_read_input_per_million": 0.2, + "cache_write_input_per_million": 2.5 + } + } + }, + "metadata": { + "source": "models.dev", + "provider_id": "anthropic", + "open_weights": false, + "attachment": true, + "temperature": false, + "last_updated": "2026-09-28", + "reasoning_options": [ + { + "type": "effort", + "values": [ + "low", + "medium", + "high", + "xhigh", + "max" + ] + } + ], + "cost": { + "input": 2, + "output": 10, + "cache_read": 0.2, + "cache_write": 2.5 + }, + "limit": { + "context": 1000000, + "output": 128000 + }, + "knowledge": "2026-06" + } + }, { "id": "AI21-Jamba-1.5-Large", "name": "AI21-Jamba-1.5-Large", @@ -12086,6 +12153,72 @@ "knowledge": "2026-01-31" } }, + { + "id": "anthropic.claude-sonnet-5-5", + "name": "Claude Sonnet 5.5", + "provider": "bedrock", + "family": "claude-sonnet", + "created_at": "2026-09-28 00:00:00 UTC", + "context_window": 1000000, + "max_output_tokens": 128000, + "knowledge_cutoff": null, + "modalities": { + "input": [ + "text", + "image", + "pdf" + ], + "output": [ + "text" + ] + }, + "capabilities": [ + "function_calling", + "reasoning", + "vision" + ], + "pricing": { + "text_tokens": { + "standard": { + "input_per_million": 2, + "output_per_million": 10, + "cache_read_input_per_million": 0.2, + "cache_write_input_per_million": 2.5 + } + } + }, + "metadata": { + "source": "models.dev", + "provider_id": "amazon-bedrock", + "open_weights": false, + "attachment": true, + "temperature": false, + "last_updated": "2026-09-28", + "reasoning_options": [ + { + "type": "effort", + "values": [ + "low", + "medium", + "high", + "xhigh", + "max" + ] + } + ], + "cost": { + "input": 2, + "output": 10, + "cache_read": 0.2, + "cache_write": 2.5 + }, + "limit": { + "context": 1000000, + "output": 128000 + }, + "knowledge": "2026-06" + } + }, { "id": "au.anthropic.claude-haiku-4-5-20251001-v1:0", "name": "Claude Haiku 4.5 (AU)", @@ -12615,6 +12748,72 @@ "knowledge": "2026-01-31" } }, + { + "id": "au.anthropic.claude-sonnet-5-5", + "name": "Claude Sonnet 5.5 (AU)", + "provider": "bedrock", + "family": "claude-sonnet", + "created_at": "2026-09-28 00:00:00 UTC", + "context_window": 1000000, + "max_output_tokens": 128000, + "knowledge_cutoff": null, + "modalities": { + "input": [ + "text", + "image", + "pdf" + ], + "output": [ + "text" + ] + }, + "capabilities": [ + "function_calling", + "reasoning", + "vision" + ], + "pricing": { + "text_tokens": { + "standard": { + "input_per_million": 2, + "output_per_million": 10, + "cache_read_input_per_million": 0.2, + "cache_write_input_per_million": 2.5 + } + } + }, + "metadata": { + "source": "models.dev", + "provider_id": "amazon-bedrock", + "open_weights": false, + "attachment": true, + "temperature": false, + "last_updated": "2026-09-28", + "reasoning_options": [ + { + "type": "effort", + "values": [ + "low", + "medium", + "high", + "xhigh", + "max" + ] + } + ], + "cost": { + "input": 2, + "output": 10, + "cache_read": 0.2, + "cache_write": 2.5 + }, + "limit": { + "context": 1000000, + "output": 128000 + }, + "knowledge": "2026-06" + } + }, { "id": "cohere.command-r-plus-v1:0", "name": "Command R+", @@ -13805,6 +14004,72 @@ "knowledge": "2026-01-31" } }, + { + "id": "eu.anthropic.claude-sonnet-5-5", + "name": "Claude Sonnet 5.5 (EU)", + "provider": "bedrock", + "family": "claude-sonnet", + "created_at": "2026-09-28 00:00:00 UTC", + "context_window": 1000000, + "max_output_tokens": 128000, + "knowledge_cutoff": null, + "modalities": { + "input": [ + "text", + "image", + "pdf" + ], + "output": [ + "text" + ] + }, + "capabilities": [ + "function_calling", + "reasoning", + "vision" + ], + "pricing": { + "text_tokens": { + "standard": { + "input_per_million": 2.2, + "output_per_million": 11, + "cache_read_input_per_million": 0.22, + "cache_write_input_per_million": 2.75 + } + } + }, + "metadata": { + "source": "models.dev", + "provider_id": "amazon-bedrock", + "open_weights": false, + "attachment": true, + "temperature": false, + "last_updated": "2026-09-28", + "reasoning_options": [ + { + "type": "effort", + "values": [ + "low", + "medium", + "high", + "xhigh", + "max" + ] + } + ], + "cost": { + "input": 2.2, + "output": 11, + "cache_read": 0.22, + "cache_write": 2.75 + }, + "limit": { + "context": 1000000, + "output": 128000 + }, + "knowledge": "2026-06" + } + }, { "id": "global.anthropic.claude-fable-5", "name": "Claude Fable 5 (Global)", @@ -14599,6 +14864,72 @@ "knowledge": "2026-01-31" } }, + { + "id": "global.anthropic.claude-sonnet-5-5", + "name": "Claude Sonnet 5.5 (Global)", + "provider": "bedrock", + "family": "claude-sonnet", + "created_at": "2026-09-28 00:00:00 UTC", + "context_window": 1000000, + "max_output_tokens": 128000, + "knowledge_cutoff": null, + "modalities": { + "input": [ + "text", + "image", + "pdf" + ], + "output": [ + "text" + ] + }, + "capabilities": [ + "function_calling", + "reasoning", + "vision" + ], + "pricing": { + "text_tokens": { + "standard": { + "input_per_million": 2, + "output_per_million": 10, + "cache_read_input_per_million": 0.2, + "cache_write_input_per_million": 2.5 + } + } + }, + "metadata": { + "source": "models.dev", + "provider_id": "amazon-bedrock", + "open_weights": false, + "attachment": true, + "temperature": false, + "last_updated": "2026-09-28", + "reasoning_options": [ + { + "type": "effort", + "values": [ + "low", + "medium", + "high", + "xhigh", + "max" + ] + } + ], + "cost": { + "input": 2, + "output": 10, + "cache_read": 0.2, + "cache_write": 2.5 + }, + "limit": { + "context": 1000000, + "output": 128000 + }, + "knowledge": "2026-06" + } + }, { "id": "google.gemma-3-12b-it", "name": "Google Gemma 3 12B", @@ -15273,6 +15604,72 @@ "knowledge": "2026-01-31" } }, + { + "id": "jp.anthropic.claude-sonnet-5-5", + "name": "Claude Sonnet 5.5 (JP)", + "provider": "bedrock", + "family": "claude-sonnet", + "created_at": "2026-09-28 00:00:00 UTC", + "context_window": 1000000, + "max_output_tokens": 128000, + "knowledge_cutoff": null, + "modalities": { + "input": [ + "text", + "image", + "pdf" + ], + "output": [ + "text" + ] + }, + "capabilities": [ + "function_calling", + "reasoning", + "vision" + ], + "pricing": { + "text_tokens": { + "standard": { + "input_per_million": 2, + "output_per_million": 10, + "cache_read_input_per_million": 0.2, + "cache_write_input_per_million": 2.5 + } + } + }, + "metadata": { + "source": "models.dev", + "provider_id": "amazon-bedrock", + "open_weights": false, + "attachment": true, + "temperature": false, + "last_updated": "2026-09-28", + "reasoning_options": [ + { + "type": "effort", + "values": [ + "low", + "medium", + "high", + "xhigh", + "max" + ] + } + ], + "cost": { + "input": 2, + "output": 10, + "cache_read": 0.2, + "cache_write": 2.5 + }, + "limit": { + "context": 1000000, + "output": 128000 + }, + "knowledge": "2026-06" + } + }, { "id": "luma.ray-v2:0", "name": "Ray v2", @@ -19952,6 +20349,72 @@ "knowledge": "2026-01-31" } }, + { + "id": "us.anthropic.claude-sonnet-5-5", + "name": "Claude Sonnet 5.5 (US)", + "provider": "bedrock", + "family": "claude-sonnet", + "created_at": "2026-09-28 00:00:00 UTC", + "context_window": 1000000, + "max_output_tokens": 128000, + "knowledge_cutoff": null, + "modalities": { + "input": [ + "text", + "image", + "pdf" + ], + "output": [ + "text" + ] + }, + "capabilities": [ + "function_calling", + "reasoning", + "vision" + ], + "pricing": { + "text_tokens": { + "standard": { + "input_per_million": 2, + "output_per_million": 10, + "cache_read_input_per_million": 0.2, + "cache_write_input_per_million": 2.5 + } + } + }, + "metadata": { + "source": "models.dev", + "provider_id": "amazon-bedrock", + "open_weights": false, + "attachment": true, + "temperature": false, + "last_updated": "2026-09-28", + "reasoning_options": [ + { + "type": "effort", + "values": [ + "low", + "medium", + "high", + "xhigh", + "max" + ] + } + ], + "cost": { + "input": 2, + "output": 10, + "cache_read": 0.2, + "cache_write": 2.5 + }, + "limit": { + "context": 1000000, + "output": 128000 + }, + "knowledge": "2026-06" + } + }, { "id": "us.cohere.embed-v4:0", "name": "Embed v4", @@ -63258,6 +63721,72 @@ "knowledge": "2026-01-31" } }, + { + "id": "claude-sonnet-5-5", + "name": "Claude Sonnet 5.5", + "provider": "vertexai", + "family": "claude-sonnet", + "created_at": "2026-09-28 00:00:00 UTC", + "context_window": 1000000, + "max_output_tokens": 128000, + "knowledge_cutoff": null, + "modalities": { + "input": [ + "text", + "image", + "pdf" + ], + "output": [ + "text" + ] + }, + "capabilities": [ + "function_calling", + "reasoning", + "vision" + ], + "pricing": { + "text_tokens": { + "standard": { + "input_per_million": 2, + "output_per_million": 10, + "cache_read_input_per_million": 0.2, + "cache_write_input_per_million": 2.5 + } + } + }, + "metadata": { + "source": "models.dev", + "provider_id": "google-vertex", + "open_weights": false, + "attachment": true, + "temperature": false, + "last_updated": "2026-09-28", + "reasoning_options": [ + { + "type": "effort", + "values": [ + "low", + "medium", + "high", + "xhigh", + "max" + ] + } + ], + "cost": { + "input": 2, + "output": 10, + "cache_read": 0.2, + "cache_write": 2.5 + }, + "limit": { + "context": 1000000, + "output": 128000 + }, + "knowledge": "2026-06" + } + }, { "id": "codestral-2", "name": "codestral-2", diff --git a/spec/ruby_llm/models_sonnet_5_5_spec.rb b/spec/ruby_llm/models_sonnet_5_5_spec.rb new file mode 100644 index 0000000000..c2284f5475 --- /dev/null +++ b/spec/ruby_llm/models_sonnet_5_5_spec.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe RubyLLM::Models do + include_context 'with configured RubyLLM' + + # Pricing is unchanged from each id's Claude Sonnet 5 entry: every id except + # eu. is 2 / 10 / 0.20 / 2.5 (input/output/cache_read/cache_write per million + # tokens), and eu. is 2.2 / 11 / 0.22 / 2.75. Source: the AWS Marketplace rate + # card for the Claude Sonnet 5.5 offer accepted on the appfolio-ci-dev-tooling + # account, global standard tier, checked 2026-10-05. + # + # Unlike Sonnet 5, these entries have no toggle reasoning option: Sonnet 5.5 + # rejects thinking: {type: "disabled"} (verified live on Bedrock 2026-10-05) + # and only accepts adaptive thinking with output_config.effort, the same as + # Opus 5.5. + { + 'claude-sonnet-5-5' => { input: 2, output: 10, cache_read: 0.20, cache_write: 2.5 }, + 'global.anthropic.claude-sonnet-5-5' => { input: 2, output: 10, cache_read: 0.20, cache_write: 2.5 }, + 'us.anthropic.claude-sonnet-5-5' => { input: 2, output: 10, cache_read: 0.20, cache_write: 2.5 }, + 'eu.anthropic.claude-sonnet-5-5' => { input: 2.2, output: 11, cache_read: 0.22, cache_write: 2.75 } + }.each do |id, cost| + it "registers #{id} with effort-only reasoning and the documented pricing" do + # Look up by raw id rather than RubyLLM.models.find(id, :bedrock) — bedrock + # lookups renormalize the region prefix to the configured bedrock_region, + # which would mask the EU-specific entry's own pricing. + model = RubyLLM.models.all.find { |m| m.id == id } + + expect(model).not_to be_nil + expect(model.reasoning_option_values('effort')).to eq(%w[low medium high xhigh max]) + expect(model.reasoning_option('toggle')).to be_nil + expect(model.metadata[:cost]).to include(cost) + end + end + + it 'resolves the claude-sonnet-5-5 alias to the anthropic provider' do + expect(RubyLLM.models.find('claude-sonnet-5-5').provider).to eq('anthropic') + end + + it 'resolves us.anthropic.claude-sonnet-5-5 when bedrock_region is configured' do + allow(RubyLLM.config).to receive(:bedrock_region).and_return('us-west-2') + + found = RubyLLM.models.find('us.anthropic.claude-sonnet-5-5', :bedrock) + + expect(found.id).to eq('us.anthropic.claude-sonnet-5-5') + expect(found.provider).to eq('bedrock') + expect(found.reasoning_option_values('effort')).to eq(%w[low medium high xhigh max]) + end +end From c74c80fd2f4d59d4c328b524e93b65ee0958fc31 Mon Sep 17 00:00:00 2001 From: Supernova Date: Mon, 5 Oct 2026 16:10:24 +0000 Subject: [PATCH 2/2] Cover all Sonnet 5.5 entries by provider and id in the spec Co-Authored-By: Claude Opus 5.5 --- spec/ruby_llm/models_sonnet_5_5_spec.rb | 35 ++++++++++++++++--------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/spec/ruby_llm/models_sonnet_5_5_spec.rb b/spec/ruby_llm/models_sonnet_5_5_spec.rb index c2284f5475..ae773dd558 100644 --- a/spec/ruby_llm/models_sonnet_5_5_spec.rb +++ b/spec/ruby_llm/models_sonnet_5_5_spec.rb @@ -12,20 +12,29 @@ # account, global standard tier, checked 2026-10-05. # # Unlike Sonnet 5, these entries have no toggle reasoning option: Sonnet 5.5 - # rejects thinking: {type: "disabled"} (verified live on Bedrock 2026-10-05) - # and only accepts adaptive thinking with output_config.effort, the same as - # Opus 5.5. + # rejects thinking: {type: "disabled"} (verified live on the + # appfolio-ci-dev-tooling Bedrock account, 2026-10-05, outside this PR's + # container) and only accepts adaptive thinking with output_config.effort, + # the same as Opus 5.5. + standard = { input: 2, output: 10, cache_read: 0.20, cache_write: 2.5 } + eu = { input: 2.2, output: 11, cache_read: 0.22, cache_write: 2.75 } + { - 'claude-sonnet-5-5' => { input: 2, output: 10, cache_read: 0.20, cache_write: 2.5 }, - 'global.anthropic.claude-sonnet-5-5' => { input: 2, output: 10, cache_read: 0.20, cache_write: 2.5 }, - 'us.anthropic.claude-sonnet-5-5' => { input: 2, output: 10, cache_read: 0.20, cache_write: 2.5 }, - 'eu.anthropic.claude-sonnet-5-5' => { input: 2.2, output: 11, cache_read: 0.22, cache_write: 2.75 } - }.each do |id, cost| - it "registers #{id} with effort-only reasoning and the documented pricing" do - # Look up by raw id rather than RubyLLM.models.find(id, :bedrock) — bedrock - # lookups renormalize the region prefix to the configured bedrock_region, - # which would mask the EU-specific entry's own pricing. - model = RubyLLM.models.all.find { |m| m.id == id } + %w[anthropic claude-sonnet-5-5] => standard, + %w[vertexai claude-sonnet-5-5] => standard, + %w[bedrock anthropic.claude-sonnet-5-5] => standard, + %w[bedrock global.anthropic.claude-sonnet-5-5] => standard, + %w[bedrock us.anthropic.claude-sonnet-5-5] => standard, + %w[bedrock eu.anthropic.claude-sonnet-5-5] => eu, + %w[bedrock au.anthropic.claude-sonnet-5-5] => standard, + %w[bedrock jp.anthropic.claude-sonnet-5-5] => standard + }.each do |(provider, id), cost| + it "registers #{provider} #{id} with effort-only reasoning and the documented pricing" do + # Match on provider and raw id: the anthropic and vertexai entries share + # an id, and RubyLLM.models.find(id, :bedrock) renormalizes the region + # prefix to the configured bedrock_region, which would mask the + # EU-specific entry's own pricing. + model = RubyLLM.models.all.find { |m| m.provider == provider && m.id == id } expect(model).not_to be_nil expect(model.reasoning_option_values('effort')).to eq(%w[low medium high xhigh max])