2024-01-04 15:54:31 -08:00
|
|
|
import PreLoader from "@/components/Preloader";
|
2023-12-07 09:09:01 -08:00
|
|
|
import System from "@/models/system";
|
|
|
|
import AnythingLLMIcon from "@/media/logo/anything-llm-icon.png";
|
|
|
|
import OpenAiLogo from "@/media/llmprovider/openai.png";
|
|
|
|
import AzureOpenAiLogo from "@/media/llmprovider/azure.png";
|
|
|
|
import AnthropicLogo from "@/media/llmprovider/anthropic.png";
|
2023-12-27 17:08:03 -08:00
|
|
|
import GeminiLogo from "@/media/llmprovider/gemini.png";
|
2023-12-27 17:21:47 -08:00
|
|
|
import OllamaLogo from "@/media/llmprovider/ollama.png";
|
2024-01-10 12:35:30 -08:00
|
|
|
import TogetherAILogo from "@/media/llmprovider/togetherai.png";
|
2023-12-07 09:09:01 -08:00
|
|
|
import LMStudioLogo from "@/media/llmprovider/lmstudio.png";
|
|
|
|
import LocalAiLogo from "@/media/llmprovider/localai.png";
|
|
|
|
import ChromaLogo from "@/media/vectordbs/chroma.png";
|
|
|
|
import PineconeLogo from "@/media/vectordbs/pinecone.png";
|
|
|
|
import LanceDbLogo from "@/media/vectordbs/lancedb.png";
|
|
|
|
import WeaviateLogo from "@/media/vectordbs/weaviate.png";
|
|
|
|
import QDrantLogo from "@/media/vectordbs/qdrant.png";
|
2024-01-04 15:54:31 -08:00
|
|
|
import React, { useState, useEffect } from "react";
|
|
|
|
import paths from "@/utils/paths";
|
|
|
|
import { useNavigate } from "react-router-dom";
|
2023-11-08 19:00:12 -08:00
|
|
|
|
2024-01-04 15:54:31 -08:00
|
|
|
const TITLE = "Data Handling & Privacy";
|
|
|
|
const DESCRIPTION =
|
|
|
|
"We are committed to transparency and control when it comes to your personal data.";
|
2023-11-08 19:00:12 -08:00
|
|
|
const LLM_SELECTION_PRIVACY = {
|
|
|
|
openai: {
|
|
|
|
name: "OpenAI",
|
|
|
|
description: [
|
|
|
|
"Your chats will not be used for training",
|
2024-01-10 12:35:30 -08:00
|
|
|
"Your prompts and document text used in response creation are visible to OpenAI",
|
2023-11-08 19:00:12 -08:00
|
|
|
],
|
|
|
|
logo: OpenAiLogo,
|
|
|
|
},
|
|
|
|
azure: {
|
|
|
|
name: "Azure OpenAI",
|
|
|
|
description: [
|
|
|
|
"Your chats will not be used for training",
|
|
|
|
"Your text and embedding text are not visible to OpenAI or Microsoft",
|
|
|
|
],
|
|
|
|
logo: AzureOpenAiLogo,
|
|
|
|
},
|
|
|
|
anthropic: {
|
|
|
|
name: "Anthropic",
|
|
|
|
description: [
|
|
|
|
"Your chats will not be used for training",
|
2024-01-10 12:35:30 -08:00
|
|
|
"Your prompts and document text used in response creation are visible to Anthropic",
|
2023-11-08 19:00:12 -08:00
|
|
|
],
|
|
|
|
logo: AnthropicLogo,
|
|
|
|
},
|
2023-12-27 17:08:03 -08:00
|
|
|
gemini: {
|
|
|
|
name: "Google Gemini",
|
|
|
|
description: [
|
|
|
|
"Your chats are de-identified and used in training",
|
2024-01-10 12:35:30 -08:00
|
|
|
"Your prompts and document text used in response creation are visible to Google",
|
2023-12-27 17:08:03 -08:00
|
|
|
],
|
|
|
|
logo: GeminiLogo,
|
|
|
|
},
|
2023-11-09 15:19:52 -08:00
|
|
|
lmstudio: {
|
|
|
|
name: "LMStudio",
|
|
|
|
description: [
|
|
|
|
"Your model and chats are only accessible on the server running LMStudio",
|
|
|
|
],
|
|
|
|
logo: LMStudioLogo,
|
|
|
|
},
|
2023-11-14 12:31:44 -08:00
|
|
|
localai: {
|
|
|
|
name: "LocalAI",
|
|
|
|
description: [
|
|
|
|
"Your model and chats are only accessible on the server running LocalAI",
|
|
|
|
],
|
|
|
|
logo: LocalAiLogo,
|
|
|
|
},
|
2023-12-27 17:21:47 -08:00
|
|
|
ollama: {
|
|
|
|
name: "Ollama",
|
|
|
|
description: [
|
|
|
|
"Your model and chats are only accessible on the machine running Ollama models",
|
|
|
|
],
|
|
|
|
logo: OllamaLogo,
|
|
|
|
},
|
2023-12-07 14:48:27 -08:00
|
|
|
native: {
|
|
|
|
name: "Custom Llama Model",
|
|
|
|
description: [
|
|
|
|
"Your model and chats are only accessible on this AnythingLLM instance",
|
|
|
|
],
|
|
|
|
logo: AnythingLLMIcon,
|
|
|
|
},
|
2024-01-10 12:35:30 -08:00
|
|
|
togetherai: {
|
|
|
|
name: "TogetherAI",
|
|
|
|
description: [
|
|
|
|
"Your chats will not be used for training",
|
|
|
|
"Your prompts and document text used in response creation are visible to TogetherAI",
|
|
|
|
],
|
|
|
|
logo: TogetherAILogo,
|
|
|
|
},
|
2023-11-08 19:00:12 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
const VECTOR_DB_PRIVACY = {
|
|
|
|
chroma: {
|
|
|
|
name: "Chroma",
|
|
|
|
description: [
|
2023-12-06 10:36:22 -08:00
|
|
|
"Your vectors and document text are stored on your Chroma instance",
|
2023-11-08 19:00:12 -08:00
|
|
|
"Access to your instance is managed by you",
|
|
|
|
],
|
|
|
|
logo: ChromaLogo,
|
|
|
|
},
|
|
|
|
pinecone: {
|
|
|
|
name: "Pinecone",
|
|
|
|
description: [
|
2023-12-06 10:36:22 -08:00
|
|
|
"Your vectors and document text are stored on Pinecone's servers",
|
|
|
|
"Access to your data is managed by Pinecone",
|
2023-11-08 19:00:12 -08:00
|
|
|
],
|
|
|
|
logo: PineconeLogo,
|
|
|
|
},
|
|
|
|
qdrant: {
|
|
|
|
name: "Qdrant",
|
|
|
|
description: [
|
2023-12-06 10:36:22 -08:00
|
|
|
"Your vectors and document text are stored on your Qdrant instance (cloud or self-hosted)",
|
2023-11-08 19:00:12 -08:00
|
|
|
],
|
|
|
|
logo: QDrantLogo,
|
|
|
|
},
|
|
|
|
weaviate: {
|
|
|
|
name: "Weaviate",
|
|
|
|
description: [
|
2023-12-06 10:36:22 -08:00
|
|
|
"Your vectors and document text are stored on your Weaviate instance (cloud or self-hosted)",
|
2023-11-08 19:00:12 -08:00
|
|
|
],
|
|
|
|
logo: WeaviateLogo,
|
|
|
|
},
|
|
|
|
lancedb: {
|
|
|
|
name: "LanceDB",
|
|
|
|
description: [
|
2023-12-06 10:36:22 -08:00
|
|
|
"Your vectors and document text are stored privately on this instance of AnythingLLM",
|
2023-11-08 19:00:12 -08:00
|
|
|
],
|
|
|
|
logo: LanceDbLogo,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2023-11-16 15:19:49 -08:00
|
|
|
const EMBEDDING_ENGINE_PRIVACY = {
|
2023-12-06 10:36:22 -08:00
|
|
|
native: {
|
|
|
|
name: "AnythingLLM Embedder",
|
|
|
|
description: [
|
|
|
|
"Your document text is embedded privately on this instance of AnythingLLM",
|
|
|
|
],
|
|
|
|
logo: AnythingLLMIcon,
|
|
|
|
},
|
2023-11-16 15:19:49 -08:00
|
|
|
openai: {
|
|
|
|
name: "OpenAI",
|
|
|
|
description: [
|
2023-12-06 10:36:22 -08:00
|
|
|
"Your document text is sent to OpenAI servers",
|
2023-11-16 15:19:49 -08:00
|
|
|
"Your documents are not used for training",
|
|
|
|
],
|
|
|
|
logo: OpenAiLogo,
|
|
|
|
},
|
|
|
|
azure: {
|
|
|
|
name: "Azure OpenAI",
|
|
|
|
description: [
|
2023-12-06 10:36:22 -08:00
|
|
|
"Your document text is sent to your Microsoft Azure service",
|
|
|
|
"Your documents are not used for training",
|
2023-11-16 15:19:49 -08:00
|
|
|
],
|
|
|
|
logo: AzureOpenAiLogo,
|
|
|
|
},
|
|
|
|
localai: {
|
|
|
|
name: "LocalAI",
|
|
|
|
description: [
|
2023-12-06 10:36:22 -08:00
|
|
|
"Your document text is embedded privately on the server running LocalAI",
|
2023-11-16 15:19:49 -08:00
|
|
|
],
|
|
|
|
logo: LocalAiLogo,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2024-01-04 15:54:31 -08:00
|
|
|
export default function DataHandling({ setHeader, setForwardBtn, setBackBtn }) {
|
2023-11-08 19:00:12 -08:00
|
|
|
const [llmChoice, setLLMChoice] = useState("openai");
|
|
|
|
const [loading, setLoading] = useState(true);
|
|
|
|
const [vectorDb, setVectorDb] = useState("pinecone");
|
2023-11-16 15:19:49 -08:00
|
|
|
const [embeddingEngine, setEmbeddingEngine] = useState("openai");
|
2024-01-04 15:54:31 -08:00
|
|
|
const navigate = useNavigate();
|
2023-11-08 19:00:12 -08:00
|
|
|
|
|
|
|
useEffect(() => {
|
2024-01-04 15:54:31 -08:00
|
|
|
setHeader({ title: TITLE, description: DESCRIPTION });
|
|
|
|
setForwardBtn({ showing: true, disabled: false, onClick: handleForward });
|
|
|
|
setBackBtn({ showing: false, disabled: false, onClick: handleBack });
|
2023-11-08 19:00:12 -08:00
|
|
|
async function fetchKeys() {
|
|
|
|
const _settings = await System.keys();
|
2024-01-04 15:54:31 -08:00
|
|
|
setLLMChoice(_settings?.LLMProvider || "openai");
|
|
|
|
setVectorDb(_settings?.VectorDB || "pinecone");
|
|
|
|
setEmbeddingEngine(_settings?.EmbeddingEngine || "openai");
|
2023-11-08 19:00:12 -08:00
|
|
|
|
|
|
|
setLoading(false);
|
|
|
|
}
|
2024-01-04 15:54:31 -08:00
|
|
|
fetchKeys();
|
2023-11-08 19:00:12 -08:00
|
|
|
}, []);
|
|
|
|
|
2024-01-04 15:54:31 -08:00
|
|
|
function handleForward() {
|
|
|
|
navigate(paths.onboarding.survey());
|
|
|
|
}
|
|
|
|
|
|
|
|
function handleBack() {
|
|
|
|
navigate(paths.onboarding.userSetup());
|
|
|
|
}
|
|
|
|
|
2023-11-08 19:00:12 -08:00
|
|
|
if (loading)
|
|
|
|
return (
|
|
|
|
<div className="w-full h-full flex justify-center items-center p-20">
|
|
|
|
<PreLoader />
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
|
|
|
|
return (
|
2024-01-04 15:54:31 -08:00
|
|
|
<div className="w-full flex items-center justify-center flex-col gap-y-6">
|
2023-11-16 15:19:49 -08:00
|
|
|
<div className="p-8 flex flex-col gap-8">
|
2023-12-04 13:23:45 -08:00
|
|
|
<div className="flex flex-col gap-y-2 border-b border-zinc-500/50 pb-4">
|
2023-11-08 19:00:12 -08:00
|
|
|
<div className="text-white text-base font-bold">LLM Selection</div>
|
|
|
|
<div className="flex items-center gap-2.5">
|
|
|
|
<img
|
|
|
|
src={LLM_SELECTION_PRIVACY[llmChoice].logo}
|
|
|
|
alt="LLM Logo"
|
|
|
|
className="w-8 h-8 rounded"
|
|
|
|
/>
|
|
|
|
<p className="text-white text-sm font-bold">
|
|
|
|
{LLM_SELECTION_PRIVACY[llmChoice].name}
|
|
|
|
</p>
|
|
|
|
</div>
|
2023-12-04 13:23:45 -08:00
|
|
|
<ul className="flex flex-col list-disc ml-4">
|
2023-11-08 19:00:12 -08:00
|
|
|
{LLM_SELECTION_PRIVACY[llmChoice].description.map((desc) => (
|
2023-12-04 13:23:45 -08:00
|
|
|
<li className="text-white/90 text-sm">{desc}</li>
|
2023-11-08 19:00:12 -08:00
|
|
|
))}
|
2023-12-04 13:23:45 -08:00
|
|
|
</ul>
|
2023-11-08 19:00:12 -08:00
|
|
|
</div>
|
2023-12-04 13:23:45 -08:00
|
|
|
<div className="flex flex-col gap-y-2 border-b border-zinc-500/50 pb-4">
|
2023-11-16 15:19:49 -08:00
|
|
|
<div className="text-white text-base font-bold">Embedding Engine</div>
|
|
|
|
<div className="flex items-center gap-2.5">
|
|
|
|
<img
|
|
|
|
src={EMBEDDING_ENGINE_PRIVACY[embeddingEngine].logo}
|
2023-12-04 13:23:45 -08:00
|
|
|
alt="LLM Logo"
|
2023-11-16 15:19:49 -08:00
|
|
|
className="w-8 h-8 rounded"
|
|
|
|
/>
|
|
|
|
<p className="text-white text-sm font-bold">
|
|
|
|
{EMBEDDING_ENGINE_PRIVACY[embeddingEngine].name}
|
|
|
|
</p>
|
|
|
|
</div>
|
2023-12-04 13:23:45 -08:00
|
|
|
<ul className="flex flex-col list-disc ml-4">
|
2023-11-16 15:19:49 -08:00
|
|
|
{EMBEDDING_ENGINE_PRIVACY[embeddingEngine].description.map(
|
|
|
|
(desc) => (
|
|
|
|
<li className="text-white/90 text-sm">{desc}</li>
|
|
|
|
)
|
|
|
|
)}
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
|
2023-12-04 13:23:45 -08:00
|
|
|
<div className="flex flex-col gap-y-2 pb-4">
|
2023-11-08 19:00:12 -08:00
|
|
|
<div className="text-white text-base font-bold">Vector Database</div>
|
|
|
|
<div className="flex items-center gap-2.5">
|
|
|
|
<img
|
|
|
|
src={VECTOR_DB_PRIVACY[vectorDb].logo}
|
2023-12-04 13:23:45 -08:00
|
|
|
alt="LLM Logo"
|
2023-11-08 19:00:12 -08:00
|
|
|
className="w-8 h-8 rounded"
|
|
|
|
/>
|
|
|
|
<p className="text-white text-sm font-bold">
|
|
|
|
{VECTOR_DB_PRIVACY[vectorDb].name}
|
|
|
|
</p>
|
|
|
|
</div>
|
2023-12-04 13:23:45 -08:00
|
|
|
<ul className="flex flex-col list-disc ml-4">
|
2023-11-08 19:00:12 -08:00
|
|
|
{VECTOR_DB_PRIVACY[vectorDb].description.map((desc) => (
|
|
|
|
<li className="text-white/90 text-sm">{desc}</li>
|
|
|
|
))}
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|