You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -13,7 +13,7 @@ The catalog service operates as a **metadata aggregation layer** that:
13
13
### Supported Catalog Sources
14
14
15
15
-**YAML Catalog** - Static YAML files containing model metadata
16
-
-**HuggingFace Hub** - Discover models from HuggingFace's model repository
16
+
-**Hugging Face Hub** - Discover models from Hugging Face's model repository
17
17
18
18
## REST API
19
19
@@ -274,20 +274,16 @@ catalogs:
274
274
path: "./models"
275
275
```
276
276
277
-
### HuggingFace Source Configuration
277
+
### Hugging Face Source Configuration
278
278
279
-
The HuggingFace catalog source allows you to discover and import models from the HuggingFace Hub. To configure a HuggingFace source:
279
+
The Hugging Face catalog source allows you to discover and import models from the Hugging Face Hub. To configure a Hugging Face source:
280
280
281
281
#### 1. Set Your API Key
282
282
283
283
Setting a Hugging Face API key is optional. Hugging Face requires an API key for authentication for full access to data of models that are private and/or gated. If an API key is NOT set, private models will be entirely unavailable and gated models will have limited metadata. By default, the service reads the API key from the `HF_API_KEY` environment variable:
284
284
285
-
```bash
286
-
export HF_API_KEY="your-huggingface-api-key-here"
287
-
```
288
-
289
-
**Getting a HuggingFace API Key:**
290
-
1. Sign up or log in to [HuggingFace](https://huggingface.co)
285
+
**Getting a Hugging Face API Key:**
286
+
1. Sign up or log in to [Hugging Face](https://huggingface.co)
291
287
2. Go to your [Settings > Access Tokens](https://huggingface.co/settings/tokens)
292
288
3. Create a new token with "Read" permissions
293
289
4. Copy the token and set it as an environment variable
You can configure a custom environment variable name per source by setting the `apiKeyEnvVar` property in your source configuration (see below). This is useful when you need different API keys for different sources.
302
306
303
307
**Important Notes:**
304
308
- **Private Models**: For private models, the API key must belong to an account that has been granted access to the model. Without proper access, the catalog service will not be able to retrieve model information.
305
-
- **Gated Models**: For gated models (models with usage restrictions), you must accept the model's terms of service on HuggingFace before the catalog service can access all available model information. Visit the model's page on HuggingFace and accept the terms to ensure full metadata is available.
309
+
- **Gated Models**: For gated models (models with usage restrictions), you must accept the model's terms of service on Hugging Face before the catalog service can access all available model information. Visit the model's page on Hugging Face and accept the terms to ensure full metadata is available.
306
310
307
311
#### 2. Configure the Source
308
312
309
-
Add a HuggingFace source to your `catalog-sources.yaml`:
313
+
Add a Hugging Face source to your `catalog-sources.yaml`:
310
314
311
315
```yaml
312
316
catalogs:
313
-
- name: "HuggingFace Hub"
317
+
- name: "Hugging Face Hub"
314
318
id: "huggingface"
315
319
type: "hf"
316
320
enabled: true
317
321
# Required: List of model identifiers to include
318
322
# Format: "organization/model-name" or "username/model-name"
323
+
# Supports wildcard patterns: "organization/*" or "organization/prefix*"
319
324
includedModels:
320
325
- "meta-llama/Llama-3.1-8B-Instruct"
321
-
- "ibm-granite/granite-4.0-h-small"
322
326
- "microsoft/phi-2"
323
-
327
+
- "microsoft/phi-3*" # All models starting with "phi-3"
328
+
324
329
# Optional: Exclude specific models or patterns
325
330
# Supports exact matches or patterns ending with "*"
326
331
excludedModels:
327
332
- "some-org/unwanted-model"
328
333
- "another-org/test-*" # Excludes all models starting with "test-"
329
-
334
+
330
335
# Optional: Configure a custom environment variable name for the API key
331
336
# Defaults to "HF_API_KEY" if not specified
332
337
properties:
333
338
apiKeyEnvVar: "MY_CUSTOM_API_KEY_VAR"
334
339
```
335
340
341
+
#### Organization-Restricted Sources
342
+
343
+
You can restrict a source to only fetch models from a specific organization using the `allowedOrganization` property. This automatically prefixes all model patterns with the organization name:
344
+
345
+
```yaml
346
+
catalogs:
347
+
- name: "Meta LLaMA Models"
348
+
id: "meta-llama-models"
349
+
type: "hf"
350
+
enabled: true
351
+
properties:
352
+
allowedOrganization: "meta-llama"
353
+
apiKeyEnvVar: "HF_API_KEY"
354
+
includedModels:
355
+
# These patterns are automatically prefixed with "meta-llama/"
356
+
- "*" # Expands to: meta-llama/*
357
+
- "Llama-3*" # Expands to: meta-llama/Llama-3*
358
+
- "CodeLlama-*" # Expands to: meta-llama/CodeLlama-*
359
+
excludedModels:
360
+
- "*-4bit" # Excludes: meta-llama/*-4bit
361
+
- "*-GGUF" # Excludes: meta-llama/*-GGUF
362
+
```
363
+
364
+
**Benefits of organization-restricted sources:**
365
+
- **Simplified configuration**: No need to repeat organization name in every pattern
366
+
- **Security**: Prevents accidental inclusion of models from other organizations
367
+
- **Convenience**: Use `"*"` to get all models from an organization
368
+
- **Performance**: Optimized API calls when fetching from a single organization
369
+
336
370
#### Model Filtering
337
371
338
372
Both `includedModels` and `excludedModels` are top-level properties (not nested under `properties`):
339
373
340
-
- **`includedModels`** (required): List of model identifiers to fetch from HuggingFace. Format: `"organization/model-name"` or `"username/model-name"`
374
+
- **`includedModels`** (required): List of model identifiers to fetch from Hugging Face
341
375
- **`excludedModels`** (optional): List of models or patterns to exclude from the results
342
376
343
-
The `excludedModels` property supports:
377
+
#### Supported Pattern Types
378
+
379
+
**Exact Model Names:**
380
+
```yaml
381
+
includedModels:
382
+
- "meta-llama/Llama-3.1-8B-Instruct" # Specific model
383
+
- "microsoft/phi-2" # Specific model
384
+
```
385
+
386
+
**Wildcard Patterns:**
387
+
388
+
In `includedModels`, wildcards can match model names by a prefix.
389
+
390
+
```yaml
391
+
includedModels:
392
+
- "microsoft/phi-*" # All models starting with "phi-"
393
+
- "meta-llama/Llama-3*" # All models starting with "Llama-3"
394
+
- "huggingface/*" # All models from huggingface organization
0 commit comments