Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions apps/web/src/lib/ai-gateway/kilo-auto/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
CLAUDE_SONNET_CURRENT_MODEL_ID,
} from '@/lib/ai-gateway/providers/anthropic.constants';
import type { OpenRouterReasoningConfig } from '@/lib/ai-gateway/providers/openrouter/types';
import type { ModelSettings, OpenCodeSettings, Verbosity } from '@kilocode/db/schema-types';
import type { OpenCodeSettings, Verbosity } from '@kilocode/db/schema-types';
import { qwen36_plus_model } from '@/lib/ai-gateway/providers/qwen';

type AutoModel = {
Expand All @@ -19,7 +19,6 @@ type AutoModel = {
input_cache_read_price: string | undefined;
input_cache_write_price: string | undefined;
supports_images: boolean;
roocode_settings: ModelSettings | undefined;
opencode_settings: OpenCodeSettings | undefined;
};

Expand Down Expand Up @@ -110,7 +109,6 @@ export const KILO_AUTO_FRONTIER_MODEL: AutoModel = {
input_cache_read_price: '0.0000005',
input_cache_write_price: '0.00000625',
supports_images: true,
roocode_settings: undefined,
opencode_settings: {
family: 'claude',
prompt: 'anthropic',
Expand All @@ -129,7 +127,6 @@ export const KILO_AUTO_FREE_MODEL: AutoModel = {
input_cache_read_price: '0',
input_cache_write_price: '0',
supports_images: false,
roocode_settings: undefined,
opencode_settings: undefined,
};

Expand All @@ -144,7 +141,6 @@ export const KILO_AUTO_BALANCED_MODEL: AutoModel = {
input_cache_read_price: '0.0000000325',
input_cache_write_price: '0.00000040625',
supports_images: true,
roocode_settings: undefined,
opencode_settings: {
ai_sdk_provider: 'openai-compatible',
},
Expand All @@ -161,7 +157,6 @@ export const KILO_AUTO_SMALL_MODEL: AutoModel = {
input_cache_read_price: '0.000000005',
input_cache_write_price: undefined,
supports_images: true,
roocode_settings: undefined,
opencode_settings: undefined,
};

Expand Down
33 changes: 1 addition & 32 deletions apps/web/src/lib/ai-gateway/providers/model-settings.ts
Original file line number Diff line number Diff line change
@@ -1,48 +1,17 @@
import { seed_20_pro_free_model } from '@/lib/ai-gateway/providers/bytedance';
import { isGemini3Model, isGeminiModel, isGemmaModel } from '@/lib/ai-gateway/providers/google';
import { isMinimaxModel } from '@/lib/ai-gateway/providers/minimax';
import { isGemini3Model, isGemmaModel } from '@/lib/ai-gateway/providers/google';
import { isMoonshotModel } from '@/lib/ai-gateway/providers/moonshotai';
import { isOpenAiModel } from '@/lib/ai-gateway/providers/openai';
import { qwen36_plus_model } from '@/lib/ai-gateway/providers/qwen';
import { isXaiModel } from '@/lib/ai-gateway/providers/xai';
import { isZaiModel } from '@/lib/ai-gateway/providers/zai';
import type {
CustomLlmProvider,
ModelSettings,
OpenClawModelSettings,
OpenCodeSettings,
VersionedSettings,
} from '@kilocode/db/schema-types';
import { ReasoningEffortSchema } from '@kilocode/db/schema-types';

export function getModelSettings(model: string): ModelSettings | undefined {
if (isOpenAiModel(model)) {
return {
included_tools: ['apply_patch'],
excluded_tools: ['apply_diff', 'delete_file', 'edit_file', 'write_to_file'],
};
}
if (isMinimaxModel(model)) {
return {
included_tools: ['search_and_replace'],
excluded_tools: ['apply_diff', 'edit_file'],
};
}
return undefined;
}

export function getVersionedModelSettings(model: string): VersionedSettings | undefined {
if (isGeminiModel(model) || isZaiModel(model)) {
return {
'4.146.0': {
included_tools: ['write_file', 'edit_file'],
excluded_tools: ['apply_diff'],
},
};
}
return undefined;
}

export const REASONING_VARIANTS_BINARY = {
instant: { reasoning: { enabled: false, effort: 'none' } },
thinking: { reasoning: { enabled: true, effort: 'medium' } },
Expand Down
5 changes: 0 additions & 5 deletions apps/web/src/lib/ai-gateway/providers/openrouter/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@ import { captureException, captureMessage } from '@sentry/nextjs';
import { convertFromKiloExclusiveModel } from '@/lib/ai-gateway/providers/kilo-exclusive-model';
import { isForbiddenFreeModel } from '@/lib/ai-gateway/forbidden-free-models';
import {
getModelSettings,
getOpenClawSettings,
getOpenCodeSettings,
getVersionedModelSettings,
} from '@/lib/ai-gateway/providers/model-settings';
import { AUTO_MODELS } from '@/lib/ai-gateway/kilo-auto';

Expand Down Expand Up @@ -48,7 +46,6 @@ function buildAutoModels(): OpenRouterModel[] {
},
context_length: m.context_length,
supported_parameters: ['max_tokens', 'temperature', 'tools', 'reasoning', 'include_reasoning'],
settings: m.roocode_settings,
opencode: m.opencode_settings,
}));
}
Expand Down Expand Up @@ -76,8 +73,6 @@ function enhancedModelList(models: OpenRouterModel[]) {
name: skipSuffix ? model.name : isNew ? model.name + ' (new)' : model.name,
preferredIndex: preferredIndex >= 0 ? preferredIndex : undefined,
isFree: isFreeModel(model.id),
settings: model.settings ?? getModelSettings(model.id),
versioned_settings: model.versioned_settings ?? getVersionedModelSettings(model.id),
opencode: model.opencode ?? getOpenCodeSettings(model.id),
openclaw: model.openclaw ?? getOpenClawSettings(model.id),
};
Expand Down
9 changes: 1 addition & 8 deletions apps/web/src/lib/organizations/organization-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,7 @@ export {

import type { OrganizationRole, OrganizationPlan } from './organization-base-types';
import { OrganizationPlanSchema, OrganizationSettingsSchema } from './organization-base-types';
import {
ModelSettingsSchema,
OpenClawModelSettingsSchema,
OpenCodeSettingsSchema,
VersionedSettingsSchema,
} from '@kilocode/db/schema-types';
import { OpenClawModelSettingsSchema, OpenCodeSettingsSchema } from '@kilocode/db/schema-types';

// API-facing billing cycle values: 'monthly' | 'annual'
// The DB stores 'yearly' instead of 'annual'; Stripe uses 'year'/'month'.
Expand Down Expand Up @@ -204,8 +199,6 @@ const OpenRouterModelSchema = z.object({
// kilocode additions:
preferredIndex: z.number().optional(),
isFree: z.boolean().optional(),
settings: ModelSettingsSchema.optional(),
versioned_settings: VersionedSettingsSchema.optional(),
opencode: OpenCodeSettingsSchema.optional(),
openclaw: OpenClawModelSettingsSchema.optional(),

Expand Down
26 changes: 0 additions & 26 deletions apps/web/src/scripts/roo-tool-settings.ts

This file was deleted.

28 changes: 0 additions & 28 deletions packages/db/src/schema-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -681,34 +681,6 @@ export const NormalizedOpenRouterResponse = z.object({
generated_at: z.string(),
});

// --- Model settings ---

export const ToolSchema = z.enum([
'apply_diff',
'apply_patch',
'delete_file',
'edit_file',
'search_replace',
'search_and_replace',
'write_file',
'write_to_file',
]);

export type Tool = z.infer<typeof ToolSchema>;

export const ToolArraySchema = z.array(ToolSchema);

export const ModelSettingsSchema = z.object({
included_tools: ToolArraySchema,
excluded_tools: ToolArraySchema,
});

export type ModelSettings = z.infer<typeof ModelSettingsSchema>;

export const VersionedSettingsSchema = z.record(z.string(), ModelSettingsSchema);

export type VersionedSettings = z.infer<typeof VersionedSettingsSchema>;

export const OpenCodePromptSchema = z.enum([
'codex',
'gemini',
Expand Down
Loading