feat: add Hugging Face model source support (#8330)

Add support for Hugging Face as a model source in the Model Info Panel.

- Display HF logo for Hugging Face sources
- Extract source URL from `repo_url` metadata field

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-8330-feat-add-Hugging-Face-model-source-support-2f56d73d3650816b8a01d903411ee3a1)
by [Unito](https://www.unito.io)

Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
Alexander Brown
2026-01-26 20:37:18 -08:00
committed by GitHub
parent 02c20786b8
commit c8785c32dd
2 changed files with 9 additions and 0 deletions

View File

@@ -50,6 +50,12 @@
alt=""
class="size-4 shrink-0"
/>
<img
v-else-if="sourceName === 'Hugging Face'"
src="/assets/images/hf-logo.svg"
alt=""
class="size-4 shrink-0"
/>
{{ t('assetBrowser.modelInfo.viewOnSource', { source: sourceName }) }}
<i class="icon-[lucide--external-link] size-4 shrink-0" />
</a>

View File

@@ -72,6 +72,9 @@ export function getAssetDisplayName(asset: AssetItem): string {
* @returns The source URL or null if not present/parseable
*/
export function getAssetSourceUrl(asset: AssetItem): string | null {
if (typeof asset.metadata?.repo_url === 'string') {
return asset.metadata.repo_url
}
// Note: Reversed priority for backwards compatibility
const sourceArn =
asset.metadata?.source_arn ?? asset.user_metadata?.source_arn