@@ -671,6 +760,82 @@ const localModelOptions = (catalog: ModelArtifacts): LocalModelChoice[] =>
const localComputeLabel = (runtime: LocalModelChoice["runtime"]): string =>
runtime === "vllm" ? "Requires an NVIDIA GPU" : "Runs on CPU";
+const localTierLabel = (tier: LocalModelChoice["tier"]): string => {
+ if (tier === "maximum") return "Maximum capability";
+ return tier.charAt(0).toUpperCase() + tier.slice(1);
+};
+
+const ModelDownloadConfirmation = ({
+ model,
+ onCancel,
+ onConfirm,
+}: {
+ model: LocalModelChoice | null;
+ onCancel: () => void;
+ onConfirm: () => void;
+}) => (
+
+);
+
+const formatDurationRange = (minimum: number, maximum: number): string =>
+ `${formatDuration(minimum)} to ${formatDuration(maximum)}`;
+
+const formatDuration = (seconds: number): string => {
+ if (seconds < 60) return `${seconds} seconds`;
+ const minutes = Math.ceil(seconds / 60);
+ return `${minutes} minute${minutes === 1 ? "" : "s"}`;
+};
+
const CustomLocalModelSetup = ({
downloads,
onDownload,
@@ -694,6 +859,7 @@ const CustomLocalModelSetup = ({
const [importRevision, setImportRevision] = useState("");
const [importLicense, setImportLicense] = useState("");
const [importComplete, setImportComplete] = useState(false);
+ const [confirmDownload, setConfirmDownload] = useState(false);
const modelDownload =
plan === null ? undefined : (
downloads.find((item) => item.model_id === plan.model.model_id)
@@ -846,7 +1012,7 @@ const CustomLocalModelSetup = ({
modelDownload?.status === "ready"
}
isPending={pending || modelDownload?.status === "downloading"}
- onClick={() => void download()}
+ onClick={() => setConfirmDownload(true)}
>
{modelDownload?.status === "ready" ?
@@ -855,6 +1021,14 @@ const CustomLocalModelSetup = ({
"Downloaded"
: "Download model"}
+
setConfirmDownload(false)}
+ onConfirm={() => {
+ setConfirmDownload(false);
+ void download();
+ }}
+ />
: null}