Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
ec009f4
feat: add intelligent provider with difficulty-based profile selection
ivanarifin Nov 29, 2025
44592b8
feat(providers): add intelligent provider configuration constants
ivanarifin Nov 29, 2025
8ea66d8
Merge branch 'Kilo-Org:main' into auto-provider
ivanarifin Nov 29, 2025
b90aafd
refactor(intelligent): simplify task complexity classifier and add va…
ivanarifin Dec 1, 2025
0824610
Merge branch 'Kilo-Org:main' into auto-provider
ivanarifin Dec 1, 2025
5f0c544
optimize difficulty assessment to prevent redundant evaluations
ivanarifin Dec 1, 2025
3de1c7f
Merge branch 'Kilo-Org:main' into auto-provider
ivanarifin Dec 1, 2025
d4cc9b0
Merge branch 'Kilo-Org:main' into auto-provider
ivanarifin Dec 2, 2025
1f66f86
feat(i18n): add intelligent provider translations to all supported lo…
ivanarifin Dec 2, 2025
8d98975
Merge branch 'main' into auto-provider
ivanarifin Dec 2, 2025
9bfa5ed
Merge branch 'Kilo-Org:main' into auto-provider
ivanarifin Dec 4, 2025
840496f
feat(intelligent): add pre-assessed difficulty mechanism
ivanarifin Dec 5, 2025
1ea3b9e
Merge branch 'Kilo-Org:main' into auto-provider
ivanarifin Dec 5, 2025
93a7503
Merge branch 'Kilo-Org:main' into auto-provider
ivanarifin Dec 5, 2025
ff3b249
Merge branch 'main' into auto-provider
ivanarifin Dec 5, 2025
60285d3
Merge branch 'main' into auto-provider
ivanarifin Dec 5, 2025
856d9f3
Merge branch 'Kilo-Org:main' into auto-provider
ivanarifin Dec 6, 2025
117a72b
fix ts
ivanarifin Dec 6, 2025
d5e4096
refactor(intelligent): restructure handler management and extract types
ivanarifin Dec 6, 2025
157b580
fix(chat): remove preAssessedDifficulty parameter from onSend handler
ivanarifin Dec 6, 2025
744b693
refactor(task): remove preAssessedDifficulty field and parameters
ivanarifin Dec 6, 2025
13e48ae
Merge branch 'main' into auto-provider
ivanarifin Dec 10, 2025
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
1 change: 1 addition & 0 deletions cli/src/constants/providers/labels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export const PROVIDER_LABELS: Record<ProviderName, string> = {
inception: "Inception",
synthetic: "Synthetic",
"sap-ai-core": "SAP AI Core",
intelligent: "Intelligent Provider",
baseten: "BaseTen",
}

Expand Down
2 changes: 2 additions & 0 deletions cli/src/constants/providers/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ export const PROVIDER_TO_ROUTER_NAME: Record<ProviderName, RouterName | null> =
inception: null,
synthetic: null,
"sap-ai-core": null,
intelligent: null,
baseten: null,
}

Expand Down Expand Up @@ -216,6 +217,7 @@ export const PROVIDER_MODEL_FIELD: Record<ProviderName, string | null> = {
inception: "inceptionLabsModelId",
synthetic: null,
"sap-ai-core": "sapAiCoreModelId",
intelligent: null,
baseten: null,
}

Expand Down
1 change: 1 addition & 0 deletions cli/src/constants/providers/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1095,6 +1095,7 @@ export const PROVIDER_DEFAULT_MODELS: Record<ProviderName, string> = {
inception: "gpt-4o",
synthetic: "synthetic-model",
"sap-ai-core": "gpt-4o",
intelligent: "intelligent",
baseten: "zai-org/GLM-4.6",
}

