这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ AnythingLLM divides your documents into objects called `workspaces`. A Workspace
- [Novita AI (chat models)](https://novita.ai/model-api/product/llm-api?utm_source=github_anything-llm&utm_medium=github_readme&utm_campaign=link)
- [PPIO](https://ppinfra.com?utm_source=github_anything-llm)
- [Moonshot AI](https://www.moonshot.ai/)

- [CometAPI (chat models)](https://api.cometapi.com/)
**Embedder models:**

- [AnythingLLM Native Embedder](/server/storage/models/README.md) (default)
Expand Down
5 changes: 5 additions & 0 deletions docker/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ GID='1000'
# NOVITA_LLM_API_KEY='your-novita-api-key-here' check on https://novita.ai/settings/key-management
# NOVITA_LLM_MODEL_PREF='deepseek/deepseek-r1'

# LLM_PROVIDER='cometapi'
# COMETAPI_LLM_API_KEY='your-cometapi-api-key-here' # Get one at https://api.cometapi.com/console/token
# COMETAPI_LLM_MODEL_PREF='gpt-5-mini'
# COMETAPI_LLM_TIMEOUT_MS=500 # Optional; stream idle timeout in ms (min 500ms)

# LLM_PROVIDER='cohere'
# COHERE_API_KEY=
# COHERE_MODEL_PREF='command-r'
Expand Down
155 changes: 155 additions & 0 deletions frontend/src/components/LLMSelection/CometApiLLMOptions/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
import System from "@/models/system";
import { CaretDown, CaretUp } from "@phosphor-icons/react";
import { useState, useEffect } from "react";

export default function CometApiLLMOptions({ settings }) {
return (
<div className="w-full flex flex-col gap-y-7">
<div className="w-full flex items-start gap-[36px] mt-1.5">
<div className="flex flex-col w-60">
<label className="text-theme-text-primary text-sm font-semibold block mb-3">
CometAPI API Key
</label>
<input
type="password"
name="CometApiLLMApiKey"
className="border-none bg-theme-settings-input-bg text-theme-text-primary placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5"
placeholder="CometAPI API Key"
defaultValue={settings?.CometApiLLMApiKey ? "*".repeat(20) : ""}
required={true}
autoComplete="off"
spellCheck={false}
/>
</div>
{!settings?.credentialsOnly && (
<CometApiModelSelection settings={settings} />
)}
</div>
<AdvancedControls settings={settings} />
</div>
);
}

function AdvancedControls({ settings }) {
const [showAdvancedControls, setShowAdvancedControls] = useState(false);

return (
<div className="flex flex-col gap-y-4">
<div className="flex justify-start">
<button
type="button"
onClick={() => setShowAdvancedControls(!showAdvancedControls)}
className="border-none text-theme-text-primary hover:text-theme-text-secondary flex items-center text-sm"
>
{showAdvancedControls ? "Hide" : "Show"} advanced settings
{showAdvancedControls ? (
<CaretUp size={14} className="ml-1" />
) : (
<CaretDown size={14} className="ml-1" />
)}
</button>
</div>
<div hidden={!showAdvancedControls}>
<div className="flex flex-col w-60">
<label className="text-theme-text-primary text-sm font-semibold block mb-3">
Stream Timeout (ms)
</label>
<input
type="number"
name="CometApiLLMTimeout"
className="border-none bg-theme-settings-input-bg text-theme-text-primary placeholder:text-theme-settings-input-placeholder text-sm rounded-lg focus:outline-primary-button active:outline-primary-button outline-none block w-full p-2.5"
placeholder="Timeout value between token responses to auto-timeout the stream"
defaultValue={settings?.CometApiLLMTimeout ?? 500}
autoComplete="off"
onScroll={(e) => e.target.blur()}
min={500}
step={1}
/>
<p className="text-xs leading-[18px] font-base text-theme-text-primary text-opacity-60 mt-2">
Timeout value between token responses to auto-timeout the stream.
</p>
</div>
</div>
</div>
);
}

function CometApiModelSelection({ settings }) {
// TODO: For now, CometAPI models list is noisy; show a flat, deduped list without grouping.
// Revisit after CometAPI model list API provides better categorization/metadata.
const [models, setModels] = useState([]);
const [loading, setLoading] = useState(true);

useEffect(() => {
async function findCustomModels() {
setLoading(true);
const { models: fetched = [] } = await System.customModels("cometapi");
if (fetched?.length > 0) {
// De-duplicate by id (case-insensitive) and sort by name for readability
const seen = new Set();
const unique = [];
for (const m of fetched) {
const key = String(m.id || m.name || "").toLowerCase();
if (!seen.has(key)) {
seen.add(key);
unique.push(m);
}
}
unique.sort((a, b) =>
String(a.name || a.id).localeCompare(String(b.name || b.id))
);
setModels(unique);
} else {
setModels([]);
}
setLoading(false);
}
findCustomModels();
}, []);

if (loading || models.length === 0) {
return (
<div className="flex flex-col w-60">
<label className="text-theme-text-primary text-sm font-semibold block mb-3">
Chat Model Selection
</label>
<input
type="text"
name="CometApiLLMModelPref"
className="border-none bg-theme-settings-input-bg text-theme-text-primary placeholder:text-theme-settings-input-placeholder text-sm rounded-lg block w-full p-2.5"
placeholder="-- loading available models --"
disabled
/>
</div>
);
}

return (
<div className="flex flex-col w-60">
<label className="text-theme-text-primary text-sm font-semibold block mb-3">
Chat Model Selection
</label>
<input
type="text"
name="CometApiLLMModelPref"
list="cometapi-models-list"
required
className="border-none bg-theme-settings-input-bg text-theme-text-primary placeholder:text-theme-settings-input-placeholder text-sm rounded-lg block w-full p-2.5"
placeholder="Type or select a model"
defaultValue={settings?.CometApiLLMModelPref || ""}
autoComplete="off"
spellCheck={false}
/>
<datalist id="cometapi-models-list">
{models.map((model) => (
<option key={model.id} value={model.id}>
{model.name}
</option>
))}
</datalist>
<p className="text-xs leading-[18px] font-base text-theme-text-primary text-opacity-60 mt-2">
You can type the model id directly or pick from suggestions.
</p>
</div>
);
}
Binary file added frontend/src/media/llmprovider/cometapi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 27 additions & 17 deletions frontend/src/pages/GeneralSettings/LLMPreference/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import NvidiaNimLogo from "@/media/llmprovider/nvidia-nim.png";
import PPIOLogo from "@/media/llmprovider/ppio.png";
import DellProAiStudioLogo from "@/media/llmprovider/dpais.png";
import MoonshotAiLogo from "@/media/llmprovider/moonshotai.png";
import CometApiLogo from "@/media/llmprovider/cometapi.png";

import PreLoader from "@/components/Preloader";
import OpenAiOptions from "@/components/LLMSelection/OpenAiOptions";
Expand All @@ -44,6 +45,7 @@ import LocalAiOptions from "@/components/LLMSelection/LocalAiOptions";
import GeminiLLMOptions from "@/components/LLMSelection/GeminiLLMOptions";
import OllamaLLMOptions from "@/components/LLMSelection/OllamaLLMOptions";
import NovitaLLMOptions from "@/components/LLMSelection/NovitaLLMOptions";
import CometApiLLMOptions from "@/components/LLMSelection/CometApiLLMOptions";
import TogetherAiOptions from "@/components/LLMSelection/TogetherAiOptions";
import FireworksAiOptions from "@/components/LLMSelection/FireworksAiOptions";
import MistralOptions from "@/components/LLMSelection/MistralOptions";
Expand Down Expand Up @@ -161,15 +163,6 @@ export const AVAILABLE_LLM_PROVIDERS = [
description: "Run LLMs locally on your own machine.",
requiredConfig: ["LocalAiApiKey", "LocalAiBasePath", "LocalAiTokenLimit"],
},
{
name: "Novita AI",
value: "novita",
logo: NovitaLogo,
options: (settings) => <NovitaLLMOptions settings={settings} />,
description:
"Reliable, Scalable, and Cost-Effective for LLMs from Novita AI",
requiredConfig: ["NovitaLLMApiKey"],
},
{
name: "Together AI",
value: "togetherai",
Expand Down Expand Up @@ -303,6 +296,31 @@ export const AVAILABLE_LLM_PROVIDERS = [
description: "Run Moonshot AI's powerful LLMs.",
requiredConfig: ["MoonshotAiApiKey"],
},
{
name: "Novita AI",
value: "novita",
logo: NovitaLogo,
options: (settings) => <NovitaLLMOptions settings={settings} />,
description:
"Reliable, Scalable, and Cost-Effective for LLMs from Novita AI",
requiredConfig: ["NovitaLLMApiKey"],
},
{
name: "CometAPI",
value: "cometapi",
logo: CometApiLogo,
options: (settings) => <CometApiLLMOptions settings={settings} />,
description: "500+ AI Models all in one API.",
requiredConfig: ["CometApiLLMApiKey"],
},
{
name: "xAI",
value: "xai",
logo: XAILogo,
options: (settings) => <XAILLMOptions settings={settings} />,
description: "Run xAI's powerful LLMs like Grok-2 and more.",
requiredConfig: ["XAIApiKey", "XAIModelPref"],
},
{
name: "Generic OpenAI",
value: "generic-openai",
Expand All @@ -317,14 +335,6 @@ export const AVAILABLE_LLM_PROVIDERS = [
"GenericOpenAiKey",
],
},
{
name: "xAI",
value: "xai",
logo: XAILogo,
options: (settings) => <XAILLMOptions settings={settings} />,
description: "Run xAI's powerful LLMs like Grok-2 and more.",
requiredConfig: ["XAIApiKey", "XAIModelPref"],
},
];

export default function GeneralLLMPreference() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import PPIOLogo from "@/media/llmprovider/ppio.png";
import PGVectorLogo from "@/media/vectordbs/pgvector.png";
import DPAISLogo from "@/media/llmprovider/dpais.png";
import MoonshotAiLogo from "@/media/llmprovider/moonshotai.png";
import CometApiLogo from "@/media/llmprovider/cometapi.png";

import React, { useState, useEffect } from "react";
import paths from "@/utils/paths";
Expand Down Expand Up @@ -252,6 +253,14 @@ export const LLM_SELECTION_PRIVACY = {
],
logo: MoonshotAiLogo,
},
cometapi: {
name: "CometAPI",
description: [
"Your chats will not be used for training",
"Your prompts and document text used in response creation are visible to CometAPI",
],
logo: CometApiLogo,
},
};

export const VECTOR_DB_PRIVACY = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import CohereLogo from "@/media/llmprovider/cohere.png";
import PPIOLogo from "@/media/llmprovider/ppio.png";
import DellProAiStudioLogo from "@/media/llmprovider/dpais.png";
import MoonshotAiLogo from "@/media/llmprovider/moonshotai.png";
import CometApiLogo from "@/media/llmprovider/cometapi.png";

import OpenAiOptions from "@/components/LLMSelection/OpenAiOptions";
import GenericOpenAiOptions from "@/components/LLMSelection/GenericOpenAiOptions";
Expand Down Expand Up @@ -57,6 +58,7 @@ import NvidiaNimOptions from "@/components/LLMSelection/NvidiaNimOptions";
import PPIOLLMOptions from "@/components/LLMSelection/PPIOLLMOptions";
import DellProAiStudioOptions from "@/components/LLMSelection/DPAISOptions";
import MoonshotAiOptions from "@/components/LLMSelection/MoonshotAiOptions";
import CometApiLLMOptions from "@/components/LLMSelection/CometApiLLMOptions";

import LLMItem from "@/components/LLMSelection/LLMItem";
import System from "@/models/system";
Expand Down Expand Up @@ -272,6 +274,13 @@ const LLMS = [
options: (settings) => <MoonshotAiOptions settings={settings} />,
description: "Run Moonshot AI's powerful LLMs.",
},
{
name: "CometAPI",
value: "cometapi",
logo: CometApiLogo,
options: (settings) => <CometApiLLMOptions settings={settings} />,
description: "500+ AI Models all in one API.",
},
];

export default function LLMPreference({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,16 @@ const ENABLED_PROVIDERS = [
"nvidia-nim",
"gemini",
"moonshotai",
"cometapi",
// TODO: More agent support.
// "cohere", // Has tool calling and will need to build explicit support
// "huggingface" // Can be done but already has issues with no-chat templated. Needs to be tested.
];
const WARN_PERFORMANCE = [
"lmstudio",
"groq",
"azure",
"koboldcpp",
"ollama",
"localai",
"openrouter",
"novita",
"generic-openai",
"textgenwebui",
];

Expand Down
1 change: 1 addition & 0 deletions locales/README.ja-JP.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ AnythingLLMは、ドキュメントを`ワークスペース`と呼ばれるオ
- [Cohere](https://cohere.com/)
- [KoboldCPP](https://github.com/LostRuins/koboldcpp)
- [PPIO](https://ppinfra.com?utm_source=github_anything-llm)
- [CometAPI (チャットモデル)](https://api.cometapi.com/)

**埋め込みモデル:**

Expand Down
5 changes: 3 additions & 2 deletions locales/README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ AnythingLLM将您的文档划分为称为`workspaces` (工作区)的对象。工
- [xAI](https://x.ai/)
- [Novita AI (聊天模型)](https://novita.ai/model-api/product/llm-api?utm_source=github_anything-llm&utm_medium=github_readme&utm_campaign=link)
- [PPIO (聊天模型)](https://ppinfra.com?utm_source=github_anything-llm)
- [CometAPI (聊天模型)](https://api.cometapi.com/)

**支持的嵌入模型:**

Expand Down Expand Up @@ -200,7 +201,7 @@ _以下是一些与 AnythingLLM 兼容的应用程序,但并非由 Mintplex La

### 怎样关闭

在服务器或 Docker 的 .env 设置中将 `DISABLE_TELEMETRY` 设置为 "true",即可选择不参与遥测数据收集。你也可以在应用内通过以下路径操作:侧边栏 > `Privacy` (隐私) > 关闭遥测功能。
在服务器或 Docker 的 .env 设置中将 `DISABLE_TELEMETRY` 设置为 "true",即可选择不参与遥测数据收集。你也可以在应用内通过以下路径操作:侧边栏 > `Privacy` (隐私) > 关闭遥测功能。

### 你们跟踪收集哪些信息?

Expand All @@ -214,7 +215,7 @@ _以下是一些与 AnythingLLM 兼容的应用程序,但并非由 Mintplex La

您可以通过查找所有调用`Telemetry.sendTelemetry`的位置来验证这些声明。此外,如果启用,这些事件也会被写入输出日志,因此您也可以看到发送了哪些具体数据。**IP或其他识别信息不会被收集**。Telemetry远程信息收集的方案来自[PostHog](https://posthog.com/) - 一个开源的远程信息收集服务。

我们非常重视隐私,且不用烦人的弹窗问卷来获取反馈,希望你能理解为什么我们想要知道该工具的使用情况,这样我们才能打造真正值得使用的产品。所有匿名数据 _绝不会_ 与任何第三方共享。
我们非常重视隐私,且不用烦人的弹窗问卷来获取反馈,希望你能理解为什么我们想要知道该工具的使用情况,这样我们才能打造真正值得使用的产品。所有匿名数据 _绝不会_ 与任何第三方共享。

[在源代码中查看所有信息收集活动](https://github.com/search?q=repo%3AMintplex-Labs%2Fanything-llm%20.sendTelemetry\(&type=code)

Expand Down
8 changes: 7 additions & 1 deletion server/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,12 @@ SIG_SALT='salt' # Please generate random string at least 32 chars long.
# COHERE_API_KEY=
# COHERE_MODEL_PREF='command-r'

# LLM_PROVIDER='cometapi'
# COMETAPI_LLM_API_KEY='your-cometapi-key-here' # Get one at https://api.cometapi.com/console/token
# COMETAPI_LLM_MODEL_PREF='gpt-5-mini'
# COMETAPI_LLM_TIMEOUT_MS=500 # Optional; stream idle timeout in ms (min 500ms)


# LLM_PROVIDER='bedrock'
# AWS_BEDROCK_LLM_ACCESS_KEY_ID=
# AWS_BEDROCK_LLM_ACCESS_KEY=
Expand Down Expand Up @@ -354,4 +360,4 @@ TTS_PROVIDER="native"
# Specify the target languages for when using OCR to parse images and PDFs.
# This is a comma separated list of language codes as a string. Unsupported languages will be ignored.
# Default is English. See https://tesseract-ocr.github.io/tessdoc/Data-Files-in-different-versions.html for a list of valid language codes.
# TARGET_OCR_LANG=eng,deu,ita,spa,fra,por,rus,nld,tur,hun,pol,ita,spa,fra,por,rus,nld,tur,hun,pol
# TARGET_OCR_LANG=eng,deu,ita,spa,fra,por,rus,nld,tur,hun,pol,ita,spa,fra,por,rus,nld,tur,hun,pol
5 changes: 5 additions & 0 deletions server/models/systemSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,11 @@ const SystemSettings = {
DellProAiStudioModelPref: process.env.DPAIS_LLM_MODEL_PREF,
DellProAiStudioTokenLimit:
process.env.DPAIS_LLM_MODEL_TOKEN_LIMIT ?? 4096,

// CometAPI LLM Keys
CometApiLLMApiKey: !!process.env.COMETAPI_LLM_API_KEY,
CometApiLLMModelPref: process.env.COMETAPI_LLM_MODEL_PREF,
CometApiLLMTimeout: process.env.COMETAPI_LLM_TIMEOUT_MS,
};
},

Expand Down
Loading