Skip to content
Open
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
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"ppio",
"Qdrant",
"royalblue",
"sambanova",
"SearchApi",
"searxng",
"Serper",
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ AnythingLLM divides your documents into objects called `workspaces`. A Workspace
- [LocalAI (all models)](https://localai.io/)
- [Together AI (chat models)](https://www.together.ai/)
- [Fireworks AI (chat models)](https://fireworks.ai/)
- [SambaNova Cloud (chat models)](https://cloud.sambanova.ai/)
- [Perplexity (chat models)](https://www.perplexity.ai/)
- [OpenRouter (chat models)](https://openrouter.ai/)
- [DeepSeek (chat models)](https://deepseek.com/)
Expand Down
8 changes: 8 additions & 0 deletions docker/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ GID='1000'
# OLLAMA_MODEL_TOKEN_LIMIT=4096
# OLLAMA_AUTH_TOKEN='your-ollama-auth-token-here (optional, only for ollama running behind auth - Bearer token)'

# LLM_PROVIDER='sambanova'
# SAMBANOVA_API_KEY='my-sambanova-key'
# SAMBANOVA_MODEL_PREF='Meta-Llama-3.3-70B-Instruct'

# LLM_PROVIDER='togetherai'
# TOGETHER_AI_API_KEY='my-together-ai-key'
# TOGETHER_AI_MODEL_PREF='mistralai/Mixtral-8x7B-Instruct-v0.1'
Expand Down Expand Up @@ -113,6 +117,10 @@ GID='1000'
# FIREWORKS_AI_LLM_API_KEY='my-fireworks-ai-key'
# FIREWORKS_AI_LLM_MODEL_PREF='accounts/fireworks/models/llama-v3p1-8b-instruct'

# LLM_PROVIDER='sambanova'
# SAMBANOVA_API_KEY='sambanova-your-api-key'
# SAMBANOVA_MODEL_PREF='Meta-Llama-3.3-70B-Instruct'

# LLM_PROVIDER='apipie'
# APIPIE_LLM_API_KEY='sk-123abc'
# APIPIE_LLM_MODEL_PREF='openrouter/llama-3.1-8b-instruct'
Expand Down
107 changes: 107 additions & 0 deletions frontend/src/components/LLMSelection/SambaNovaOptions/index.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
import System from "@/models/system";
import { useState, useEffect } from "react";

export default function SambaNovaOptions({ settings }) {
const [inputValue, setInputValue] = useState(settings?.SambaNovaApiKey);
const [apiKey, setApiKey] = useState(settings?.SambaNovaApiKey);

return (
<div className="flex gap-[36px] mt-1.5">
<div className="flex flex-col w-60">
<label className="text-white text-sm font-semibold block mb-3">
SambaNova API Key
</label>
<input
type="password"
name="SambaNovaApiKey"
className="border-none bg-theme-settings-input-bg text-white 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="SambaNova AI API Key"
defaultValue={settings?.SambaNovaApiKey ? "*".repeat(20) : ""}
required={true}
autoComplete="off"
spellCheck={false}
onChange={(e) => setInputValue(e.target.value)}
onBlur={() => setApiKey(inputValue)}
/>
</div>
{!settings?.credentialsOnly && (
<SambaNovaModelSelection settings={settings} apiKey={apiKey} />
)}
</div>
);
}

function SambaNovaModelSelection({ settings, apiKey }) {
const [groupedModels, setGroupedModels] = useState({});
const [loading, setLoading] = useState(true);

useEffect(() => {
async function findCustomModels() {
setLoading(true);
const { models } = await System.customModels("sambanova");

console.log("models", models)

if (models?.length > 0) {
const modelsByOrganization = models.reduce((acc, model) => {
acc[model.organization] = acc[model.organization] || [];
acc[model.organization].push(model);
return acc;
}, {});

setGroupedModels(modelsByOrganization);
}

setLoading(false);
}
findCustomModels();
}, []);

if (loading || Object.keys(groupedModels).length === 0) {
return (
<div className="flex flex-col w-60">
<label className="text-white text-sm font-semibold block mb-3">
Chat Model Selection
</label>
<select
name="SambaNovaModelPref"
disabled={true}
className="border-none bg-theme-settings-input-bg border-gray-500 text-white text-sm rounded-lg block w-full p-2.5"
>
<option disabled={true} selected={true}>
-- loading available models --
</option>
</select>
</div>
);
}

return (
<div className="flex flex-col w-60">
<label className="text-white text-sm font-semibold block mb-3">
Chat Model Selection
</label>
<select
name="SambaNovaModelPref"
required={true}
className="border-none bg-theme-settings-input-bg border-gray-500 text-white text-sm rounded-lg block w-full p-2.5"
>
{Object.keys(groupedModels)
.sort()
.map((organization) => (
<optgroup key={organization} label={organization}>
{groupedModels[organization].map((model) => (
<option
key={model.id}
value={model.id}
selected={settings?.SambaNovaModelPref === model.id}
>
{model.name}
</option>
))}
</optgroup>
))}
</select>
</div>
);
}
2 changes: 2 additions & 0 deletions frontend/src/hooks/useGetProvidersModels.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const PROVIDER_DEFAULT_MODELS = {
ollama: [],
togetherai: [],
fireworksai: [],
sambanova: [],
"nvidia-nim": [],
groq: [],
cohere: [
Expand Down Expand Up @@ -48,6 +49,7 @@ function groupModels(models) {
const groupedProviders = [
"togetherai",
"fireworksai",
"sambanova",
"openai",
"novita",
"openrouter",
Expand Down
Binary file added frontend/src/media/llmprovider/sambanova.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions frontend/src/pages/GeneralSettings/LLMPreference/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import OllamaLogo from "@/media/llmprovider/ollama.png";
import NovitaLogo from "@/media/llmprovider/novita.png";
import LMStudioLogo from "@/media/llmprovider/lmstudio.png";
import LocalAiLogo from "@/media/llmprovider/localai.png";
import SambaNovaLogo from "@/media/llmprovider/sambanova.png";
import TogetherAILogo from "@/media/llmprovider/togetherai.png";
import FireworksAILogo from "@/media/llmprovider/fireworksai.jpeg";
import MistralLogo from "@/media/llmprovider/mistral.jpeg";
Expand Down Expand Up @@ -43,6 +44,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 SambaNovaOptions from "@/components/LLMSelection/SambaNovaOptions";
import TogetherAiOptions from "@/components/LLMSelection/TogetherAiOptions";
import FireworksAiOptions from "@/components/LLMSelection/FireworksAiOptions";
import MistralOptions from "@/components/LLMSelection/MistralOptions";
Expand Down Expand Up @@ -168,6 +170,14 @@ export const AVAILABLE_LLM_PROVIDERS = [
"Reliable, Scalable, and Cost-Effective for LLMs from Novita AI",
requiredConfig: ["NovitaLLMApiKey"],
},
{
name: "SambaNova",
value: "sambanova",
logo: SambaNovaLogo,
options: (settings) => <SambaNovaOptions settings={settings} />,
description: "Run the fastest LLMs from SambaNova.",
requiredConfig: ["SambaNovaApiKey"],
},
{
name: "Together AI",
value: "togetherai",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import AzureOpenAiLogo from "@/media/llmprovider/azure.png";
import AnthropicLogo from "@/media/llmprovider/anthropic.png";
import GeminiLogo from "@/media/llmprovider/gemini.png";
import OllamaLogo from "@/media/llmprovider/ollama.png";
import SambaNovaLogo from "@/media/llmprovider/sambanova.png";
import TogetherAILogo from "@/media/llmprovider/togetherai.png";
import FireworksAILogo from "@/media/llmprovider/fireworksai.jpeg";
import NvidiaNimLogo from "@/media/llmprovider/nvidia-nim.png";
Expand Down Expand Up @@ -104,6 +105,14 @@ export const LLM_SELECTION_PRIVACY = {
],
logo: OllamaLogo,
},
sambanova: {
name: "SambaNova",
description: [
"Your chats will not be used for training",
"Your prompts and document text used in response creation are visible to SambaNova",
],
logo: SambaNovaLogo,
},
togetherai: {
name: "TogetherAI",
description: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import GeminiLogo from "@/media/llmprovider/gemini.png";
import OllamaLogo from "@/media/llmprovider/ollama.png";
import LMStudioLogo from "@/media/llmprovider/lmstudio.png";
import LocalAiLogo from "@/media/llmprovider/localai.png";
import SambaNovaLogo from "@/media/llmprovider/sambanova.png";
import TogetherAILogo from "@/media/llmprovider/togetherai.png";
import FireworksAILogo from "@/media/llmprovider/fireworksai.jpeg";
import MistralLogo from "@/media/llmprovider/mistral.jpeg";
Expand Down Expand Up @@ -38,6 +39,7 @@ import GeminiLLMOptions from "@/components/LLMSelection/GeminiLLMOptions";
import OllamaLLMOptions from "@/components/LLMSelection/OllamaLLMOptions";
import MistralOptions from "@/components/LLMSelection/MistralOptions";
import HuggingFaceOptions from "@/components/LLMSelection/HuggingFaceOptions";
import SambaNovaOptions from "@/components/LLMSelection/SambaNovaOptions";
import TogetherAiOptions from "@/components/LLMSelection/TogetherAiOptions";
import FireworksAiOptions from "@/components/LLMSelection/FireworksAiOptions";
import PerplexityOptions from "@/components/LLMSelection/PerplexityOptions";
Expand Down Expand Up @@ -160,6 +162,13 @@ const LLMS = [
options: (settings) => <TextGenWebUIOptions settings={settings} />,
description: "Run local LLMs using Oobabooga's Text Generation Web UI.",
},
{
name: "SambaNova",
value: "sambanova",
logo: SambaNovaLogo,
options: (settings) => <SambaNovaOptions settings={settings} />,
description: "Run open source models from SambaNova.",
},
{
name: "Together AI",
value: "togetherai",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const ENABLED_PROVIDERS = [
"groq",
"azure",
"koboldcpp",
"sambanova",
"togetherai",
"openrouter",
"novita",
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 @@ -83,6 +83,7 @@ AnythingLLMは、ドキュメントを`ワークスペース`と呼ばれるオ
- [LocalAi (すべてのモデル)](https://localai.io/)
- [Together AI (チャットモデル)](https://www.together.ai/)
- [Fireworks AI (チャットモデル)](https://fireworks.ai/)
- [SambaNova Cloud (チャットモデル)](https://cloud.sambanova.ai/)
- [Perplexity (チャットモデル)](https://www.perplexity.ai/)
- [OpenRouter (チャットモデル)](https://openrouter.ai/)
- [Novita AI (チャットモデル)](https://novita.ai/model-api/product/llm-api?utm_source=github_anything-llm&utm_medium=github_readme&utm_campaign=link)
Expand Down
1 change: 1 addition & 0 deletions locales/README.tr-TR.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ AnythingLLM, belgelerinizi **"çalışma alanları" (workspaces)** adı verilen
- [LocalAi (all models)](https://localai.io/)
- [Together AI (chat models)](https://www.together.ai/)
- [Fireworks AI (chat models)](https://fireworks.ai/)
- [SambaNova Cloud (chat models)](https://cloud.sambanova.ai/)
- [Perplexity (chat models)](https://www.perplexity.ai/)
- [OpenRouter (chat models)](https://openrouter.ai/)
- [DeepSeek (chat models)](https://deepseek.com/)
Expand Down
1 change: 1 addition & 0 deletions locales/README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ AnythingLLM将您的文档划分为称为`workspaces` (工作区)的对象。工
- [LocalAI (所有模型)](https://localai.io/)
- [Together AI (聊天模型)](https://www.together.ai/)
- [Fireworks AI (聊天模型)](https://fireworks.ai/)
- [SambaNova Cloud (聊天模型)](https://cloud.sambanova.ai/)
- [Perplexity (聊天模型)](https://www.perplexity.ai/)
- [OpenRouter (聊天模型)](https://openrouter.ai/)
- [DeepSeek (聊天模型)](https://deepseek.com/)
Expand Down
8 changes: 8 additions & 0 deletions server/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ SIG_SALT='salt' # Please generate random string at least 32 chars long.
# OLLAMA_MODEL_TOKEN_LIMIT=4096
# OLLAMA_AUTH_TOKEN='your-ollama-auth-token-here (optional, only for ollama running behind auth - Bearer token)'

# LLM_PROVIDER='sambanova'
# SAMBANOVA_API_KEY='my-sambanova-key'
# SAMBANOVA_MODEL_PREF='Meta-Llama-3.3-70B-Instruct'

# LLM_PROVIDER='togetherai'
# TOGETHER_AI_API_KEY='my-together-ai-key'
# TOGETHER_AI_MODEL_PREF='mistralai/Mixtral-8x7B-Instruct-v0.1'
Expand All @@ -49,6 +53,10 @@ SIG_SALT='salt' # Please generate random string at least 32 chars long.
# FIREWORKS_AI_LLM_API_KEY='my-fireworks-ai-key'
# FIREWORKS_AI_LLM_MODEL_PREF='accounts/fireworks/models/llama-v3p1-8b-instruct'

# LLM_PROVIDER='sambanova'
# SAMBANOVA_API_KEY='sambanova-your-api-key'
# SAMBANOVA_MODEL_PREF='Meta-Llama-3.3-70B-Instruct'

# LLM_PROVIDER='perplexity'
# PERPLEXITY_API_KEY='my-perplexity-key'
# PERPLEXITY_MODEL_PREF='codellama-34b-instruct'
Expand Down
6 changes: 6 additions & 0 deletions server/endpoints/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ function getModelTag() {
case "groq":
model = process.env.GROQ_MODEL_PREF;
break;
case "sambanova":
model = process.env.SAMBANOVA_MODEL_PREF;
break;
case "togetherai":
model = process.env.TOGETHER_AI_MODEL_PREF;
break;
Expand Down Expand Up @@ -117,6 +120,9 @@ function getModelTag() {
case "fireworksai":
model = process.env.FIREWORKS_AI_LLM_MODEL_PREF;
break;
case "sambanova":
model = process.env.SAMBANOVA_MODEL_PREF;
break;
case "deepseek":
model = process.env.DEEPSEEK_MODEL_PREF;
break;
Expand Down
4 changes: 4 additions & 0 deletions server/models/systemSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,10 @@ const SystemSettings = {
NovitaLLMModelPref: process.env.NOVITA_LLM_MODEL_PREF,
NovitaLLMTimeout: process.env.NOVITA_LLM_TIMEOUT_MS,

// SambaNova Keys
SambaNovaApiKey: !!process.env.SAMBANOVA_API_KEY,
SambaNovaModelPref: process.env.SAMBANOVA_MODEL_PREF,

// TogetherAI Keys
TogetherAiApiKey: !!process.env.TOGETHER_AI_API_KEY,
TogetherAiModelPref: process.env.TOGETHER_AI_MODEL_PREF,
Expand Down
Loading