@@ -17,6 +17,7 @@ export type ModelDownloaderOptions = ({
1717 *
1818 * The supported URI schemes are:
1919 * - **HTTP:** `https://`, `http://`
20+ * - **Hugging Face:** `hf:<user>/<model>:<quant>` (`#<quant>` is optional, but recommended)
2021 * - **Hugging Face:** `hf:<user>/<model>/<file-path>#<branch>` (`#<branch>` is optional)
2122 */
2223 modelUri : string
@@ -83,6 +84,7 @@ export type ModelDownloaderOptions = ({
8384 *
8485 * The supported URI schemes are:
8586 * - **HTTP:** `https://`, `http://`
87+ * - **Hugging Face:** `hf:<user>/<model>:<quant>` (`#<quant>` is optional, but recommended)
8688 * - **Hugging Face:** `hf:<user>/<model>/<file-path>#<branch>` (`#<branch>` is optional)
8789 * @example
8890 * ```typescript
@@ -112,7 +114,7 @@ export type ModelDownloaderOptions = ({
112114 * const __dirname = path.dirname(fileURLToPath(import.meta.url));
113115 *
114116 * const downloader = await createModelDownloader({
115- * modelUri: "hf:user/model/model-file.gguf ",
117+ * modelUri: "hf:user/model:quant ",
116118 * dirPath: path.join(__dirname, "models")
117119 * });
118120 * const modelPath = await downloader.download();
@@ -153,7 +155,11 @@ export function createModelDownloader(options: ModelDownloaderOptions) {
153155 * dirPath: path.join(__dirname, "models")
154156 * }),
155157 * createModelDownloader({
156- * modelUri: "hf:user/model/model2.gguf",
158+ * modelUri: "hf:user/model2:quant",
159+ * dirPath: path.join(__dirname, "models")
160+ * }),
161+ * createModelDownloader({
162+ * modelUri: "hf:user/model/model3.gguf",
157163 * dirPath: path.join(__dirname, "models")
158164 * })
159165 * ];
@@ -162,7 +168,8 @@ export function createModelDownloader(options: ModelDownloaderOptions) {
162168 * });
163169 * const [
164170 * model1Path,
165- * model2Path
171+ * model2Path,
172+ * model3Path
166173 * ] = await combinedDownloader.download();
167174 *
168175 * const llama = await getLlama();
@@ -172,6 +179,9 @@ export function createModelDownloader(options: ModelDownloaderOptions) {
172179 * const model2 = await llama.loadModel({
173180 * modelPath: model2Path!
174181 * });
182+ * const model3 = await llama.loadModel({
183+ * modelPath: model3Path!
184+ * });
175185 * ```
176186 */
177187export async function combineModelDownloaders (
0 commit comments