mirror of
https://github.com/Mintplex-Labs/anything-llm
synced 2026-04-25 17:15:37 +02:00
Remove default models to show empty until real models are retreieved (#5524)
resolves #5505 Fix placeholder resolves #5503 resolves #5522
This commit is contained in:
@@ -26,7 +26,7 @@ GID='1000'
|
||||
|
||||
# LLM_PROVIDER='anthropic'
|
||||
# ANTHROPIC_API_KEY=sk-ant-xxxx
|
||||
# ANTHROPIC_MODEL_PREF='claude-2'
|
||||
# ANTHROPIC_MODEL_PREF='claude-sonnet-4-6'
|
||||
# ANTHROPIC_CACHE_CONTROL="5m" # Enable prompt caching (5m=5min cache, 1h=1hour cache). Reduces costs and improves speed by caching system prompts.
|
||||
|
||||
# LLM_PROVIDER='lmstudio'
|
||||
|
||||
@@ -20,7 +20,7 @@ export default function AnthropicAiOptions({ settings }) {
|
||||
type="password"
|
||||
name="AnthropicApiKey"
|
||||
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="Anthropic Claude-2 API Key"
|
||||
placeholder="Anthropic API Key"
|
||||
defaultValue={settings?.AnthropicApiKey ? "*".repeat(20) : ""}
|
||||
required={true}
|
||||
autoComplete="off"
|
||||
@@ -90,47 +90,8 @@ export default function AnthropicAiOptions({ settings }) {
|
||||
);
|
||||
}
|
||||
|
||||
const DEFAULT_MODELS = [
|
||||
{
|
||||
id: "claude-3-7-sonnet-20250219",
|
||||
name: "Claude 3.7 Sonnet",
|
||||
},
|
||||
{
|
||||
id: "claude-3-5-sonnet-20241022",
|
||||
name: "Claude 3.5 Sonnet (New)",
|
||||
},
|
||||
{
|
||||
id: "claude-3-5-haiku-20241022",
|
||||
name: "Claude 3.5 Haiku",
|
||||
},
|
||||
{
|
||||
id: "claude-3-5-sonnet-20240620",
|
||||
name: "Claude 3.5 Sonnet (Old)",
|
||||
},
|
||||
{
|
||||
id: "claude-3-haiku-20240307",
|
||||
name: "Claude 3 Haiku",
|
||||
},
|
||||
{
|
||||
id: "claude-3-opus-20240229",
|
||||
name: "Claude 3 Opus",
|
||||
},
|
||||
{
|
||||
id: "claude-3-sonnet-20240229",
|
||||
name: "Claude 3 Sonnet",
|
||||
},
|
||||
{
|
||||
id: "claude-2.1",
|
||||
name: "Claude 2.1",
|
||||
},
|
||||
{
|
||||
id: "claude-2.0",
|
||||
name: "Claude 2.0",
|
||||
},
|
||||
];
|
||||
|
||||
function AnthropicModelSelection({ apiKey, settings }) {
|
||||
const [models, setModels] = useState(DEFAULT_MODELS);
|
||||
const [models, setModels] = useState([]);
|
||||
const [loading, setLoading] = useState(true);
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
@@ -61,7 +61,7 @@ export default function ChatModelSelection({
|
||||
value={model.id}
|
||||
selected={selectedLLMModel === model.id}
|
||||
>
|
||||
{model.id}
|
||||
{model.name || model.id}
|
||||
</option>
|
||||
);
|
||||
})}
|
||||
|
||||
@@ -156,7 +156,7 @@ export default function AgentModelSelection({
|
||||
value={model.id}
|
||||
selected={workspace?.agentModel === model.id}
|
||||
>
|
||||
{model.name}
|
||||
{model.name || model.id}
|
||||
</option>
|
||||
);
|
||||
})}
|
||||
|
||||
@@ -81,7 +81,7 @@ export default function ChatModelSelection({
|
||||
value={model.id}
|
||||
selected={workspace?.chatModel === model.id}
|
||||
>
|
||||
{model.id}
|
||||
{model.name || model.id}
|
||||
</option>
|
||||
);
|
||||
})}
|
||||
@@ -99,7 +99,7 @@ export default function ChatModelSelection({
|
||||
value={model.id}
|
||||
selected={workspace?.chatModel === model.id}
|
||||
>
|
||||
{model.name}
|
||||
{model.name || model.id}
|
||||
</option>
|
||||
))}
|
||||
</optgroup>
|
||||
|
||||
@@ -23,7 +23,7 @@ SIG_SALT='salt' # Please generate random string at least 32 chars long.
|
||||
|
||||
# LLM_PROVIDER='anthropic'
|
||||
# ANTHROPIC_API_KEY=sk-ant-xxxx
|
||||
# ANTHROPIC_MODEL_PREF='claude-2'
|
||||
# ANTHROPIC_MODEL_PREF='claude-sonnet-4-6'
|
||||
# ANTHROPIC_CACHE_CONTROL="5m" # Enable prompt caching (5m=5min cache, 1h=1hour cache). Reduces costs and improves speed by caching system prompts.
|
||||
|
||||
# LLM_PROVIDER='lmstudio'
|
||||
|
||||
@@ -727,7 +727,8 @@ const SystemSettings = {
|
||||
|
||||
// Anthropic Keys
|
||||
AnthropicApiKey: !!process.env.ANTHROPIC_API_KEY,
|
||||
AnthropicModelPref: process.env.ANTHROPIC_MODEL_PREF || "claude-2",
|
||||
AnthropicModelPref:
|
||||
process.env.ANTHROPIC_MODEL_PREF || "claude-sonnet-4-6",
|
||||
AnthropicCacheControl: process.env.ANTHROPIC_CACHE_CONTROL || "none",
|
||||
|
||||
// Gemini Keys
|
||||
|
||||
@@ -8,7 +8,7 @@ const { getAnythingLLMUserAgent } = require("../../../../endpoints/utils");
|
||||
|
||||
/**
|
||||
* The agent provider for the Anthropic API.
|
||||
* By default, the model is set to 'claude-2'.
|
||||
* By default, the model is set to 'claude-sonnet-4-6'.
|
||||
*/
|
||||
class AnthropicProvider extends Provider {
|
||||
model;
|
||||
@@ -23,7 +23,7 @@ class AnthropicProvider extends Provider {
|
||||
"User-Agent": getAnythingLLMUserAgent(),
|
||||
},
|
||||
},
|
||||
model = "claude-3-5-sonnet-20240620",
|
||||
model = "claude-sonnet-4-6",
|
||||
} = config;
|
||||
|
||||
const client = new Anthropic(options);
|
||||
|
||||
Reference in New Issue
Block a user