From 7568404efbcdb6353e8b0851e60aab1c0c38084c Mon Sep 17 00:00:00 2001 From: "kiloconnect[bot]" <240665456+kiloconnect[bot]@users.noreply.github.com> Date: Thu, 21 May 2026 11:38:46 +0000 Subject: [PATCH 1/3] feat(models): add Claude Opus 4.7 Optimized via Martian gateway Adds anthropic/claude-opus-4-7:optimized as a Kilo-exclusive model hosted by Martian. Reasoning defaults to high (first variant), and the description warns users that the provider may train on their data. --- apps/web/src/lib/ai-gateway/models.ts | 2 ++ .../providers/anthropic.constants.ts | 18 ++++++++++++++++++ .../lib/ai-gateway/providers/model-settings.ts | 17 ++++++++++++++++- 3 files changed, 36 insertions(+), 1 deletion(-) diff --git a/apps/web/src/lib/ai-gateway/models.ts b/apps/web/src/lib/ai-gateway/models.ts index 25669c48ff..c2022ae48b 100644 --- a/apps/web/src/lib/ai-gateway/models.ts +++ b/apps/web/src/lib/ai-gateway/models.ts @@ -10,6 +10,7 @@ import { } from '@/lib/ai-gateway/auto-model'; import { CLAUDE_OPUS_CURRENT_MODEL_ID, + claude_opus_4_7_optimized_model, claude_sonnet_clawsetup_model, CLAUDE_SONNET_CURRENT_MODEL_ID, } from '@/lib/ai-gateway/providers/anthropic.constants'; @@ -91,6 +92,7 @@ export const kiloExclusiveModels = [ ...alibabaDirectModels, claude_sonnet_clawsetup_model, stepfun_35_flash_free_model, + claude_opus_4_7_optimized_model, ] as KiloExclusiveModel[]; export function isKiloStealthModel(model: string): boolean { diff --git a/apps/web/src/lib/ai-gateway/providers/anthropic.constants.ts b/apps/web/src/lib/ai-gateway/providers/anthropic.constants.ts index 8272fafb07..88cbe99b31 100644 --- a/apps/web/src/lib/ai-gateway/providers/anthropic.constants.ts +++ b/apps/web/src/lib/ai-gateway/providers/anthropic.constants.ts @@ -4,10 +4,28 @@ export const CLAUDE_SONNET_CURRENT_MODEL_ID = 'anthropic/claude-sonnet-4.6'; export const CLAUDE_OPUS_CURRENT_MODEL_ID = 'anthropic/claude-opus-4.7'; export const CLAUDE_HAIKU_CURRENT_MODEL_ID = 'anthropic/claude-haiku-4.5'; +export const CLAUDE_OPUS_4_7_OPTIMIZED_MODEL_ID = 'anthropic/claude-opus-4-7:optimized'; + export const CLAUDE_SONNET_CURRENT_VERCEL_MODEL_ID = CLAUDE_SONNET_CURRENT_MODEL_ID; export const CLAUDE_OPUS_CURRENT_VERCEL_MODEL_ID = CLAUDE_OPUS_CURRENT_MODEL_ID; export const CLAUDE_HAIKU_CURRENT_VERCEL_MODEL_ID = CLAUDE_HAIKU_CURRENT_MODEL_ID; +export const claude_opus_4_7_optimized_model: KiloExclusiveModel = { + public_id: CLAUDE_OPUS_4_7_OPTIMIZED_MODEL_ID, + internal_id: CLAUDE_OPUS_4_7_OPTIMIZED_MODEL_ID, + display_name: 'Claude Opus 4.7 Optimized', + description: + 'A custom-optimized variant of Claude Opus 4.7, exclusively available on Kilo Code and hosted by [Martian](https://withmartian.com). **Note:** This is a third-party optimized model and your prompts and completions may be used to train or improve the provider\'s services.', + context_length: 200_000, + max_completion_tokens: 32_000, + status: 'public', + flags: ['reasoning', 'vision'], + gateway: 'martian', + pricing: null, + exclusive_to: [], + inference_provider_restriction: [], +}; + export const claude_sonnet_clawsetup_model: KiloExclusiveModel = { public_id: CLAUDE_SONNET_CURRENT_MODEL_ID + ':clawsetup', internal_id: CLAUDE_SONNET_CURRENT_MODEL_ID, diff --git a/apps/web/src/lib/ai-gateway/providers/model-settings.ts b/apps/web/src/lib/ai-gateway/providers/model-settings.ts index 2e2250f7a3..43222acd55 100644 --- a/apps/web/src/lib/ai-gateway/providers/model-settings.ts +++ b/apps/web/src/lib/ai-gateway/providers/model-settings.ts @@ -1,4 +1,8 @@ -import { isClaudeModel, isOpusModel } from '@/lib/ai-gateway/providers/anthropic.constants'; +import { + isClaudeModel, + isOpusModel, + CLAUDE_OPUS_4_7_OPTIMIZED_MODEL_ID, +} from '@/lib/ai-gateway/providers/anthropic.constants'; import { isGemini3Model, isGemmaModel } from '@/lib/ai-gateway/providers/google'; import { isKimiModel } from '@/lib/ai-gateway/providers/moonshotai'; import { isOpenAiModel } from '@/lib/ai-gateway/providers/openai'; @@ -36,6 +40,17 @@ export const REASONING_VARIANTS_NONE_LOW_MEDIUM_HIGH = { } as const; export function getModelVariants(model: string): OpenCodeSettings['variants'] { + if (model === CLAUDE_OPUS_4_7_OPTIMIZED_MODEL_ID) { + // Default to 'high' reasoning for this Martian-optimized variant + return { + high: { reasoning: { enabled: true, effort: 'high' }, verbosity: 'high' }, + xhigh: { reasoning: { enabled: true, effort: 'xhigh' }, verbosity: 'xhigh' }, + max: { reasoning: { enabled: true, effort: 'xhigh' }, verbosity: 'max' }, + medium: { reasoning: { enabled: true, effort: 'medium' }, verbosity: 'medium' }, + low: { reasoning: { enabled: true, effort: 'low' }, verbosity: 'low' }, + none: { reasoning: { enabled: false, effort: 'none' } }, + }; + } if (isOpusModel(model) && model.includes('4.7')) { return { none: { reasoning: { enabled: false, effort: 'none' } }, From 363cb526d564f25cd3bf6b80dbe3bc0349130471 Mon Sep 17 00:00:00 2001 From: "kiloconnect[bot]" <240665456+kiloconnect[bot]@users.noreply.github.com> Date: Thu, 21 May 2026 11:44:12 +0000 Subject: [PATCH 2/3] feat(models): set Claude Opus 4.7 Optimized pricing at 20% off list List price: $5/$25 input/output per MTok. 20% discount: $4/$20. Cache read: $0.40/MTok, cache write: $5/MTok. --- .../providers/anthropic.constants.ts | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/apps/web/src/lib/ai-gateway/providers/anthropic.constants.ts b/apps/web/src/lib/ai-gateway/providers/anthropic.constants.ts index 88cbe99b31..1377f5d8d0 100644 --- a/apps/web/src/lib/ai-gateway/providers/anthropic.constants.ts +++ b/apps/web/src/lib/ai-gateway/providers/anthropic.constants.ts @@ -1,4 +1,8 @@ -import type { KiloExclusiveModel } from '@/lib/ai-gateway/providers/kilo-exclusive-model'; +import type { + KiloExclusiveModel, + Pricing, + Usage, +} from '@/lib/ai-gateway/providers/kilo-exclusive-model'; export const CLAUDE_SONNET_CURRENT_MODEL_ID = 'anthropic/claude-sonnet-4.6'; export const CLAUDE_OPUS_CURRENT_MODEL_ID = 'anthropic/claude-opus-4.7'; @@ -10,6 +14,19 @@ export const CLAUDE_SONNET_CURRENT_VERCEL_MODEL_ID = CLAUDE_SONNET_CURRENT_MODEL export const CLAUDE_OPUS_CURRENT_VERCEL_MODEL_ID = CLAUDE_OPUS_CURRENT_MODEL_ID; export const CLAUDE_HAIKU_CURRENT_VERCEL_MODEL_ID = CLAUDE_HAIKU_CURRENT_MODEL_ID; +// Anthropic list price for Claude Opus 4.7, minus 20% Kilo discount. +const OPUS_4_7_OPTIMIZED_PRICING: Pricing = { + prompt_per_million: 4, // $5 list * 0.8 + completion_per_million: 20, // $25 list * 0.8 + input_cache_read_per_million: 0.4, // $0.50 list * 0.8 + input_cache_write_per_million: 5, // $6.25 list * 0.8 + calculate_mUsd: (usage: Usage) => + usage.uncachedInputTokens * 4 + + usage.totalOutputTokens * 20 + + usage.cacheHitTokens * 0.4 + + usage.cacheWriteTokens * 5, +}; + export const claude_opus_4_7_optimized_model: KiloExclusiveModel = { public_id: CLAUDE_OPUS_4_7_OPTIMIZED_MODEL_ID, internal_id: CLAUDE_OPUS_4_7_OPTIMIZED_MODEL_ID, @@ -21,7 +38,7 @@ export const claude_opus_4_7_optimized_model: KiloExclusiveModel = { status: 'public', flags: ['reasoning', 'vision'], gateway: 'martian', - pricing: null, + pricing: OPUS_4_7_OPTIMIZED_PRICING, exclusive_to: [], inference_provider_restriction: [], }; From 90d166e67ec34e8203fbf9faac778edae6dbe16f Mon Sep 17 00:00:00 2001 From: Ari Messer Date: Thu, 21 May 2026 15:43:48 -0400 Subject: [PATCH 3/3] Change provider to stealth Updated the description of the Claude Opus 4.7 Optimized model to replace 'Martian' with 'a stealth inference partner'. --- apps/web/src/lib/ai-gateway/providers/anthropic.constants.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/src/lib/ai-gateway/providers/anthropic.constants.ts b/apps/web/src/lib/ai-gateway/providers/anthropic.constants.ts index 1377f5d8d0..e41717e2a5 100644 --- a/apps/web/src/lib/ai-gateway/providers/anthropic.constants.ts +++ b/apps/web/src/lib/ai-gateway/providers/anthropic.constants.ts @@ -32,7 +32,7 @@ export const claude_opus_4_7_optimized_model: KiloExclusiveModel = { internal_id: CLAUDE_OPUS_4_7_OPTIMIZED_MODEL_ID, display_name: 'Claude Opus 4.7 Optimized', description: - 'A custom-optimized variant of Claude Opus 4.7, exclusively available on Kilo Code and hosted by [Martian](https://withmartian.com). **Note:** This is a third-party optimized model and your prompts and completions may be used to train or improve the provider\'s services.', + 'A custom-optimized variant of Claude Opus 4.7, exclusively available on Kilo Code and hosted by a stealth inference partner. **Note:** This is a third-party optimized model and your prompts and completions may be used to train or improve the provider\'s services.', context_length: 200_000, max_completion_tokens: 32_000, status: 'public',