Skip to content

Commit

Permalink
Merge branch 'master' into agent-ui-animations
Browse files Browse the repository at this point in the history
  • Loading branch information
timothycarambat authored Jan 27, 2025
2 parents 57a300b + 55ffc08 commit ae2f09d
Show file tree
Hide file tree
Showing 8 changed files with 67 additions and 32 deletions.
4 changes: 2 additions & 2 deletions docker/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ GID='1000'
# LITE_LLM_API_KEY='sk-123abc'

# LLM_PROVIDER='novita'
# NOVITA_LLM_API_KEY='your-novita-api-key-here' check on https://novita.ai/settings#key-management
# NOVITA_LLM_MODEL_PREF='gryphe/mythomax-l2-13b'
# 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='cohere'
# COHERE_API_KEY=
Expand Down
Binary file modified frontend/src/media/llmprovider/novita.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 19 additions & 13 deletions frontend/src/pages/GeneralSettings/PrivacyAndData/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
EMBEDDING_ENGINE_PRIVACY,
LLM_SELECTION_PRIVACY,
VECTOR_DB_PRIVACY,
FALLBACKS,
} from "@/pages/OnboardingFlow/Steps/DataHandling";
import { useTranslation } from "react-i18next";

Expand Down Expand Up @@ -67,6 +68,13 @@ function ThirdParty({ settings }) {
const vectorDb = settings?.VectorDB || "lancedb";
const { t } = useTranslation();

const LLMSelection =
LLM_SELECTION_PRIVACY?.[llmChoice] || FALLBACKS.LLM(llmChoice);
const EmbeddingEngine =
EMBEDDING_ENGINE_PRIVACY?.[embeddingEngine] ||
FALLBACKS.EMBEDDING(embeddingEngine);
const VectorDb = VECTOR_DB_PRIVACY?.[vectorDb] || FALLBACKS.VECTOR(vectorDb);

return (
<div className="py-8 w-full flex items-start justify-center flex-col gap-y-6 border-b-2 border-theme-sidebar-border">
<div className="flex flex-col gap-8">
Expand All @@ -76,16 +84,16 @@ function ThirdParty({ settings }) {
</div>
<div className="flex items-center gap-2.5">
<img
src={LLM_SELECTION_PRIVACY[llmChoice].logo}
src={LLMSelection.logo}
alt="LLM Logo"
className="w-8 h-8 rounded"
/>
<p className="text-theme-text-primary text-sm font-bold">
{LLM_SELECTION_PRIVACY[llmChoice].name}
{LLMSelection.name}
</p>
</div>
<ul className="flex flex-col list-disc ml-4">
{LLM_SELECTION_PRIVACY[llmChoice].description.map((desc) => (
{LLMSelection.description.map((desc) => (
<li className="text-theme-text-secondary text-sm">{desc}</li>
))}
</ul>
Expand All @@ -96,20 +104,18 @@ function ThirdParty({ settings }) {
</div>
<div className="flex items-center gap-2.5">
<img
src={EMBEDDING_ENGINE_PRIVACY[embeddingEngine].logo}
src={EmbeddingEngine.logo}
alt="LLM Logo"
className="w-8 h-8 rounded"
/>
<p className="text-theme-text-primary text-sm font-bold">
{EMBEDDING_ENGINE_PRIVACY[embeddingEngine].name}
{EmbeddingEngine.name}
</p>
</div>
<ul className="flex flex-col list-disc ml-4">
{EMBEDDING_ENGINE_PRIVACY[embeddingEngine].description.map(
(desc) => (
<li className="text-theme-text-secondary text-sm">{desc}</li>
)
)}
{EmbeddingEngine.description.map((desc) => (
<li className="text-theme-text-secondary text-sm">{desc}</li>
))}
</ul>
</div>

Expand All @@ -119,16 +125,16 @@ function ThirdParty({ settings }) {
</div>
<div className="flex items-center gap-2.5">
<img
src={VECTOR_DB_PRIVACY[vectorDb].logo}
src={VectorDb.logo}
alt="LLM Logo"
className="w-8 h-8 rounded"
/>
<p className="text-theme-text-primary text-sm font-bold">
{VECTOR_DB_PRIVACY[vectorDb].name}
{VectorDb.name}
</p>
</div>
<ul className="flex flex-col list-disc ml-4">
{VECTOR_DB_PRIVACY[vectorDb].description.map((desc) => (
{VectorDb.description.map((desc) => (
<li className="text-theme-text-secondary text-sm">{desc}</li>
))}
</ul>
Expand Down
55 changes: 42 additions & 13 deletions frontend/src/pages/OnboardingFlow/Steps/DataHandling/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,30 @@ export const EMBEDDING_ENGINE_PRIVACY = {
},
};

export const FALLBACKS = {
LLM: (provider) => ({
name: "Unknown",
description: [
`"${provider}" has no known data handling policy defined in AnythingLLM`,
],
logo: AnythingLLMIcon,
}),
EMBEDDING: (provider) => ({
name: "Unknown",
description: [
`"${provider}" has no known data handling policy defined in AnythingLLM`,
],
logo: AnythingLLMIcon,
}),
VECTOR: (provider) => ({
name: "Unknown",
description: [
`"${provider}" has no known data handling policy defined in AnythingLLM`,
],
logo: AnythingLLMIcon,
}),
};

export default function DataHandling({ setHeader, setForwardBtn, setBackBtn }) {
const [llmChoice, setLLMChoice] = useState("openai");
const [loading, setLoading] = useState(true);
Expand Down Expand Up @@ -425,6 +449,13 @@ export default function DataHandling({ setHeader, setForwardBtn, setBackBtn }) {
</div>
);

const LLMSelection =
LLM_SELECTION_PRIVACY?.[llmChoice] || FALLBACKS.LLM(llmChoice);
const EmbeddingEngine =
EMBEDDING_ENGINE_PRIVACY?.[embeddingEngine] ||
FALLBACKS.EMBEDDING(embeddingEngine);
const VectorDb = VECTOR_DB_PRIVACY?.[vectorDb] || FALLBACKS.VECTOR(vectorDb);

return (
<div className="w-full flex items-center justify-center flex-col gap-y-6">
<div className="p-8 flex flex-col gap-8">
Expand All @@ -434,16 +465,16 @@ export default function DataHandling({ setHeader, setForwardBtn, setBackBtn }) {
</div>
<div className="flex items-center gap-2.5">
<img
src={LLM_SELECTION_PRIVACY[llmChoice].logo}
src={LLMSelection.logo}
alt="LLM Logo"
className="w-8 h-8 rounded"
/>
<p className="text-theme-text-primary text-sm font-bold">
{LLM_SELECTION_PRIVACY[llmChoice].name}
{LLMSelection.name}
</p>
</div>
<ul className="flex flex-col list-disc ml-4">
{LLM_SELECTION_PRIVACY[llmChoice].description.map((desc) => (
{LLMSelection.description.map((desc) => (
<li className="text-theme-text-primary text-sm">{desc}</li>
))}
</ul>
Expand All @@ -454,20 +485,18 @@ export default function DataHandling({ setHeader, setForwardBtn, setBackBtn }) {
</div>
<div className="flex items-center gap-2.5">
<img
src={EMBEDDING_ENGINE_PRIVACY[embeddingEngine].logo}
src={EmbeddingEngine.logo}
alt="LLM Logo"
className="w-8 h-8 rounded"
/>
<p className="text-theme-text-primary text-sm font-bold">
{EMBEDDING_ENGINE_PRIVACY[embeddingEngine].name}
{EmbeddingEngine.name}
</p>
</div>
<ul className="flex flex-col list-disc ml-4">
{EMBEDDING_ENGINE_PRIVACY[embeddingEngine].description.map(
(desc) => (
<li className="text-theme-text-primary text-sm">{desc}</li>
)
)}
{EmbeddingEngine.description.map((desc) => (
<li className="text-theme-text-primary text-sm">{desc}</li>
))}
</ul>
</div>

Expand All @@ -477,16 +506,16 @@ export default function DataHandling({ setHeader, setForwardBtn, setBackBtn }) {
</div>
<div className="flex items-center gap-2.5">
<img
src={VECTOR_DB_PRIVACY[vectorDb].logo}
src={VectorDb.logo}
alt="LLM Logo"
className="w-8 h-8 rounded"
/>
<p className="text-theme-text-primary text-sm font-bold">
{VECTOR_DB_PRIVACY[vectorDb].name}
{VectorDb.name}
</p>
</div>
<ul className="flex flex-col list-disc ml-4">
{VECTOR_DB_PRIVACY[vectorDb].description.map((desc) => (
{VectorDb.description.map((desc) => (
<li className="text-theme-text-primary text-sm">{desc}</li>
))}
</ul>
Expand Down
2 changes: 1 addition & 1 deletion server/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ SIG_SALT='salt' # Please generate random string at least 32 chars long.

# LLM_PROVIDER='novita'
# NOVITA_LLM_API_KEY='your-novita-api-key-here' check on https://novita.ai/settings#key-management
# NOVITA_LLM_MODEL_PREF='gryphe/mythomax-l2-13b'
# NOVITA_LLM_MODEL_PREF='deepseek/deepseek-r1'

# LLM_PROVIDER='cohere'
# COHERE_API_KEY=
Expand Down
2 changes: 1 addition & 1 deletion server/utils/AiProviders/novita/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class NovitaLLM {
this.model =
modelPreference ||
process.env.NOVITA_LLM_MODEL_PREF ||
"gryphe/mythomax-l2-13b";
"deepseek/deepseek-r1";
this.limits = {
history: this.promptWindowLimit() * 0.15,
system: this.promptWindowLimit() * 0.15,
Expand Down
2 changes: 1 addition & 1 deletion server/utils/agents/aibitat/providers/novita.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class NovitaProvider extends InheritMultiple([Provider, UnTooled]) {
model;

constructor(config = {}) {
const { model = "gryphe/mythomax-l2-13b" } = config;
const { model = "deepseek/deepseek-r1" } = config;
super();
const client = new OpenAI({
baseURL: "https://api.novita.ai/v3/openai",
Expand Down
2 changes: 1 addition & 1 deletion server/utils/agents/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ class AgentHandler {
case "xai":
return process.env.XAI_LLM_MODEL_PREF ?? "grok-beta";
case "novita":
return process.env.NOVITA_LLM_MODEL_PREF ?? "gryphe/mythomax-l2-13b";
return process.env.NOVITA_LLM_MODEL_PREF ?? "deepseek/deepseek-r1";
case "nvidia-nim":
return process.env.NVIDIA_NIM_LLM_MODEL_PREF ?? null;
default:
Expand Down

0 comments on commit ae2f09d

Please sign in to comment.