Expand Down
1 change: 1 addition & 0 deletions cli/src/constants/providers/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export const PROVIDER_REQUIRED_FIELDS: Record<ProviderName, string[]> = {
vertex: [], // Has special validation logic (either/or fields)
"vscode-lm": [], // Has nested object validation
"virtual-quota-fallback": [], // Has array validation
intelligent: [], // Has array validation for profiles
minimax: ["minimaxBaseUrl", "minimaxApiKey", "apiModelId"],
baseten: ["basetenApiKey", "apiModelId"],
}
17 changes: 16 additions & 1 deletion packages/types/src/provider-settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ export const providerNames = [
"minimax",
"gemini-cli",
"virtual-quota-fallback",
"intelligent",
"synthetic",
"inception",
// kilocode_change end
Expand Down Expand Up @@ -479,6 +480,16 @@ export const virtualQuotaFallbackProfileDataSchema = z.object({
const virtualQuotaFallbackSchema = baseProviderSettingsSchema.extend({
profiles: z.array(virtualQuotaFallbackProfileDataSchema).optional(),
})

export const intelligentProfileSchema = z.object({
profileName: z.string().optional(),
profileId: z.string().optional(),
difficultyLevel: z.enum(["easy", "medium", "hard", "classifier"]).optional(),
})

const intelligentSchema = baseProviderSettingsSchema.extend({
profiles: z.array(intelligentProfileSchema).optional(),
})
// kilocode_change end

export const zaiApiLineSchema = z.enum(["international_coding", "china_coding"])
Expand Down Expand Up @@ -571,6 +582,7 @@ export const providerSettingsSchemaDiscriminated = z.discriminatedUnion("apiProv
geminiCliSchema.merge(z.object({ apiProvider: z.literal("gemini-cli") })),
kilocodeSchema.merge(z.object({ apiProvider: z.literal("kilocode") })),
virtualQuotaFallbackSchema.merge(z.object({ apiProvider: z.literal("virtual-quota-fallback") })),
intelligentSchema.merge(z.object({ apiProvider: z.literal("intelligent") })),
syntheticSchema.merge(z.object({ apiProvider: z.literal("synthetic") })),
inceptionSchema.merge(z.object({ apiProvider: z.literal("inception") })),
// kilocode_change end
Expand Down Expand Up @@ -610,6 +622,7 @@ export const providerSettingsSchema = z.object({
...geminiCliSchema.shape,
...kilocodeSchema.shape,
...virtualQuotaFallbackSchema.shape,
...intelligentSchema.shape,
...syntheticSchema.shape,
...ovhcloudSchema.shape,
...inceptionSchema.shape,
Expand Down Expand Up @@ -702,7 +715,7 @@ export const modelIdKeysByProvider: Record<TypicalProvider, ModelIdKey> = {
anthropic: "apiModelId",
"claude-code": "apiModelId",
glama: "glamaModelId",
"nano-gpt": "nanoGptModelId", // kilocode_change
"nano-gpt": "nanoGptModelId",
openrouter: "openRouterModelId",
kilocode: "kilocodeModel",
bedrock: "apiModelId",
Expand All @@ -727,6 +740,7 @@ export const modelIdKeysByProvider: Record<TypicalProvider, ModelIdKey> = {
ovhcloud: "ovhCloudAiEndpointsModelId",
inception: "inceptionLabsModelId",
"sap-ai-core": "sapAiCoreModelId",
intelligent: "apiModelId",
// kilocode_change end
groq: "apiModelId",
baseten: "apiModelId",
Expand Down Expand Up @@ -887,6 +901,7 @@ export const MODELS_BY_PROVIDER: Record<
inception: { id: "inception", label: "Inception", models: [] },
kilocode: { id: "kilocode", label: "Kilocode", models: [] },
"virtual-quota-fallback": { id: "virtual-quota-fallback", label: "Virtual Quota Fallback", models: [] },
intelligent: { id: "intelligent", label: "Intelligent Provider", models: [] },
// kilocode_change end
deepinfra: { id: "deepinfra", label: "DeepInfra", models: [] },
"vercel-ai-gateway": { id: "vercel-ai-gateway", label: "Vercel AI Gateway", models: [] },
Expand Down
22 changes: 22 additions & 0 deletions src/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import {
OVHcloudAIEndpointsHandler,
MiniMaxAnthropicHandler,
SapAiCoreHandler,
IntelligentHandler,
// kilocode_change end
ClaudeCodeHandler,
QwenCodeHandler,
Expand Down Expand Up @@ -110,6 +111,25 @@ export interface ApiHandlerCreateMessageMetadata {
* Used by providers to determine whether to include native tool definitions.
*/
toolProtocol?: ToolProtocol
/**
* Profile ID to use for difficulty classification in IntelligentHandler.
* If not provided, defaults to using the easy handler profile.
*/
classifierProfileId?: string
/**
* Raw user prompt from the UI input, used by IntelligentHandler for difficulty assessment.
*/
rawUserPrompt?: string
/**
* The current user prompt for difficulty assessment in IntelligentHandler.
* Only passed on initial messages to avoid redundant assessments.
*/
userPrompt?: string
/**
* Indicates whether this is the initial message for difficulty assessment.
* IntelligentHandler only assesses difficulty once per user message.
*/
isInitialMessage?: boolean
/**
* Controls whether the model can return multiple tool calls in a single response.
* When true, parallel tool calls are enabled (OpenAI's parallel_tool_calls=true).
Expand Down Expand Up @@ -241,6 +261,8 @@ export function buildApiHandler(configuration: ProviderSettings): ApiHandler {
return new FeatherlessHandler(options)
case "vercel-ai-gateway":
return new VercelAiGatewayHandler(options)
case "intelligent":
return new IntelligentHandler(options)
case "minimax":
return new MiniMaxAnthropicHandler(options) // kilocode_change: anthropic
case "baseten":
Expand Down
Loading
Loading