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
13 changes: 7 additions & 6 deletions apps/storybook/stories/claw/AutoModelPicker.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import type { ModelOption } from '@/components/shared/ModelCombobox';
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';

const SAMPLE_MODELS: ModelOption[] = [
{ id: 'kilo-auto/frontier', name: 'Auto Frontier' },
{ id: 'kilo-auto/balanced', name: 'Auto Balanced' },
{ id: 'kilo-auto/efficient', name: 'Auto Efficient' },
{ id: 'kilo-auto/frontier', name: 'Auto Frontier (deprecated)' },
{ id: 'kilo-auto/balanced', name: 'Auto Balanced (deprecated)' },
{ id: 'anthropic/claude-opus-4.6', name: 'Anthropic: Claude Opus 4.6' },
{ id: 'anthropic/claude-sonnet-4.5', name: 'Anthropic: Claude Sonnet 4.5' },
{ id: 'openai/gpt-5.2', name: 'OpenAI: GPT-5.2' },
Expand All @@ -22,7 +23,7 @@ const meta: Meta<typeof AutoModelPicker> = {
},
args: {
models: SAMPLE_MODELS,
value: 'kilo-auto/frontier',
value: 'kilo-auto/efficient',
},
decorators: [
Story => (
Expand All @@ -48,13 +49,13 @@ const meta: Meta<typeof AutoModelPicker> = {
export default meta;
type Story = StoryObj<typeof meta>;

export const FrontierSelected: Story = {
export const EfficientSelected: Story = {
args: {
value: 'kilo-auto/frontier',
value: 'kilo-auto/efficient',
},
};

export const BalancedSelected: Story = {
export const DeprecatedBalancedSelected: Story = {
args: {
value: 'kilo-auto/balanced',
},
Expand Down
29 changes: 9 additions & 20 deletions apps/web/src/app/(app)/claw/components/AutoModelPicker.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
'use client';

import { useMemo, useState } from 'react';
import { CheckCircle2, ChevronDown, Scale, Zap } from 'lucide-react';
import { CheckCircle2, ChevronDown, Scale } from 'lucide-react';
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '@/components/ui/collapsible';
import { ModelCombobox, type ModelOption } from '@/components/shared/ModelCombobox';
import { cn } from '@/lib/utils';
import { KILO_AUTO_BALANCED_MODEL, KILO_AUTO_FRONTIER_MODEL } from '@/lib/ai-gateway/auto-model';
import { KILO_AUTO_EFFICIENT_MODEL } from '@/lib/ai-gateway/auto-model';

const AUTO_CARD_MODEL_IDS = new Set([KILO_AUTO_FRONTIER_MODEL.id, KILO_AUTO_BALANCED_MODEL.id]);
const AUTO_CARD_MODEL_IDS = new Set([KILO_AUTO_EFFICIENT_MODEL.id]);

type CostLevel = 0 | 1 | 2 | 3;
type PerformanceLevel = 1 | 2 | 3;
Expand All @@ -16,7 +16,7 @@ type AutoModelCard = {
id: string;
label: string;
description: string;
icon: typeof Zap;
icon: typeof Scale;
iconBg: string;
iconColor: string;
cost: CostLevel;
Expand All @@ -26,24 +26,13 @@ type AutoModelCard = {

const autoModelCards: AutoModelCard[] = [
{
id: KILO_AUTO_FRONTIER_MODEL.id,
label: 'Frontier',
description: KILO_AUTO_FRONTIER_MODEL.description,
icon: Zap,
iconBg: 'bg-purple-500/20',
iconColor: 'text-purple-400',
cost: 3,
performance: 3,
performanceDotColor: 'bg-purple-400',
},
{
id: KILO_AUTO_BALANCED_MODEL.id,
label: 'Balanced',
description: KILO_AUTO_BALANCED_MODEL.description,
id: KILO_AUTO_EFFICIENT_MODEL.id,
label: 'Efficient',
description: KILO_AUTO_EFFICIENT_MODEL.description,
icon: Scale,
iconBg: 'bg-blue-500/20',
iconColor: 'text-blue-400',
cost: 2,
cost: 1,
performance: 2,
performanceDotColor: 'bg-blue-400',
},
Expand Down Expand Up @@ -129,7 +118,7 @@ export function AutoModelPicker({
<legend className="text-muted-foreground pr-2 text-xs font-semibold tracking-wider uppercase">
Kilo Auto
</legend>
<div className="grid grid-cols-1 gap-3 sm:grid-cols-2">
<div className="grid grid-cols-1 gap-3">
{availableAutoCards.map(card => {
const selected = value === card.id;
const Icon = card.icon;
Expand Down
8 changes: 4 additions & 4 deletions apps/web/src/app/(app)/claw/components/ClawOnboardingFlow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { usePathname, useRouter, useSearchParams } from 'next/navigation';
import { useFeatureFlagVariantKey, usePostHog } from 'posthog-js/react';
import { toast } from 'sonner';
import { Loader2, TriangleAlert, X } from 'lucide-react';
import { KILO_AUTO_BALANCED_MODEL } from '@/lib/ai-gateway/auto-model';
import { KILO_AUTO_EFFICIENT_MODEL } from '@/lib/ai-gateway/auto-model';
import type { KiloClawDashboardStatus } from '@/lib/kiloclaw/types';
import { controllerVersionOk, gatewayStatusOk } from '@/lib/kiloclaw/types';
import { useKiloClawGatewayStatus, useKiloClawMutations } from '@/hooks/useKiloClaw';
Expand Down Expand Up @@ -443,20 +443,20 @@ function ClawOnboardingFlowInner({

function provisionInstance(userLocation?: string) {
posthog?.capture('claw_create_instance_clicked', {
selected_model: KILO_AUTO_BALANCED_MODEL.id,
selected_model: KILO_AUTO_EFFICIENT_MODEL.id,
});
handleCreateFlowStarted();

mutations.provision.mutate(
{
kilocodeDefaultModel: `kilocode/${KILO_AUTO_BALANCED_MODEL.id}`,
kilocodeDefaultModel: `kilocode/${KILO_AUTO_EFFICIENT_MODEL.id}`,
userTimezone: getBrowserTimeZone(),
...(userLocation ? { userLocation } : undefined),
},
{
onError: err => {
posthog?.capture('claw_setup_provision_failed', {
selected_model: KILO_AUTO_BALANCED_MODEL.id,
selected_model: KILO_AUTO_EFFICIENT_MODEL.id,
reason: 'provision_request_failed',
});
handleCreateFlowFailed();
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/app/api/defaults/route.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { NextResponse } from 'next/server';
import { KILO_AUTO_BALANCED_MODEL, KILO_AUTO_FREE_MODEL } from '@/lib/ai-gateway/auto-model';
import { KILO_AUTO_EFFICIENT_MODEL, KILO_AUTO_FREE_MODEL } from '@/lib/ai-gateway/auto-model';

type DefaultsResponse = {
defaultModel: string;
Expand All @@ -8,7 +8,7 @@ type DefaultsResponse = {

export async function GET(): Promise<NextResponse<DefaultsResponse>> {
return NextResponse.json({
defaultModel: KILO_AUTO_BALANCED_MODEL.id,
defaultModel: KILO_AUTO_EFFICIENT_MODEL.id,
defaultFreeModel: KILO_AUTO_FREE_MODEL.id,
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {
SelectValue,
} from '@/components/ui/select';
import type { OrganizationSettings } from '@/lib/organizations/organization-types';
import { KILO_AUTO_BALANCED_MODEL, ORG_AUTO_MODEL } from '@/lib/ai-gateway/auto-model';
import { KILO_AUTO_EFFICIENT_MODEL, ORG_AUTO_MODEL } from '@/lib/ai-gateway/auto-model';
import {
hasActiveOrganizationModelPolicy,
isOrganizationAutoTargetModel,
Expand Down Expand Up @@ -189,7 +189,7 @@ export function DefaultModelDialog({
}),
[availableModels, hasActiveModelPolicy]
);
const defaultAutoFallback = hasActiveModelPolicy ? '' : KILO_AUTO_BALANCED_MODEL.id;
const defaultAutoFallback = hasActiveModelPolicy ? '' : KILO_AUTO_EFFICIENT_MODEL.id;
const fallbackUnavailable =
!!organizationAutoFallbackModel &&
!autoTargetModels.some(model => model.id === organizationAutoFallbackModel);
Expand Down
5 changes: 3 additions & 2 deletions apps/web/src/lib/ai-gateway/auto-model/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export const BALANCED_QWEN_MODEL: ResolvedAutoModel = {

export const KILO_AUTO_FRONTIER_MODEL: AutoModel = {
id: 'kilo-auto/frontier',
name: 'Auto Frontier',
name: 'Auto Frontier (deprecated)',
description: 'Highest performance and capability for any task.',
context_length: 1_000_000,
max_completion_tokens: 128_000,
Expand Down Expand Up @@ -125,7 +125,7 @@ export const KILO_AUTO_FREE_MODEL: AutoModel = {

export const KILO_AUTO_BALANCED_MODEL: AutoModel = {
id: 'kilo-auto/balanced',
name: 'Auto Balanced',
name: 'Auto Balanced (deprecated)',
description: 'Great balance of price and capability.',
context_length: 1_000_000,
max_completion_tokens: 65_536,
Expand Down Expand Up @@ -171,6 +171,7 @@ export const ORG_AUTO_MODEL: AutoModel = {
export const ORGANIZATION_AUTO_TARGET_MODELS = [
KILO_AUTO_FREE_MODEL.id,
KILO_AUTO_SMALL_MODEL.id,
KILO_AUTO_EFFICIENT_MODEL.id,
KILO_AUTO_BALANCED_MODEL.id,
KILO_AUTO_FRONTIER_MODEL.id,
] as const;
Expand Down
9 changes: 1 addition & 8 deletions apps/web/src/lib/ai-gateway/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@
* Utility functions for working with AI models
*/

import {
KILO_AUTO_BALANCED_MODEL,
KILO_AUTO_EFFICIENT_MODEL,
KILO_AUTO_FREE_MODEL,
KILO_AUTO_FRONTIER_MODEL,
} from '@/lib/ai-gateway/auto-model';
import { KILO_AUTO_EFFICIENT_MODEL, KILO_AUTO_FREE_MODEL } from '@/lib/ai-gateway/auto-model';
import {
claude_opus_4_8_stealth_model,
claude_opus_4_7_stealth_model,
Expand Down Expand Up @@ -62,8 +57,6 @@ export function selectAutoFreeModel(candidates: ReadonlyArray<AutoFreeModel>, ra
}

export const preferredModels = [
Comment thread
chrarnoldus marked this conversation as resolved.
KILO_AUTO_FRONTIER_MODEL.id,
KILO_AUTO_BALANCED_MODEL.id,
KILO_AUTO_EFFICIENT_MODEL.id,
KILO_AUTO_FREE_MODEL.id,

Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/lib/bot/constants.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { KILO_AUTO_FRONTIER_MODEL, KILO_AUTO_SMALL_MODEL } from '@/lib/ai-gateway/auto-model';
import { KILO_AUTO_EFFICIENT_MODEL, KILO_AUTO_SMALL_MODEL } from '@/lib/ai-gateway/auto-model';

export const BOT_VERSION = '5.1.0';
export const BOT_USER_AGENT = `Kilo-Code/${BOT_VERSION}`;
export const DEFAULT_BOT_MODEL = KILO_AUTO_FRONTIER_MODEL.id;
export const DEFAULT_BOT_MODEL = KILO_AUTO_EFFICIENT_MODEL.id;
export const MAX_ITERATIONS = 5;
export const BOT_CONTEXT_MESSAGE_LIMIT = 12;
export const SUMMARY_MODEL = KILO_AUTO_SMALL_MODEL.id;
4 changes: 2 additions & 2 deletions apps/web/src/lib/organizations/organization-auto-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
} from '@/lib/ai-gateway/providers/direct-byok';
import { getBYOKforOrganization } from '@/lib/ai-gateway/byok';
import { readDb, type DrizzleTransaction } from '@/lib/drizzle';
import { KILO_AUTO_BALANCED_MODEL, ORG_AUTO_MODEL } from '@/lib/ai-gateway/auto-model';
import { KILO_AUTO_EFFICIENT_MODEL, ORG_AUTO_MODEL } from '@/lib/ai-gateway/auto-model';
import { isPublicIdExperimented } from '@/lib/ai-gateway/experiments/membership';
import { isReleaseToggleEnabled } from '@/lib/posthog-feature-flags';
import { TRPCError } from '@trpc/server';
Expand All @@ -32,7 +32,7 @@ type OrganizationAutoPolicyOrganization = Pick<Organization, 'id' | 'plan' | 'se

export const DEFAULT_ORGANIZATION_AUTO_MODEL_SETTINGS: OrganizationAutoModelSettings = {
routes: {},
fallback_model: KILO_AUTO_BALANCED_MODEL.id,
fallback_model: KILO_AUTO_EFFICIENT_MODEL.id,
};

export function isOrganizationAutoEligible(organization: Pick<Organization, 'plan'>): boolean {
Expand Down