diff --git a/frontend/src/components/LLMSelection/KoboldCPPOptions/index.jsx b/frontend/src/components/LLMSelection/KoboldCPPOptions/index.jsx index 98c70785c51..57fedc62bcf 100644 --- a/frontend/src/components/LLMSelection/KoboldCPPOptions/index.jsx +++ b/frontend/src/components/LLMSelection/KoboldCPPOptions/index.jsx @@ -1,47 +1,116 @@ -import { useState, useEffect } from "react"; +import { useEffect, useState } from "react"; import System from "@/models/system"; +import PreLoader from "@/components/Preloader"; +import { KOBOLDCPP_COMMON_URLS } from "@/utils/constants"; +import { CaretDown, CaretUp } from "@phosphor-icons/react"; +import useProviderEndpointAutoDiscovery from "@/hooks/useProviderEndpointAutoDiscovery"; export default function KoboldCPPOptions({ settings }) { - const [basePathValue, setBasePathValue] = useState( - settings?.KoboldCPPBasePath + const { + autoDetecting: loading, + basePath, + basePathValue, + showAdvancedControls, + setShowAdvancedControls, + handleAutoDetectClick, + } = useProviderEndpointAutoDiscovery({ + provider: "koboldcpp", + initialBasePath: settings?.KoboldCPPBasePath, + ENDPOINTS: KOBOLDCPP_COMMON_URLS, + }); + + const [tokenLimit, setTokenLimit] = useState( + settings?.KoboldCPPTokenLimit || 4096 ); - const [basePath, setBasePath] = useState(settings?.KoboldCPPBasePath); + + const handleTokenLimitChange = (e) => { + setTokenLimit(Number(e.target.value)); + }; return ( -
+ Maximum number of tokens for context and response. +
++ Enter the URL where KoboldCPP is running. +
++ Choose the KoboldCPP model you want to use for your conversations. +