From 6c78147980c017f748a4bc2234782baff46eff70 Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Mon, 20 Jul 2026 05:28:31 -0700 Subject: [PATCH] Studio: do not show Run for embedding-only non-GGUF models in the Model Hub (#7245) * Studio: do not show Run for embedding-only non-GGUF models in the Model Hub A downloaded embedding-only repo (sentence-transformers, feature-extraction) reports canChat by safetensors format and classifies as supported, so the Model Hub showed a Run button that dead-ends at load. Keep embedding-only non-GGUF models out of the Run gate. GGUF is unaffected (llama.cpp resolves embed vs generate at load time), and these models stay trainable. * Gate embedding-only models on the pipeline tag, not just capabilities An embedding repo whose name or tags also imply code, vision, audio or reasoning (e.g. jina-embeddings-v2-base-code picks up code from its -code suffix) slipped the embedding-only Run gate and dead-ended on a chat load. Treat a feature-extraction or sentence-similarity pipeline tag as authoritative for the gate; the change only ever widens it. * studio: tighten comments in the hub embedding run guard * Tighten comments in the hub embedding run guard --------- Co-authored-by: danielhanchen --- .../features/hub/catalog/model-inspector.tsx | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/studio/frontend/src/features/hub/catalog/model-inspector.tsx b/studio/frontend/src/features/hub/catalog/model-inspector.tsx index 63cb34678b..5a6ae1615a 100644 --- a/studio/frontend/src/features/hub/catalog/model-inspector.tsx +++ b/studio/frontend/src/features/hub/catalog/model-inspector.tsx @@ -59,6 +59,13 @@ import { ModelReadme } from "./model-readme"; import { OwnerAvatar } from "./owner-avatar"; import { AccessChip, CapabilityPill } from "./shared"; +// HF pipeline_tag values authoritative for embedding-only repos; capability +// labels (code/vision/audio) can leak onto them via name or tags. +const EMBEDDING_PIPELINE_TAGS: ReadonlySet = new Set([ + "feature-extraction", + "sentence-similarity", +]); + function ViewRepositoryButton({ repoId, isDataset, @@ -531,11 +538,27 @@ export const ModelInspector = memo(function ModelInspector({ ? formatCompact(model.totalParams) : "N/A"; const unslothSupported = unslothSupport.status !== "unsupported"; + // Embedding-only non-GGUF repos have no generative head, so keep them out of + // the Run gate. Prefer the pipeline tag, else the capability heuristic. + const isEmbeddingOnly = + !model.isGguf && + model.capabilities.some((c) => c.key === "embedding") && + (EMBEDDING_PIPELINE_TAGS.has(model.pipelineTag?.toLowerCase() ?? "") || + !model.capabilities.some( + (c) => + c.key === "conversational" || + c.key === "tools" || + c.key === "reasoning" || + c.key === "code" || + c.key === "vision" || + c.key === "audio", + )); // Chat-only hosts (no supported GPU / usable MLX) run inference only through // llama.cpp, so only GGUF is loadable. const canRunModel = !isDataset && (model.runtimeCapabilities?.canChat ?? true) && + !isEmbeddingOnly && (model.isGguf || (!chatOnly && unslothSupported)); const canTrainModel = !isDataset &&