Skip to content

Commit 3ab0006

Browse files
authored
Add support for Anthropic Claude Opus 4.5 model (#1199)
<!-- Thank you for opening a pull request! Please add a brief description of the proposed change here. Also, please tick the appropriate points in the checklist below. --> ## Motivation and Context <!-- Why is this change needed? What problem does it solve? --> Adding a new Anthropic LLM profile. https://www.anthropic.com/news/claude-opus-4-5 https://aws.amazon.com/blogs/machine-learning/claude-opus-4-5-now-in-amazon-bedrock/ ## Breaking Changes <!-- Will users need to update their code or configurations? --> None. --- #### Type of the changes - [x] New feature (non-breaking change which adds functionality) - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Documentation update - [ ] Tests improvement - [ ] Refactoring #### Checklist - [x] The pull request has a description of the proposed change - [x] I read the [Contributing Guidelines](https://github.com/JetBrains/koog/blob/main/CONTRIBUTING.md) before opening the pull request - [x] The pull request uses **`develop`** as the base branch - [x] Tests for the changes have been added - [x] All new and existing tests passed ##### Additional steps for pull requests adding a new feature - [ ] An issue describing the proposed change exists - [ ] The pull request includes a link to the issue - [ ] The change was discussed and approved in the issue - [x] Docs have been added / updated
1 parent 7fe0dec commit 3ab0006

File tree

5 files changed

+49
-4
lines changed
  • integration-tests/src/jvmTest/kotlin/ai/koog/integration/tests/utils
  • koog-ktor/src
  • prompt/prompt-executor/prompt-executor-clients
    • prompt-executor-anthropic-client/src/commonMain/kotlin/ai/koog/prompt/executor/clients/anthropic
    • prompt-executor-bedrock-client/src/jvmMain/kotlin/ai/koog/prompt/executor/clients/bedrock

5 files changed

+49
-4
lines changed

integration-tests/src/jvmTest/kotlin/ai/koog/integration/tests/utils/Models.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ object Models {
2525
@JvmStatic
2626
fun anthropicModels(): Stream<LLModel> {
2727
return Stream.of(
28-
AnthropicModels.Opus_4_1,
28+
AnthropicModels.Opus_4_5,
2929
AnthropicModels.Haiku_4_5,
3030
AnthropicModels.Sonnet_4_5,
3131
)

koog-ktor/src/commonMain/kotlin/ai/koog/ktor/utils/LLMModelParser.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ private val ANTHROPIC_MODELS_MAP = mapOf(
242242
"opus_3" to AnthropicModels.Opus_3,
243243
"opus_4" to AnthropicModels.Opus_4,
244244
"opus_4_1" to AnthropicModels.Opus_4_1,
245+
"opus_4_5" to AnthropicModels.Opus_4_5,
245246
"haiku_3" to AnthropicModels.Haiku_3,
246247
"haiku_3_5" to AnthropicModels.Haiku_3_5,
247248
"haiku_4_5" to AnthropicModels.Haiku_4_5,

koog-ktor/src/commonTest/kotlin/ai/koog/ktor/ModelIdentifierParsingTest.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,12 @@ class ModelIdentifierParsingTest {
182182
assertEquals(LLMProvider.Anthropic, opus4_1.provider)
183183
assertEquals(AnthropicModels.Opus_4_1, opus4_1)
184184

185+
// Test Opus 4.5
186+
val opus4_5 = getModelFromIdentifier("anthropic.opus_4_5")
187+
assertNotNull(opus4_5)
188+
assertEquals(LLMProvider.Anthropic, opus4_5.provider)
189+
assertEquals(AnthropicModels.Opus_4_5, opus4_5)
190+
185191
// Test Haiku 3
186192
val haiku3 = getModelFromIdentifier("anthropic.haiku_3")
187193
assertNotNull(haiku3)

prompt/prompt-executor/prompt-executor-clients/prompt-executor-anthropic-client/src/commonMain/kotlin/ai/koog/prompt/executor/clients/anthropic/AnthropicModels.kt

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import ai.koog.prompt.executor.clients.anthropic.AnthropicModels.Haiku_4_5
77
import ai.koog.prompt.executor.clients.anthropic.AnthropicModels.Opus_3
88
import ai.koog.prompt.executor.clients.anthropic.AnthropicModels.Opus_4
99
import ai.koog.prompt.executor.clients.anthropic.AnthropicModels.Opus_4_1
10+
import ai.koog.prompt.executor.clients.anthropic.AnthropicModels.Opus_4_5
1011
import ai.koog.prompt.executor.clients.anthropic.AnthropicModels.Sonnet_3_5
1112
import ai.koog.prompt.executor.clients.anthropic.AnthropicModels.Sonnet_3_7
1213
import ai.koog.prompt.executor.clients.anthropic.AnthropicModels.Sonnet_4
@@ -28,6 +29,7 @@ import ai.koog.prompt.llm.LLModel
2829
* | [Sonnet_4] | Fast | $3-$15 | Text, Image, Tools, Document | Text, Tools |
2930
* | [Opus_4] | Moderately fast | $15-$75 | Text, Image, Tools, Document | Text, Tools |
3031
* | [Opus_4_1] | Moderately fast | $15-$75 | Text, Image, Tools, Document | Text, Tools |
32+
* | [Opus_4_5] | Moderately fast | $5-$25 | Text, Image, Tools, Document | Text, Tools |
3133
* | [Sonnet_4_5] | Fast | $3-$15 | Text, Image, Tools, Document | Text, Tools |
3234
* | [Haiku_4_5] | Fastest | $1-$5 | Text, Image, Tools, Document | Text, Tools |
3335
*/
@@ -222,6 +224,31 @@ public object AnthropicModels : LLModelDefinitions {
222224
maxOutputTokens = 32_000,
223225
)
224226

227+
/**
228+
* Claude Opus 4.5 is Anthropic's premium model combining maximum intelligence with practical performance.
229+
* It’s intelligent, efficient, and the best model in the world for coding, agents, and computer use.
230+
* It’s also meaningfully better at everyday tasks like deep research and working with slides and spreadsheets.
231+
*
232+
* 200K context window
233+
* Knowledge cutoff: August 2025
234+
*
235+
* @see <a href="https://docs.anthropic.com/claude/docs/models-overview">
236+
*/
237+
public val Opus_4_5: LLModel = LLModel(
238+
provider = LLMProvider.Anthropic,
239+
id = "claude-opus-4-5",
240+
capabilities = listOf(
241+
LLMCapability.Temperature,
242+
LLMCapability.Tools,
243+
LLMCapability.ToolChoice,
244+
LLMCapability.Vision.Image,
245+
LLMCapability.Document,
246+
LLMCapability.Completion
247+
),
248+
contextLength = 200_000,
249+
maxOutputTokens = 64_000,
250+
)
251+
225252
/**
226253
* Claude Sonnet 4.5 is Anthropic's best model for complex agents and coding.
227254
* It has the highest level of intelligence across most tasks with exceptional agent and coding capabilities.
@@ -280,6 +307,7 @@ internal val DEFAULT_ANTHROPIC_MODEL_VERSIONS_MAP: Map<LLModel, String> = mapOf(
280307
Sonnet_4 to "claude-sonnet-4-20250514",
281308
Opus_4 to "claude-opus-4-20250514",
282309
Opus_4_1 to "claude-opus-4-1-20250805",
310+
Opus_4_5 to "claude-opus-4-5-20251101",
283311
Sonnet_4_5 to "claude-sonnet-4-5-20250929",
284312
Haiku_4_5 to "claude-haiku-4-5-20251001",
285313
)

prompt/prompt-executor/prompt-executor-clients/prompt-executor-bedrock-client/src/jvmMain/kotlin/ai/koog/prompt/executor/clients/bedrock/BedrockModels.kt

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,7 @@ public object BedrockModels : LLModelDefinitions {
167167
).effectiveModel
168168

169169
/**
170-
* Claude 4.1 Opus - Anthropic's most capable model
171-
*
172-
* This model sets new standards in:
170+
* Claude 4.1 Opus sets new standards in:
173171
* - Complex reasoning and advanced coding
174172
* - Autonomous management of complex, multi-step tasks
175173
* - Extended thinking for deeper reasoning
@@ -183,6 +181,18 @@ public object BedrockModels : LLModelDefinitions {
183181
"anthropic.claude-opus-4-1-20250805-v1:0",
184182
).effectiveModel
185183

184+
/**
185+
* Claude 4.5 Opus - Anthropic's intelligent, efficient, and the best model in the world for coding, agents,
186+
* and computer use.
187+
* It’s also meaningfully better at everyday tasks like deep research and working with slides and spreadsheets.
188+
* Opus 4.5 is a step forward in what AI systems can do, and a preview of larger changes to how work gets done.
189+
*
190+
*/
191+
public val AnthropicClaude45Opus: LLModel = BedrockModel(
192+
AnthropicModels.Opus_4_5.withoutMultimodalCapabilities(),
193+
"anthropic.claude-opus-4-5-20251101-v1:0",
194+
).effectiveModel
195+
186196
/**
187197
* Claude 4 Sonnet - High-performance model with exceptional reasoning and efficiency
188198
*

0 commit comments

Comments
 (0)