Skip to content

Commit 23c3511

Browse files
authored
Bump kilo-auto/balanced to 1M context (#2860)
Auto Balanced tweaks
1 parent 1ba94c6 commit 23c3511

4 files changed

Lines changed: 16 additions & 20 deletions

File tree

apps/web/src/lib/ai-gateway/kilo-auto/index.ts

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ export type ResolvedAutoModel = {
2929
verbosity?: Verbosity;
3030
};
3131

32-
export const GPT_53_CODEX_ID = 'openai/gpt-5.3-codex';
33-
3432
export const KILO_AUTO_LEGACY_MODEL = 'kilo/auto'; // hardcoded in upstream OpenClaw
3533

3634
export const modeSchema = z.enum([
@@ -78,14 +76,14 @@ export const FRONTIER_MODE_TO_MODEL: Record<Mode, ResolvedAutoModel> = {
7876
code: SONNET_FRONTIER,
7977
};
8078

81-
export const BALANCED_CODEX_MODEL: ResolvedAutoModel = {
82-
model: GPT_53_CODEX_ID,
79+
export const BALANCED_RESPONSES_FALLBACK_MODEL: ResolvedAutoModel = {
80+
model: 'openai/gpt-5.5',
8381
reasoning: { enabled: true, effort: 'low' },
8482
};
8583

86-
export const BALANCED_HAIKU_MODEL: ResolvedAutoModel = {
87-
model: 'anthropic/claude-haiku-4.5',
88-
reasoning: { enabled: true, effort: 'medium' },
84+
export const BALANCED_MESSAGES_FALLBACK_MODEL: ResolvedAutoModel = {
85+
model: CLAUDE_SONNET_CURRENT_MODEL_ID,
86+
reasoning: { enabled: true, effort: 'low' },
8987
};
9088

9189
export const BALANCED_CLAW_SETUP_MODEL: ResolvedAutoModel = {
@@ -137,7 +135,7 @@ export const KILO_AUTO_BALANCED_MODEL: AutoModel = {
137135
id: 'kilo-auto/balanced',
138136
name: 'Kilo Auto Balanced',
139137
description: 'Great balance of price and capability.',
140-
context_length: 400_000,
138+
context_length: 1_000_000,
141139
max_completion_tokens: 65_536,
142140
prompt_price: '0.000000325',
143141
completion_price: '0.00000195',
@@ -146,7 +144,7 @@ export const KILO_AUTO_BALANCED_MODEL: AutoModel = {
146144
supports_images: true,
147145
supports_pdf: false,
148146
opencode_settings: {
149-
ai_sdk_provider: 'openai-compatible',
147+
ai_sdk_provider: 'alibaba',
150148
},
151149
};
152150

apps/web/src/lib/ai-gateway/kilo-auto/resolution.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ import {
1616
modeSchema,
1717
BALANCED_CLAW_SETUP_MODEL,
1818
BALANCED_QWEN_MODEL,
19-
BALANCED_CODEX_MODEL,
19+
BALANCED_RESPONSES_FALLBACK_MODEL,
2020
FRONTIER_MODE_TO_MODEL,
2121
FRONTIER_CODE_MODEL,
2222
type ResolvedAutoModel,
2323
KILO_AUTO_LEGACY_MODEL,
24-
BALANCED_HAIKU_MODEL,
24+
BALANCED_MESSAGES_FALLBACK_MODEL,
2525
} from '@/lib/ai-gateway/kilo-auto';
2626
import { userIsWithinFirstKiloClawInstanceWindow } from '@/lib/kiloclaw/setup-promo';
2727
import { getRandomNumber } from '@/lib/ai-gateway/getRandomNumber';
@@ -121,10 +121,11 @@ export async function resolveAutoModel(
121121
// Alibaba doesn't expose a messages endpoint
122122
// and does not support prompt caching on the responses endpoint
123123
// so we use a fallback in those cases.
124+
// This should be rare, both CLI and KiloClaw default to chat completions.
124125
if (apiKind === 'responses') {
125-
return BALANCED_CODEX_MODEL;
126+
return BALANCED_RESPONSES_FALLBACK_MODEL;
126127
} else if (apiKind === 'messages') {
127-
return BALANCED_HAIKU_MODEL;
128+
return BALANCED_MESSAGES_FALLBACK_MODEL;
128129
} else {
129130
return BALANCED_QWEN_MODEL;
130131
}

apps/web/src/lib/ai-gateway/providers/model-settings.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,12 @@ export function getModelVariants(model: string): OpenCodeSettings['variants'] {
9595

9696
function getAiSdkProvider(model: string): CustomLlmProvider | undefined {
9797
if (qwen36_plus_model.public_id === model) {
98-
// with 'openai' prompt caching doesn't seem to work
99-
return 'openai-compatible';
98+
// with 'openai' (Responses) prompt caching doesn't work
99+
// with 'openai-compatible' (Chat Completions) cost is wrong (cache writes are not counted)
100+
return 'alibaba';
100101
}
101102
if (seed_20_pro_free_model.public_id === model) {
102-
// with 'openai' a bunch of bugs in vercel ai sdk v5 get triggered
103+
// with 'openai' (Responses API) prompt caching doesn't work
103104
return 'openai-compatible';
104105
}
105106
if (isAnthropicModel(model)) {

apps/web/src/lib/ai-gateway/providers/openai.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,3 @@ export function isOpenAiModel(requestedModel: string) {
99
export function isOpenAiOssModel(requestedModel: string) {
1010
return modelStartsWith(requestedModel, 'openai/gpt-oss');
1111
}
12-
13-
export const GPT_5_NANO_ID = 'openai/gpt-5-nano';
14-
15-
export const GPT_5_NANO_NAME = 'GPT-5 Nano';

0 commit comments

Comments
 (0)