From d57e54a118c0deab83ac5721e2736938236bf8c2 Mon Sep 17 00:00:00 2001 From: Supernova Date: Wed, 14 Oct 2026 21:59:16 +0000 Subject: [PATCH 1/2] Register Claude Haiku 5.5 on anthropic and bedrock Add claude-haiku-5-5 (anthropic) and the bare, global. and us. bedrock entries, copied from the matching Sonnet 5.5 entries with effort-only reasoning. Prices are 0.1 / 0.5 / 0.01 / 0.125 at the global rate and 0.11 / 0.55 / 0.011 / 0.1375 on us., with a long-context tier in metadata.cost.tiers that starts above 100,000 prompt tokens. Add the claude-haiku-5-5 alias and a spec for the entries. Co-Authored-By: Claude Opus 5.5 Co-authored-by: Sam Boland --- lib/ruby_llm/aliases.json | 4 + lib/ruby_llm/models.json | 313 +++++++++++++++++++++++++ spec/ruby_llm/models_haiku_5_5_spec.rb | 67 ++++++ 3 files changed, 384 insertions(+) create mode 100644 spec/ruby_llm/models_haiku_5_5_spec.rb diff --git a/lib/ruby_llm/aliases.json b/lib/ruby_llm/aliases.json index 76bb16b66..1c78628c1 100644 --- a/lib/ruby_llm/aliases.json +++ b/lib/ruby_llm/aliases.json @@ -45,6 +45,10 @@ "vertexai": "claude-haiku-4-5", "azure": "claude-haiku-4-5-20251001" }, + "claude-haiku-5-5": { + "anthropic": "claude-haiku-5-5", + "bedrock": "us.anthropic.claude-haiku-5-5" + }, "claude-opus-4": { "anthropic": "claude-opus-4-20250514", "openrouter": "anthropic/claude-opus-4", diff --git a/lib/ruby_llm/models.json b/lib/ruby_llm/models.json index 9f37c75ef..40f2de7cd 100644 --- a/lib/ruby_llm/models.json +++ b/lib/ruby_llm/models.json @@ -690,6 +690,85 @@ "knowledge": "2025-02-28" } }, + { + "id": "claude-haiku-5-5", + "name": "Claude Haiku 5.5", + "provider": "anthropic", + "family": "claude-haiku", + "created_at": "2026-10-07 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": 0.1, + "output_per_million": 0.5, + "cache_read_input_per_million": 0.01, + "cache_write_input_per_million": 0.125 + } + } + }, + "metadata": { + "source": "models.dev", + "provider_id": "anthropic", + "open_weights": false, + "attachment": true, + "temperature": false, + "last_updated": "2026-10-07", + "reasoning_options": [ + { + "type": "effort", + "values": [ + "low", + "medium", + "high", + "xhigh", + "max" + ] + } + ], + "cost": { + "input": 0.1, + "output": 0.5, + "cache_read": 0.01, + "cache_write": 0.125, + "tiers": [ + { + "input": 0.5, + "output": 2.5, + "cache_read": 0.05, + "cache_write": 0.625, + "tier": { + "type": "context", + "size": 100000 + } + } + ] + }, + "limit": { + "context": 1000000, + "output": 128000 + }, + "knowledge": "2026-06" + } + }, { "id": "claude-opus-4-0", "name": "Claude Opus 4 (latest)", @@ -11490,6 +11569,84 @@ "knowledge": "2025-02-28" } }, + { + "id": "anthropic.claude-haiku-5-5", + "name": "Claude Haiku 5.5", + "provider": "bedrock", + "family": "claude-haiku", + "created_at": "2026-10-07 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": 0.1, + "output_per_million": 0.5, + "cache_read_input_per_million": 0.01, + "cache_write_input_per_million": 0.125 + } + } + }, + "metadata": { + "source": "models.dev", + "provider_id": "amazon-bedrock", + "open_weights": false, + "attachment": true, + "temperature": false, + "last_updated": "2026-10-07", + "reasoning_options": [ + { + "type": "effort", + "values": [ + "low", + "medium", + "high", + "xhigh", + "max" + ] + } + ], + "cost": { + "input": 0.1, + "output": 0.5, + "cache_read": 0.01, + "cache_write": 0.125, + "tiers": [ + { + "input": 0.5, + "output": 2.5, + "cache_read": 0.05, + "cache_write": 0.625, + "tier": { + "type": "context", + "size": 100000 + } + } + ] + }, + "limit": { + "context": 1000000, + "output": 128000 + }, + "knowledge": "2026-06" + } + }, { "id": "anthropic.claude-opus-4-1-20250805-v1:0", "name": "Claude Opus 4.1", @@ -14261,6 +14418,84 @@ "knowledge": "2025-02-28" } }, + { + "id": "global.anthropic.claude-haiku-5-5", + "name": "Claude Haiku 5.5 (Global)", + "provider": "bedrock", + "family": "claude-haiku", + "created_at": "2026-10-07 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": 0.1, + "output_per_million": 0.5, + "cache_read_input_per_million": 0.01, + "cache_write_input_per_million": 0.125 + } + } + }, + "metadata": { + "source": "models.dev", + "provider_id": "amazon-bedrock", + "open_weights": false, + "attachment": true, + "temperature": false, + "last_updated": "2026-10-07", + "reasoning_options": [ + { + "type": "effort", + "values": [ + "low", + "medium", + "high", + "xhigh", + "max" + ] + } + ], + "cost": { + "input": 0.1, + "output": 0.5, + "cache_read": 0.01, + "cache_write": 0.125, + "tiers": [ + { + "input": 0.5, + "output": 2.5, + "cache_read": 0.05, + "cache_write": 0.625, + "tier": { + "type": "context", + "size": 100000 + } + } + ] + }, + "limit": { + "context": 1000000, + "output": 128000 + }, + "knowledge": "2026-06" + } + }, { "id": "global.anthropic.claude-opus-4-5-20251101-v1:0", "name": "Claude Opus 4.5 (Global)", @@ -19655,6 +19890,84 @@ "knowledge": "2025-02-28" } }, + { + "id": "us.anthropic.claude-haiku-5-5", + "name": "Claude Haiku 5.5 (US)", + "provider": "bedrock", + "family": "claude-haiku", + "created_at": "2026-10-07 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": 0.11, + "output_per_million": 0.55, + "cache_read_input_per_million": 0.011, + "cache_write_input_per_million": 0.1375 + } + } + }, + "metadata": { + "source": "models.dev", + "provider_id": "amazon-bedrock", + "open_weights": false, + "attachment": true, + "temperature": false, + "last_updated": "2026-10-07", + "reasoning_options": [ + { + "type": "effort", + "values": [ + "low", + "medium", + "high", + "xhigh", + "max" + ] + } + ], + "cost": { + "input": 0.11, + "output": 0.55, + "cache_read": 0.011, + "cache_write": 0.1375, + "tiers": [ + { + "input": 0.55, + "output": 2.75, + "cache_read": 0.055, + "cache_write": 0.6875, + "tier": { + "type": "context", + "size": 100000 + } + } + ] + }, + "limit": { + "context": 1000000, + "output": 128000 + }, + "knowledge": "2026-06" + } + }, { "id": "us.anthropic.claude-opus-4-1-20250805-v1:0", "name": "Claude Opus 4.1 (US)", diff --git a/spec/ruby_llm/models_haiku_5_5_spec.rb b/spec/ruby_llm/models_haiku_5_5_spec.rb new file mode 100644 index 000000000..5d92a8d83 --- /dev/null +++ b/spec/ruby_llm/models_haiku_5_5_spec.rb @@ -0,0 +1,67 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe RubyLLM::Models do + include_context 'with configured RubyLLM' + + # Prices (input/output/cache_read/cache_write per million tokens, the cache + # write at the 5-minute rate) come from the AWS price list (us-west-2, + # AmazonBedrockFoundationModels) and Anthropic's pricing page, which agree + # (both read 2026-10-14): global list price is 0.1 / 0.5 / 0.01 / 0.125, and + # us. is at the regional rate, 10% over global: 0.11 / 0.55 / 0.011 / 0.1375. + # The global., bare bedrock and anthropic entries are at the global price. + # + # The long-context tier starts above 100,000 prompt tokens, not 200,000 as + # on other tiered models. Anthropic: "Claude Haiku 5.5 is priced by prompt + # length: a request whose prompt is over 100,000 tokens pays higher prices. + # A request's prompt length counts all of its input tokens, including cache + # reads and cache writes." For that reason the entries have no legacy + # context_over_200k key. + # + # These entries have no toggle reasoning option. Supernova never sends + # thinking: {type: "disabled"} to this model, and Bedrock rejects disabled + # thinking with effort xhigh or max (verified live on the + # appfolio-ci-dev-tooling Bedrock account in us-west-2, 2026-10-14, outside + # this PR's container). + global = { input: 0.1, output: 0.5, cache_read: 0.01, cache_write: 0.125 } + global_long = { input: 0.5, output: 2.5, cache_read: 0.05, cache_write: 0.625 } + regional = { input: 0.11, output: 0.55, cache_read: 0.011, cache_write: 0.1375 } + regional_long = { input: 0.55, output: 2.75, cache_read: 0.055, cache_write: 0.6875 } + + { + %w[anthropic claude-haiku-5-5] => [global, global_long], + %w[bedrock anthropic.claude-haiku-5-5] => [global, global_long], + %w[bedrock global.anthropic.claude-haiku-5-5] => [global, global_long], + %w[bedrock us.anthropic.claude-haiku-5-5] => [regional, regional_long] + }.each do |(provider, id), (cost, long_context)| + it "registers #{provider} #{id} with effort-only reasoning and the documented pricing" do + # Match on provider and raw id: RubyLLM.models.find(id, :bedrock) + # renormalizes the region prefix to the configured bedrock_region. + 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]) + expect(model.reasoning_option('toggle')).to be_nil + expect(model.metadata[:cost]).to include(cost) + + tier = model.metadata[:cost][:tiers].first + expect(tier[:tier]).to eq(type: 'context', size: 100_000) + expect(tier).to include(long_context) + end + end + + it 'resolves the claude-haiku-5-5 alias to the anthropic provider' do + expect(RubyLLM.models.find('claude-haiku-5-5').provider).to eq('anthropic') + end + + it 'resolves us.anthropic.claude-haiku-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-haiku-5-5', :bedrock) + + expect(found.id).to eq('us.anthropic.claude-haiku-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 72c21a7f7aade0eb7a3ec422581d6fa0f8ca5037 Mon Sep 17 00:00:00 2001 From: Supernova Date: Wed, 14 Oct 2026 22:18:54 +0000 Subject: [PATCH 2/2] Resolve bare Haiku 5.5 to its us. profile and list structured output Add inference_types INFERENCE_PROFILE to us.anthropic.claude-haiku-5-5, as the us. Haiku 4.5 and Fable 5 entries have, so a bare anthropic.claude-haiku-5-5 lookup under us-west-2 resolves to the us. inference profile. Add structured_output to the three Bedrock Haiku 5.5 entries, after function_calling, to match the Bedrock Haiku 4.5 entries. The spec now covers the bare-id lookup and structured_output on each entry. Co-Authored-By: Claude Opus 5.5 --- lib/ruby_llm/models.json | 6 ++++++ spec/ruby_llm/models_haiku_5_5_spec.rb | 13 +++++++++++++ 2 files changed, 19 insertions(+) diff --git a/lib/ruby_llm/models.json b/lib/ruby_llm/models.json index 40f2de7cd..c04ca045a 100644 --- a/lib/ruby_llm/models.json +++ b/lib/ruby_llm/models.json @@ -11590,6 +11590,7 @@ }, "capabilities": [ "function_calling", + "structured_output", "reasoning", "vision" ], @@ -14439,6 +14440,7 @@ }, "capabilities": [ "function_calling", + "structured_output", "reasoning", "vision" ], @@ -19911,6 +19913,7 @@ }, "capabilities": [ "function_calling", + "structured_output", "reasoning", "vision" ], @@ -19925,6 +19928,9 @@ } }, "metadata": { + "inference_types": [ + "INFERENCE_PROFILE" + ], "source": "models.dev", "provider_id": "amazon-bedrock", "open_weights": false, diff --git a/spec/ruby_llm/models_haiku_5_5_spec.rb b/spec/ruby_llm/models_haiku_5_5_spec.rb index 5d92a8d83..2699f0ab6 100644 --- a/spec/ruby_llm/models_haiku_5_5_spec.rb +++ b/spec/ruby_llm/models_haiku_5_5_spec.rb @@ -43,6 +43,7 @@ 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.supports?(:structured_output)).to be(true) expect(model.metadata[:cost]).to include(cost) tier = model.metadata[:cost][:tiers].first @@ -64,4 +65,16 @@ expect(found.provider).to eq('bedrock') expect(found.reasoning_option_values('effort')).to eq(%w[low medium high xhigh max]) end + + it 'resolves bare anthropic.claude-haiku-5-5 to the us. inference profile in us-west-2' do + # The bare foundation model is callable through an inference profile only, + # so the lookup must take the region prefix from the us. entry's + # inference_types. + allow(RubyLLM.config).to receive(:bedrock_region).and_return('us-west-2') + + found = RubyLLM.models.find('anthropic.claude-haiku-5-5', :bedrock) + + expect(found.id).to eq('us.anthropic.claude-haiku-5-5') + expect(found.provider).to eq('bedrock') + end end