@auxot/model-registry 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +68 -0
- package/dist/src/index.d.ts +11 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +10 -0
- package/dist/src/loader.d.ts +16 -0
- package/dist/src/loader.d.ts.map +1 -0
- package/dist/src/loader.js +85 -0
- package/dist/src/query.d.ts +25 -0
- package/dist/src/query.d.ts.map +1 -0
- package/dist/src/query.js +80 -0
- package/dist/src/schemas.d.ts +131 -0
- package/dist/src/schemas.d.ts.map +1 -0
- package/dist/src/schemas.js +39 -0
- package/dist/src/types.d.ts +72 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/types.js +7 -0
- package/package.json +34 -0
- package/registry.json +10806 -0
package/README.md
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# @auxot/model-registry
|
|
2
|
+
|
|
3
|
+
Shared model registry package for worker-cli and web applications.
|
|
4
|
+
|
|
5
|
+
This package contains curated information about LLM models available for use with worker-cli, including model metadata, Hugging Face IDs, VRAM requirements, and capabilities.
|
|
6
|
+
|
|
7
|
+
## Structure
|
|
8
|
+
|
|
9
|
+
- `registry.json` - Generated JSON file containing model definitions (committed to repo)
|
|
10
|
+
- `src/types.ts` - TypeScript type definitions
|
|
11
|
+
- `src/schemas.ts` - Zod validation schemas
|
|
12
|
+
- `src/loader.ts` - Runtime loader for registry.json
|
|
13
|
+
- `src/query.ts` - Query functions for filtering and searching models
|
|
14
|
+
- `scripts/build-registry.ts` - Build script to generate registry.json from Hugging Face
|
|
15
|
+
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
```typescript
|
|
19
|
+
import { loadRegistry, getModels, getModelById, suggestModelsForVRAM } from '@auxot/model-registry';
|
|
20
|
+
|
|
21
|
+
// Load the registry
|
|
22
|
+
const registry = loadRegistry();
|
|
23
|
+
|
|
24
|
+
// Get all models
|
|
25
|
+
const allModels = getModels(registry);
|
|
26
|
+
|
|
27
|
+
// Filter models
|
|
28
|
+
const chatModels = getModels(registry, { capabilities: ['chat'] });
|
|
29
|
+
const largeModels = getModels(registry, { min_vram_gb: 20 });
|
|
30
|
+
|
|
31
|
+
// Get a specific model
|
|
32
|
+
const model = getModelById(registry, 'qwen2.5-coder-30b-q4_k_m');
|
|
33
|
+
|
|
34
|
+
// Suggest models for VRAM budget
|
|
35
|
+
const suggestions = suggestModelsForVRAM(registry, 24, 1); // 24GB VRAM, parallelism 1
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Building the Registry
|
|
39
|
+
|
|
40
|
+
To generate or update `registry.json`, run:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
pnpm --filter @auxot/model-registry run build:registry
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
This will scan Hugging Face for compatible models and generate the registry JSON file.
|
|
47
|
+
|
|
48
|
+
The registry is committed to the repository, so it's available at runtime without needing to run the build script.
|
|
49
|
+
|
|
50
|
+
## Registry JSON Structure
|
|
51
|
+
|
|
52
|
+
See `src/types.ts` for the complete TypeScript definitions. The registry contains:
|
|
53
|
+
|
|
54
|
+
- `version` - Registry version (semver)
|
|
55
|
+
- `generated_at` - ISO timestamp when registry was generated
|
|
56
|
+
- `models` - Array of model entries with:
|
|
57
|
+
- `id` - Unique identifier
|
|
58
|
+
- `model_name` - Normalized model name
|
|
59
|
+
- `huggingface_id` - Full Hugging Face repo ID
|
|
60
|
+
- `quantization` - Quantization level (e.g. "Q4_K_M")
|
|
61
|
+
- `family` - Model family (MoE or Dense)
|
|
62
|
+
- `parameters` - Parameter count (e.g. "30B")
|
|
63
|
+
- `default_context_size` - Default context window size
|
|
64
|
+
- `vram_requirements_gb` - Estimated VRAM needed
|
|
65
|
+
- `capabilities` - Model capabilities (chat, vision, embedding, code)
|
|
66
|
+
- `file_name` - GGUF filename
|
|
67
|
+
- `file_size_bytes` - File size (optional)
|
|
68
|
+
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Model Registry Package
|
|
3
|
+
*
|
|
4
|
+
* Shared model registry for worker-cli and web applications.
|
|
5
|
+
* Contains curated information about LLM models available for use.
|
|
6
|
+
*/
|
|
7
|
+
export * from './types.js';
|
|
8
|
+
export * from './schemas.js';
|
|
9
|
+
export * from './loader.js';
|
|
10
|
+
export * from './query.js';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Model Registry Package
|
|
3
|
+
*
|
|
4
|
+
* Shared model registry for worker-cli and web applications.
|
|
5
|
+
* Contains curated information about LLM models available for use.
|
|
6
|
+
*/
|
|
7
|
+
export * from './types.js';
|
|
8
|
+
export * from './schemas.js';
|
|
9
|
+
export * from './loader.js';
|
|
10
|
+
export * from './query.js';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ModelRegistry } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Load the model registry JSON file
|
|
4
|
+
*
|
|
5
|
+
* The registry.json file is generated by the build script and should be
|
|
6
|
+
* in the package root directory.
|
|
7
|
+
*
|
|
8
|
+
* @returns The loaded and validated model registry
|
|
9
|
+
* @throws Error if registry file cannot be loaded or is invalid
|
|
10
|
+
*/
|
|
11
|
+
export declare function loadRegistry(): ModelRegistry;
|
|
12
|
+
/**
|
|
13
|
+
* Clear the cached registry (useful for testing or hot reloading)
|
|
14
|
+
*/
|
|
15
|
+
export declare function clearRegistryCache(): void;
|
|
16
|
+
//# sourceMappingURL=loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/loader.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAYhD;;;;;;;;GAQG;AACH,wBAAgB,YAAY,IAAI,aAAa,CAkE5C;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,IAAI,CAIzC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { readFileSync, statSync } from 'node:fs';
|
|
2
|
+
import { join, dirname } from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
import { validateModelRegistry } from './schemas.js';
|
|
5
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = dirname(__filename);
|
|
7
|
+
/**
|
|
8
|
+
* Cache for loaded registry (loaded once, reused)
|
|
9
|
+
*/
|
|
10
|
+
let cachedRegistry = null;
|
|
11
|
+
let cachedRegistryPath = null;
|
|
12
|
+
let cachedRegistryMtime = null;
|
|
13
|
+
/**
|
|
14
|
+
* Load the model registry JSON file
|
|
15
|
+
*
|
|
16
|
+
* The registry.json file is generated by the build script and should be
|
|
17
|
+
* in the package root directory.
|
|
18
|
+
*
|
|
19
|
+
* @returns The loaded and validated model registry
|
|
20
|
+
* @throws Error if registry file cannot be loaded or is invalid
|
|
21
|
+
*/
|
|
22
|
+
export function loadRegistry() {
|
|
23
|
+
// In development/build: registry.json is in package root
|
|
24
|
+
// In runtime (compiled): registry.json should be in package root (one level up from dist/src)
|
|
25
|
+
// Try package root first (for both development and runtime)
|
|
26
|
+
const registryPaths = [
|
|
27
|
+
join(__dirname, '..', '..', 'registry.json'), // From dist/src/ -> package root
|
|
28
|
+
join(__dirname, '..', 'registry.json'), // From dist/ -> package root (if running from dist/)
|
|
29
|
+
join(__dirname, 'registry.json'), // Same directory (if copied there)
|
|
30
|
+
];
|
|
31
|
+
let registryPath = null;
|
|
32
|
+
let lastError = null;
|
|
33
|
+
// Find which registry path exists
|
|
34
|
+
for (const path of registryPaths) {
|
|
35
|
+
try {
|
|
36
|
+
statSync(path); // Check if file exists
|
|
37
|
+
registryPath = path;
|
|
38
|
+
break;
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
lastError = error instanceof Error ? error : new Error(String(error));
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
if (!registryPath) {
|
|
46
|
+
throw new Error(`Failed to find registry.json. Tried: ${registryPaths.join(', ')}. ` +
|
|
47
|
+
`Last error: ${lastError?.message || 'unknown'}`);
|
|
48
|
+
}
|
|
49
|
+
// Check if file has been modified since last cache
|
|
50
|
+
try {
|
|
51
|
+
const stats = statSync(registryPath);
|
|
52
|
+
const currentMtime = stats.mtimeMs;
|
|
53
|
+
// If we have a cache and the file hasn't changed, return cached version
|
|
54
|
+
if (cachedRegistry !== null &&
|
|
55
|
+
cachedRegistryPath === registryPath &&
|
|
56
|
+
cachedRegistryMtime !== null &&
|
|
57
|
+
cachedRegistryMtime >= currentMtime) {
|
|
58
|
+
return cachedRegistry;
|
|
59
|
+
}
|
|
60
|
+
// File is new or modified, reload it
|
|
61
|
+
const content = readFileSync(registryPath, 'utf-8');
|
|
62
|
+
const registryData = JSON.parse(content);
|
|
63
|
+
// Validate the registry structure
|
|
64
|
+
const registry = validateModelRegistry(registryData);
|
|
65
|
+
// Update cache with new data and mtime
|
|
66
|
+
cachedRegistry = registry;
|
|
67
|
+
cachedRegistryPath = registryPath;
|
|
68
|
+
cachedRegistryMtime = currentMtime;
|
|
69
|
+
return registry;
|
|
70
|
+
}
|
|
71
|
+
catch (error) {
|
|
72
|
+
if (error instanceof Error) {
|
|
73
|
+
throw new Error(`Failed to load model registry: ${error.message}`);
|
|
74
|
+
}
|
|
75
|
+
throw error;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Clear the cached registry (useful for testing or hot reloading)
|
|
80
|
+
*/
|
|
81
|
+
export function clearRegistryCache() {
|
|
82
|
+
cachedRegistry = null;
|
|
83
|
+
cachedRegistryPath = null;
|
|
84
|
+
cachedRegistryMtime = null;
|
|
85
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ModelRegistry, ModelRegistryEntry, ModelRegistryFilters } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Query functions for the model registry
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Get all models from the registry (optionally filtered)
|
|
7
|
+
*/
|
|
8
|
+
export declare function getModels(registry: ModelRegistry, filters?: ModelRegistryFilters): ModelRegistryEntry[];
|
|
9
|
+
/**
|
|
10
|
+
* Get a single model by ID
|
|
11
|
+
*/
|
|
12
|
+
export declare function getModelById(registry: ModelRegistry, id: string): ModelRegistryEntry | null;
|
|
13
|
+
/**
|
|
14
|
+
* Suggest models that fit within the specified VRAM budget
|
|
15
|
+
*
|
|
16
|
+
* Returns models sorted by parameter count (larger first) that fit in the VRAM budget.
|
|
17
|
+
* Optionally allows for some parallelism (multiple models running simultaneously).
|
|
18
|
+
*
|
|
19
|
+
* @param registry The model registry
|
|
20
|
+
* @param vramGb Available VRAM in GB
|
|
21
|
+
* @param parallelism Number of models to run simultaneously (default: 1)
|
|
22
|
+
* @returns Array of suggested models, sorted by parameter count (largest first)
|
|
23
|
+
*/
|
|
24
|
+
export declare function suggestModelsForVRAM(registry: ModelRegistry, vramGb: number, parallelism?: number): ModelRegistryEntry[];
|
|
25
|
+
//# sourceMappingURL=query.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../src/query.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAE1F;;GAEG;AAEH;;GAEG;AACH,wBAAgB,SAAS,CAAC,QAAQ,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,oBAAoB,GAAG,kBAAkB,EAAE,CAoCvG;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,aAAa,EAAE,EAAE,EAAE,MAAM,GAAG,kBAAkB,GAAG,IAAI,CAE3F;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,aAAa,EACvB,MAAM,EAAE,MAAM,EACd,WAAW,GAAE,MAAU,GACtB,kBAAkB,EAAE,CAkCtB"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Query functions for the model registry
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Get all models from the registry (optionally filtered)
|
|
6
|
+
*/
|
|
7
|
+
export function getModels(registry, filters) {
|
|
8
|
+
let models = registry.models;
|
|
9
|
+
if (filters) {
|
|
10
|
+
if (filters.family) {
|
|
11
|
+
models = models.filter((m) => m.family === filters.family);
|
|
12
|
+
}
|
|
13
|
+
if (filters.capabilities && filters.capabilities.length > 0) {
|
|
14
|
+
models = models.filter((m) => filters.capabilities.every((cap) => m.capabilities.includes(cap)));
|
|
15
|
+
}
|
|
16
|
+
if (filters.parameters) {
|
|
17
|
+
models = models.filter((m) => m.parameters === filters.parameters);
|
|
18
|
+
}
|
|
19
|
+
if (filters.min_vram_gb !== undefined) {
|
|
20
|
+
models = models.filter((m) => m.vram_requirements_gb >= filters.min_vram_gb);
|
|
21
|
+
}
|
|
22
|
+
if (filters.max_vram_gb !== undefined) {
|
|
23
|
+
models = models.filter((m) => m.vram_requirements_gb <= filters.max_vram_gb);
|
|
24
|
+
}
|
|
25
|
+
if (filters.model_name) {
|
|
26
|
+
const searchTerm = filters.model_name.toLowerCase();
|
|
27
|
+
models = models.filter((m) => m.model_name.toLowerCase().includes(searchTerm) ||
|
|
28
|
+
m.huggingface_id.toLowerCase().includes(searchTerm));
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return models;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Get a single model by ID
|
|
35
|
+
*/
|
|
36
|
+
export function getModelById(registry, id) {
|
|
37
|
+
return registry.models.find((m) => m.id === id) ?? null;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Suggest models that fit within the specified VRAM budget
|
|
41
|
+
*
|
|
42
|
+
* Returns models sorted by parameter count (larger first) that fit in the VRAM budget.
|
|
43
|
+
* Optionally allows for some parallelism (multiple models running simultaneously).
|
|
44
|
+
*
|
|
45
|
+
* @param registry The model registry
|
|
46
|
+
* @param vramGb Available VRAM in GB
|
|
47
|
+
* @param parallelism Number of models to run simultaneously (default: 1)
|
|
48
|
+
* @returns Array of suggested models, sorted by parameter count (largest first)
|
|
49
|
+
*/
|
|
50
|
+
export function suggestModelsForVRAM(registry, vramGb, parallelism = 1) {
|
|
51
|
+
// Calculate effective VRAM per model (accounting for parallelism)
|
|
52
|
+
const effectiveVramPerModel = vramGb / parallelism;
|
|
53
|
+
// Filter models that fit in the effective VRAM
|
|
54
|
+
const fittingModels = registry.models.filter((m) => m.vram_requirements_gb <= effectiveVramPerModel);
|
|
55
|
+
// Sort by parameter count (largest first) then by VRAM (largest first)
|
|
56
|
+
const sorted = fittingModels.sort((a, b) => {
|
|
57
|
+
// Parse parameter count (e.g. "30B" -> 30, "7B" -> 7)
|
|
58
|
+
const parseParams = (params) => {
|
|
59
|
+
const match = params.match(/^(\d+(?:\.\d+)?)([BMK])?$/i);
|
|
60
|
+
if (!match)
|
|
61
|
+
return 0;
|
|
62
|
+
const value = parseFloat(match[1]);
|
|
63
|
+
const unit = match[2]?.toUpperCase();
|
|
64
|
+
if (unit === 'B')
|
|
65
|
+
return value * 1e9;
|
|
66
|
+
if (unit === 'M')
|
|
67
|
+
return value * 1e6;
|
|
68
|
+
if (unit === 'K')
|
|
69
|
+
return value * 1e3;
|
|
70
|
+
return value;
|
|
71
|
+
};
|
|
72
|
+
const paramsA = parseParams(a.parameters);
|
|
73
|
+
const paramsB = parseParams(b.parameters);
|
|
74
|
+
if (paramsA !== paramsB) {
|
|
75
|
+
return paramsB - paramsA; // Largest first
|
|
76
|
+
}
|
|
77
|
+
return b.vram_requirements_gb - a.vram_requirements_gb; // Largest first
|
|
78
|
+
});
|
|
79
|
+
return sorted;
|
|
80
|
+
}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { ModelRegistryEntry, ModelRegistry } from './types.js';
|
|
3
|
+
export declare const ModelRegistryEntrySchema: z.ZodObject<{
|
|
4
|
+
id: z.ZodString;
|
|
5
|
+
model_name: z.ZodString;
|
|
6
|
+
huggingface_id: z.ZodString;
|
|
7
|
+
quantization: z.ZodString;
|
|
8
|
+
family: z.ZodEnum<["MoE", "Dense"]>;
|
|
9
|
+
parameters: z.ZodString;
|
|
10
|
+
default_context_size: z.ZodNumber;
|
|
11
|
+
max_context_size: z.ZodNumber;
|
|
12
|
+
vram_requirements_gb: z.ZodNumber;
|
|
13
|
+
capabilities: z.ZodArray<z.ZodEnum<["chat", "vision", "embedding", "code"]>, "many">;
|
|
14
|
+
file_name: z.ZodString;
|
|
15
|
+
file_size_bytes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
16
|
+
}, "strip", z.ZodTypeAny, {
|
|
17
|
+
id: string;
|
|
18
|
+
model_name: string;
|
|
19
|
+
huggingface_id: string;
|
|
20
|
+
quantization: string;
|
|
21
|
+
family: "MoE" | "Dense";
|
|
22
|
+
parameters: string;
|
|
23
|
+
default_context_size: number;
|
|
24
|
+
max_context_size: number;
|
|
25
|
+
vram_requirements_gb: number;
|
|
26
|
+
capabilities: ("chat" | "vision" | "embedding" | "code")[];
|
|
27
|
+
file_name: string;
|
|
28
|
+
file_size_bytes?: number | null | undefined;
|
|
29
|
+
}, {
|
|
30
|
+
id: string;
|
|
31
|
+
model_name: string;
|
|
32
|
+
huggingface_id: string;
|
|
33
|
+
quantization: string;
|
|
34
|
+
family: "MoE" | "Dense";
|
|
35
|
+
parameters: string;
|
|
36
|
+
default_context_size: number;
|
|
37
|
+
max_context_size: number;
|
|
38
|
+
vram_requirements_gb: number;
|
|
39
|
+
capabilities: ("chat" | "vision" | "embedding" | "code")[];
|
|
40
|
+
file_name: string;
|
|
41
|
+
file_size_bytes?: number | null | undefined;
|
|
42
|
+
}>;
|
|
43
|
+
export declare const ModelRegistrySchema: z.ZodObject<{
|
|
44
|
+
version: z.ZodString;
|
|
45
|
+
generated_at: z.ZodString;
|
|
46
|
+
models: z.ZodArray<z.ZodObject<{
|
|
47
|
+
id: z.ZodString;
|
|
48
|
+
model_name: z.ZodString;
|
|
49
|
+
huggingface_id: z.ZodString;
|
|
50
|
+
quantization: z.ZodString;
|
|
51
|
+
family: z.ZodEnum<["MoE", "Dense"]>;
|
|
52
|
+
parameters: z.ZodString;
|
|
53
|
+
default_context_size: z.ZodNumber;
|
|
54
|
+
max_context_size: z.ZodNumber;
|
|
55
|
+
vram_requirements_gb: z.ZodNumber;
|
|
56
|
+
capabilities: z.ZodArray<z.ZodEnum<["chat", "vision", "embedding", "code"]>, "many">;
|
|
57
|
+
file_name: z.ZodString;
|
|
58
|
+
file_size_bytes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
59
|
+
}, "strip", z.ZodTypeAny, {
|
|
60
|
+
id: string;
|
|
61
|
+
model_name: string;
|
|
62
|
+
huggingface_id: string;
|
|
63
|
+
quantization: string;
|
|
64
|
+
family: "MoE" | "Dense";
|
|
65
|
+
parameters: string;
|
|
66
|
+
default_context_size: number;
|
|
67
|
+
max_context_size: number;
|
|
68
|
+
vram_requirements_gb: number;
|
|
69
|
+
capabilities: ("chat" | "vision" | "embedding" | "code")[];
|
|
70
|
+
file_name: string;
|
|
71
|
+
file_size_bytes?: number | null | undefined;
|
|
72
|
+
}, {
|
|
73
|
+
id: string;
|
|
74
|
+
model_name: string;
|
|
75
|
+
huggingface_id: string;
|
|
76
|
+
quantization: string;
|
|
77
|
+
family: "MoE" | "Dense";
|
|
78
|
+
parameters: string;
|
|
79
|
+
default_context_size: number;
|
|
80
|
+
max_context_size: number;
|
|
81
|
+
vram_requirements_gb: number;
|
|
82
|
+
capabilities: ("chat" | "vision" | "embedding" | "code")[];
|
|
83
|
+
file_name: string;
|
|
84
|
+
file_size_bytes?: number | null | undefined;
|
|
85
|
+
}>, "many">;
|
|
86
|
+
}, "strip", z.ZodTypeAny, {
|
|
87
|
+
version: string;
|
|
88
|
+
generated_at: string;
|
|
89
|
+
models: {
|
|
90
|
+
id: string;
|
|
91
|
+
model_name: string;
|
|
92
|
+
huggingface_id: string;
|
|
93
|
+
quantization: string;
|
|
94
|
+
family: "MoE" | "Dense";
|
|
95
|
+
parameters: string;
|
|
96
|
+
default_context_size: number;
|
|
97
|
+
max_context_size: number;
|
|
98
|
+
vram_requirements_gb: number;
|
|
99
|
+
capabilities: ("chat" | "vision" | "embedding" | "code")[];
|
|
100
|
+
file_name: string;
|
|
101
|
+
file_size_bytes?: number | null | undefined;
|
|
102
|
+
}[];
|
|
103
|
+
}, {
|
|
104
|
+
version: string;
|
|
105
|
+
generated_at: string;
|
|
106
|
+
models: {
|
|
107
|
+
id: string;
|
|
108
|
+
model_name: string;
|
|
109
|
+
huggingface_id: string;
|
|
110
|
+
quantization: string;
|
|
111
|
+
family: "MoE" | "Dense";
|
|
112
|
+
parameters: string;
|
|
113
|
+
default_context_size: number;
|
|
114
|
+
max_context_size: number;
|
|
115
|
+
vram_requirements_gb: number;
|
|
116
|
+
capabilities: ("chat" | "vision" | "embedding" | "code")[];
|
|
117
|
+
file_name: string;
|
|
118
|
+
file_size_bytes?: number | null | undefined;
|
|
119
|
+
}[];
|
|
120
|
+
}>;
|
|
121
|
+
export type ModelRegistryEntryInput = z.input<typeof ModelRegistryEntrySchema>;
|
|
122
|
+
export type ModelRegistryInput = z.input<typeof ModelRegistrySchema>;
|
|
123
|
+
/**
|
|
124
|
+
* Validate a model registry entry
|
|
125
|
+
*/
|
|
126
|
+
export declare function validateModelRegistryEntry(data: unknown): ModelRegistryEntry;
|
|
127
|
+
/**
|
|
128
|
+
* Validate a complete model registry
|
|
129
|
+
*/
|
|
130
|
+
export declare function validateModelRegistry(data: unknown): ModelRegistry;
|
|
131
|
+
//# sourceMappingURL=schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,kBAAkB,EAAE,aAAa,EAAwB,MAAM,YAAY,CAAC;AAY1F,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAanC,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAI9B,CAAC;AAEH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC/E,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAErE;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,OAAO,GAAG,kBAAkB,CAE5E;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,OAAO,GAAG,aAAa,CAElE"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Model Registry Zod Schemas
|
|
4
|
+
*
|
|
5
|
+
* Validation schemas for the model registry JSON structure.
|
|
6
|
+
*/
|
|
7
|
+
const ModelCapabilitySchema = z.enum(['chat', 'vision', 'embedding', 'code']);
|
|
8
|
+
const ModelFamilySchema = z.enum(['MoE', 'Dense']);
|
|
9
|
+
export const ModelRegistryEntrySchema = z.object({
|
|
10
|
+
id: z.string(),
|
|
11
|
+
model_name: z.string(),
|
|
12
|
+
huggingface_id: z.string(),
|
|
13
|
+
quantization: z.string(),
|
|
14
|
+
family: ModelFamilySchema,
|
|
15
|
+
parameters: z.string(),
|
|
16
|
+
default_context_size: z.number().int().positive(),
|
|
17
|
+
max_context_size: z.number().int().positive(),
|
|
18
|
+
vram_requirements_gb: z.number().positive(),
|
|
19
|
+
capabilities: z.array(ModelCapabilitySchema).min(1),
|
|
20
|
+
file_name: z.string(),
|
|
21
|
+
file_size_bytes: z.number().int().positive().nullable().optional(),
|
|
22
|
+
});
|
|
23
|
+
export const ModelRegistrySchema = z.object({
|
|
24
|
+
version: z.string(),
|
|
25
|
+
generated_at: z.string(),
|
|
26
|
+
models: z.array(ModelRegistryEntrySchema),
|
|
27
|
+
});
|
|
28
|
+
/**
|
|
29
|
+
* Validate a model registry entry
|
|
30
|
+
*/
|
|
31
|
+
export function validateModelRegistryEntry(data) {
|
|
32
|
+
return ModelRegistryEntrySchema.parse(data);
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Validate a complete model registry
|
|
36
|
+
*/
|
|
37
|
+
export function validateModelRegistry(data) {
|
|
38
|
+
return ModelRegistrySchema.parse(data);
|
|
39
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Model Registry Types
|
|
3
|
+
*
|
|
4
|
+
* Type definitions for the model registry JSON structure.
|
|
5
|
+
* The registry contains curated information about LLM models available for use with worker-cli.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Model capabilities supported by workers
|
|
9
|
+
*/
|
|
10
|
+
export type ModelCapability = 'chat' | 'vision' | 'embedding' | 'code';
|
|
11
|
+
/**
|
|
12
|
+
* Model family type (architecture)
|
|
13
|
+
*/
|
|
14
|
+
export type ModelFamily = 'MoE' | 'Dense';
|
|
15
|
+
/**
|
|
16
|
+
* Individual model entry in the registry
|
|
17
|
+
*/
|
|
18
|
+
export interface ModelRegistryEntry {
|
|
19
|
+
/** Unique ID: "model-name-quantization" (e.g. "qwen2.5-coder-30b-q4_k_m") */
|
|
20
|
+
id: string;
|
|
21
|
+
/** Normalized model name (e.g. "Qwen2.5-Coder-30B") */
|
|
22
|
+
model_name: string;
|
|
23
|
+
/** Full Hugging Face repo ID (e.g. "Qwen/Qwen2.5-Coder-30B-A3B-Instruct-GGUF") */
|
|
24
|
+
huggingface_id: string;
|
|
25
|
+
/** Quantization level (e.g. "Q4_K_M", "Q8_0") */
|
|
26
|
+
quantization: string;
|
|
27
|
+
/** Model family (architecture) */
|
|
28
|
+
family: ModelFamily;
|
|
29
|
+
/** Parameter count (e.g. "30B", "7B") */
|
|
30
|
+
parameters: string;
|
|
31
|
+
/** Default context window size */
|
|
32
|
+
default_context_size: number;
|
|
33
|
+
/** Maximum context window size supported by the model */
|
|
34
|
+
max_context_size: number;
|
|
35
|
+
/** Estimated VRAM required in GB */
|
|
36
|
+
vram_requirements_gb: number;
|
|
37
|
+
/** Model capabilities */
|
|
38
|
+
capabilities: ModelCapability[];
|
|
39
|
+
/** GGUF filename pattern or exact name */
|
|
40
|
+
file_name: string;
|
|
41
|
+
/** File size in bytes (optional) */
|
|
42
|
+
file_size_bytes?: number | null;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Complete model registry structure
|
|
46
|
+
*/
|
|
47
|
+
export interface ModelRegistry {
|
|
48
|
+
/** Registry version (semver) */
|
|
49
|
+
version: string;
|
|
50
|
+
/** ISO timestamp when registry was generated */
|
|
51
|
+
generated_at: string;
|
|
52
|
+
/** List of models */
|
|
53
|
+
models: ModelRegistryEntry[];
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Filters for querying the registry
|
|
57
|
+
*/
|
|
58
|
+
export interface ModelRegistryFilters {
|
|
59
|
+
/** Filter by family */
|
|
60
|
+
family?: ModelFamily;
|
|
61
|
+
/** Filter by capabilities (must have all specified) */
|
|
62
|
+
capabilities?: ModelCapability[];
|
|
63
|
+
/** Filter by parameter count (e.g. "30B") */
|
|
64
|
+
parameters?: string;
|
|
65
|
+
/** Minimum VRAM in GB */
|
|
66
|
+
min_vram_gb?: number;
|
|
67
|
+
/** Maximum VRAM in GB */
|
|
68
|
+
max_vram_gb?: number;
|
|
69
|
+
/** Filter by model name (partial match) */
|
|
70
|
+
model_name?: string;
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,QAAQ,GAAG,WAAW,GAAG,MAAM,CAAC;AAEvE;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,OAAO,CAAC;AAE1C;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,6EAA6E;IAC7E,EAAE,EAAE,MAAM,CAAC;IACX,uDAAuD;IACvD,UAAU,EAAE,MAAM,CAAC;IACnB,kFAAkF;IAClF,cAAc,EAAE,MAAM,CAAC;IACvB,iDAAiD;IACjD,YAAY,EAAE,MAAM,CAAC;IACrB,kCAAkC;IAClC,MAAM,EAAE,WAAW,CAAC;IACpB,yCAAyC;IACzC,UAAU,EAAE,MAAM,CAAC;IACnB,kCAAkC;IAClC,oBAAoB,EAAE,MAAM,CAAC;IAC7B,yDAAyD;IACzD,gBAAgB,EAAE,MAAM,CAAC;IACzB,oCAAoC;IACpC,oBAAoB,EAAE,MAAM,CAAC;IAC7B,yBAAyB;IACzB,YAAY,EAAE,eAAe,EAAE,CAAC;IAChC,0CAA0C;IAC1C,SAAS,EAAE,MAAM,CAAC;IAClB,oCAAoC;IACpC,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,gCAAgC;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,gDAAgD;IAChD,YAAY,EAAE,MAAM,CAAC;IACrB,qBAAqB;IACrB,MAAM,EAAE,kBAAkB,EAAE,CAAC;CAC9B;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,uBAAuB;IACvB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,uDAAuD;IACvD,YAAY,CAAC,EAAE,eAAe,EAAE,CAAC;IACjC,6CAA6C;IAC7C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,yBAAyB;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yBAAyB;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,2CAA2C;IAC3C,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB"}
|
package/package.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@auxot/model-registry",
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Curated catalog of GGUF models for the Auxot GPU worker ecosystem",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": "./dist/src/index.js",
|
|
8
|
+
"./registry.json": "./registry.json"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist/src/**/*.js",
|
|
12
|
+
"dist/src/**/*.d.ts",
|
|
13
|
+
"dist/src/**/*.d.ts.map",
|
|
14
|
+
"registry.json"
|
|
15
|
+
],
|
|
16
|
+
"publishConfig": {
|
|
17
|
+
"access": "public"
|
|
18
|
+
},
|
|
19
|
+
"scripts": {
|
|
20
|
+
"build:registry": "tsx scripts/build-registry.ts",
|
|
21
|
+
"patch:registry": "tsx scripts/build-registry.ts --patch",
|
|
22
|
+
"update:registry": "tsx scripts/build-registry.ts --update",
|
|
23
|
+
"build": "tsc",
|
|
24
|
+
"build:full": "pnpm run build:registry && pnpm run build"
|
|
25
|
+
},
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"zod": "^3.22.4"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"@types/node": "^20.10.6",
|
|
31
|
+
"tsx": "^4.7.0",
|
|
32
|
+
"typescript": "^5.3.3"
|
|
33
|
+
}
|
|
34
|
+
}
|