mirror of
https://github.com/ggml-org/llama.cpp.git
synced 2026-10-03 03:17:32 -05:00
ui : turn the hub metadata off by default
No request leaves the browser until the user enables it, and a todo notes that onboarding should suggest it. The hub gate now reads through the service so the setting has a single source of truth. Assisted-by: pi (deepseek-ai/DeepSeek-V4.1-Flash)
This commit is contained in:
+3
-3
@@ -4,10 +4,10 @@
|
||||
import { Trash2 } from '@lucide/svelte';
|
||||
import { DialogConfirmDownload } from '$lib/components/app/dialogs';
|
||||
import { Button } from '$lib/components/ui/button';
|
||||
import { MODEL_ID, SETTINGS_KEYS } from '$lib/constants';
|
||||
import { MODEL_ID } from '$lib/constants';
|
||||
import { ModelDownloadConfirmAction, ServerModelStatus } from '$lib/enums';
|
||||
import { HuggingFaceService } from '$lib/services';
|
||||
import { modelsStore, settingsStore } from '$lib/stores';
|
||||
import { modelsStore } from '$lib/stores';
|
||||
import type { HfModelDetailInfo } from '$lib/types/huggingface';
|
||||
import type { ModelOption } from '$lib/types/models';
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
|
||||
hubDetails = null;
|
||||
|
||||
if (!settingsStore.config[SETTINGS_KEYS.USE_HUGGING_FACE_HUB] || !repo.includes('/')) {
|
||||
if (!HuggingFaceService.isEnabled() || !repo.includes('/')) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -129,7 +129,8 @@ export const SETTINGS_REGISTRY: SettingsSectionEntry[] = [
|
||||
type: SettingsFieldType.CHECKBOX
|
||||
},
|
||||
{
|
||||
defaultValue: true,
|
||||
// TODO: the Hub is off until onboarding suggests turning it on
|
||||
defaultValue: false,
|
||||
help: 'Fetch model metadata (avatars, context length, chat template, file sizes) from the Hugging Face Hub. When off, the UI only shows what the server reports for /v1/models and hides the org avatars.',
|
||||
key: SETTINGS_KEYS.USE_HUGGING_FACE_HUB,
|
||||
label: 'Use Hugging Face Hub API for models metadata',
|
||||
|
||||
@@ -611,12 +611,12 @@ export class HuggingFaceService {
|
||||
}
|
||||
|
||||
/**
|
||||
* True when the UI may read model metadata from the Hugging Face Hub. On by
|
||||
* True when the UI may read model metadata from the Hugging Face Hub. Off by
|
||||
* default: with it off, callers only see what the server's /v1/models reports
|
||||
* and the org avatars stay hidden.
|
||||
*/
|
||||
static isEnabled(): boolean {
|
||||
return settingsStore.config[SETTINGS_KEYS.USE_HUGGING_FACE_HUB] ?? true;
|
||||
return settingsStore.config[SETTINGS_KEYS.USE_HUGGING_FACE_HUB] ?? false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -16,8 +16,7 @@ import {
|
||||
MODEL_ROW_WINDOW,
|
||||
RECENT_MODEL_LIMIT,
|
||||
RECENT_MODEL_USAGE_LOCALSTORAGE_KEY,
|
||||
RECENT_MODELS_LOCALSTORAGE_KEY,
|
||||
SETTINGS_KEYS
|
||||
RECENT_MODELS_LOCALSTORAGE_KEY
|
||||
} from '$lib/constants';
|
||||
import { ServerModelStatus } from '$lib/enums';
|
||||
import { HuggingFaceService } from '$lib/services/huggingface.service';
|
||||
@@ -27,7 +26,6 @@ import { conversationsStore } from '$lib/stores/conversations/index.svelte';
|
||||
import { type ModelPropsHost, ModelPropsManager } from '$lib/stores/models/props.svelte';
|
||||
import { type ModelStatusHost, ModelStatusManager } from '$lib/stores/models/status.svelte';
|
||||
import { serverStore } from '$lib/stores/server.svelte';
|
||||
import { settingsStore } from '$lib/stores/settings/index.svelte';
|
||||
import type { ModelSidecarBadge, ParsedModelId } from '$lib/types/models';
|
||||
import { getConversationModel } from '$lib/utils/conversation-utils';
|
||||
import { isAuxSidecar } from '$lib/utils/sidecars';
|
||||
@@ -547,7 +545,7 @@ class ModelsStore implements ModelPropsHost, ModelStatusHost {
|
||||
* the server reports only once a model is loaded.
|
||||
*/
|
||||
warmHubDetails(): void {
|
||||
if (!settingsStore.config[SETTINGS_KEYS.USE_HUGGING_FACE_HUB]) return;
|
||||
if (!HuggingFaceService.isEnabled()) return;
|
||||
|
||||
const repos: string[] = [];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user