Table of Contents

Class HuggingFaceModelSource

Namespace
JD.AI.Core.LocalModels.Sources
Assembly
JD.AI.Core.dll

Searches HuggingFace Hub for GGUF model files.

public sealed class HuggingFaceModelSource : IModelSource
Inheritance
HuggingFaceModelSource
Implements
Inherited Members

Constructors

HuggingFaceModelSource(string)

public HuggingFaceModelSource(string cacheDir)

Parameters

cacheDir string

Methods

GetDownloadUrl(string, string)

Construct a download URL for a specific file in a HuggingFace repo.

public static Uri GetDownloadUrl(string repoId, string filename)

Parameters

repoId string
filename string

Returns

Uri

ScanAsync(CancellationToken)

Scans locally cached HuggingFace models (does not download).

public Task<IReadOnlyList<ModelMetadata>> ScanAsync(CancellationToken ct = default)

Parameters

ct CancellationToken

Returns

Task<IReadOnlyList<ModelMetadata>>

SearchAsync(string, int, CancellationToken)

Search HuggingFace Hub API for GGUF model repos.

public Task<IReadOnlyList<HuggingFaceSearchResult>> SearchAsync(string query, int limit = 20, CancellationToken ct = default)

Parameters

query string
limit int
ct CancellationToken

Returns

Task<IReadOnlyList<HuggingFaceSearchResult>>