import { Stack, Group, Text, TextInput, NumberInput } from '@mantine/core'; import { useState, useEffect } from 'react'; import { InfoTooltip } from '@/components/InfoTooltip'; import { CheckboxWithTooltip } from '@/components/CheckboxWithTooltip'; import { useLaunchConfig } from '@/hooks/useLaunchConfig'; import { safeExecute } from '@/utils/logger'; export const AdvancedTab = () => { const { additionalArguments, noshift, flashattention, noavx2, failsafe, lowvram, quantmatmul, usemmap, backend, moecpu, moeexperts, handleAdditionalArgumentsChange, handleNoshiftChange, handleFlashattentionChange, handleNoavx2Change, handleFailsafeChange, handleLowvramChange, handleQuantmatmulChange, handleUsemmapChange, handleMoecpuChange, handleMoeexpertsChange, } = useLaunchConfig(); const [backendSupport, setBackendSupport] = useState<{ noavx2: boolean; failsafe: boolean; } | null>(null); const [isLoading, setIsLoading] = useState(true); const isGpuBackend = backend === 'cuda' || backend === 'rocm'; useEffect(() => { const detectBackendSupport = async () => { const support = await safeExecute( () => window.electronAPI.kobold.detectBackendSupport(), 'Failed to detect backend support:' ); if (support) { setBackendSupport({ noavx2: support.noavx2, failsafe: support.failsafe, }); } else { setBackendSupport({ noavx2: false, failsafe: false }); } setIsLoading(false); }; void detectBackendSupport(); }, []); return (
Performance Options handleNoshiftChange(!checked)} label="Context Shift" tooltip="Use Context Shifting to reduce reprocessing." />
Mixture of Experts (MoE) Settings
MoE Experts handleMoeexpertsChange(Number(value) || -1) } min={-1} max={128} step={1} size="sm" placeholder="-1" />
MoE CPU Layers handleMoecpuChange(Number(value) || 0)} min={0} max={999} step={1} size="sm" placeholder="0" />
Additional arguments handleAdditionalArgumentsChange(event.currentTarget.value) } />
); };