@x12i/ai-profiles 2.2.0 → 3.0.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 +73 -66
- package/dist/buildResolvedProfile.d.ts +1 -3
- package/dist/buildResolvedProfile.d.ts.map +1 -1
- package/dist/buildResolvedProfile.js +1 -8
- package/dist/buildResolvedProfile.js.map +1 -1
- package/dist/computeRegistryStatistics.d.ts +0 -1
- package/dist/computeRegistryStatistics.d.ts.map +1 -1
- package/dist/computeRegistryStatistics.js +0 -9
- package/dist/computeRegistryStatistics.js.map +1 -1
- package/dist/constants.d.ts +0 -2
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +0 -2
- package/dist/constants.js.map +1 -1
- package/dist/data/models-profiles.json +37 -113
- package/dist/data/models-profiles.schema.json +0 -1
- package/dist/ensureConcreteModel.d.ts +27 -0
- package/dist/ensureConcreteModel.d.ts.map +1 -0
- package/dist/ensureConcreteModel.js +38 -0
- package/dist/ensureConcreteModel.js.map +1 -0
- package/dist/formatRegistryStatistics.d.ts.map +1 -1
- package/dist/formatRegistryStatistics.js +0 -2
- package/dist/formatRegistryStatistics.js.map +1 -1
- package/dist/index.d.ts +9 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -5
- package/dist/index.js.map +1 -1
- package/dist/isKnownProfileChoice.d.ts +1 -1
- package/dist/isKnownProfileChoice.js +1 -1
- package/dist/isReasoningModel.d.ts +18 -0
- package/dist/isReasoningModel.d.ts.map +1 -0
- package/dist/isReasoningModel.js +18 -0
- package/dist/isReasoningModel.js.map +1 -0
- package/dist/listAIProfiles.d.ts +1 -1
- package/dist/listAIProfiles.d.ts.map +1 -1
- package/dist/listAIProfiles.js +1 -2
- package/dist/listAIProfiles.js.map +1 -1
- package/dist/loader/combineRegistry.d.ts +2 -2
- package/dist/loader/combineRegistry.d.ts.map +1 -1
- package/dist/loader/combineRegistry.js +2 -3
- package/dist/loader/combineRegistry.js.map +1 -1
- package/dist/loader/loadBundledRegistry.d.ts.map +1 -1
- package/dist/loader/loadBundledRegistry.js +2 -4
- package/dist/loader/loadBundledRegistry.js.map +1 -1
- package/dist/loader/loadRemoteRegistry.d.ts.map +1 -1
- package/dist/loader/loadRemoteRegistry.js +4 -8
- package/dist/loader/loadRemoteRegistry.js.map +1 -1
- package/dist/modelInputFallback.d.ts +1 -0
- package/dist/modelInputFallback.d.ts.map +1 -1
- package/dist/modelInputFallback.js +1 -1
- package/dist/modelInputFallback.js.map +1 -1
- package/dist/normalizeKey.d.ts +1 -1
- package/dist/normalizeKey.js +1 -1
- package/dist/profileChoiceKey.d.ts +3 -33
- package/dist/profileChoiceKey.d.ts.map +1 -1
- package/dist/profileChoiceKey.js +6 -73
- package/dist/profileChoiceKey.js.map +1 -1
- package/dist/profileDiscovery.d.ts +1 -1
- package/dist/profileDiscovery.d.ts.map +1 -1
- package/dist/profileDiscovery.js +1 -2
- package/dist/profileDiscovery.js.map +1 -1
- package/dist/profileRegistryV3.d.ts.map +1 -1
- package/dist/profileRegistryV3.js +0 -3
- package/dist/profileRegistryV3.js.map +1 -1
- package/dist/resolveAIProfile.d.ts +1 -1
- package/dist/resolveAIProfile.d.ts.map +1 -1
- package/dist/resolveAIProfile.js +2 -7
- package/dist/resolveAIProfile.js.map +1 -1
- package/dist/resolveAIProfileWithCostAlternatives.d.ts.map +1 -1
- package/dist/resolveAIProfileWithCostAlternatives.js +0 -5
- package/dist/resolveAIProfileWithCostAlternatives.js.map +1 -1
- package/dist/resolveBundledAIProfile.d.ts +1 -4
- package/dist/resolveBundledAIProfile.d.ts.map +1 -1
- package/dist/resolveBundledAIProfile.js +1 -4
- package/dist/resolveBundledAIProfile.js.map +1 -1
- package/dist/resolveBundledCatalogModel.d.ts +13 -2
- package/dist/resolveBundledCatalogModel.d.ts.map +1 -1
- package/dist/resolveBundledCatalogModel.js +59 -22
- package/dist/resolveBundledCatalogModel.js.map +1 -1
- package/dist/resolveBundledInput.d.ts +4 -7
- package/dist/resolveBundledInput.d.ts.map +1 -1
- package/dist/resolveBundledInput.js +6 -13
- package/dist/resolveBundledInput.js.map +1 -1
- package/dist/resolveProfileInputCore.d.ts.map +1 -1
- package/dist/resolveProfileInputCore.js +3 -8
- package/dist/resolveProfileInputCore.js.map +1 -1
- package/dist/types.d.ts +1 -34
- package/dist/types.d.ts.map +1 -1
- package/dist/validation/profileIntentPolicy.d.ts +1 -1
- package/dist/validation/profileIntentPolicy.d.ts.map +1 -1
- package/dist/validation/profileIntentPolicy.js +1 -1
- package/dist/validation/profileIntentPolicy.js.map +1 -1
- package/dist/validation/validateModelsProfilesJson.d.ts +1 -2
- package/dist/validation/validateModelsProfilesJson.d.ts.map +1 -1
- package/dist/validation/validateModelsProfilesJson.js +1 -50
- package/dist/validation/validateModelsProfilesJson.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Resolve AI profile names into concrete model choices. The package ships JSON in `src/data/` as the offline fallback. By default, registry data is fetched from public assets, validated, and cached in memory.
|
|
4
4
|
|
|
5
|
-
> **
|
|
5
|
+
> **v3.0** removes legacy resolution inputs: shortcuts, bare profiles, and aliases. Only four forms are accepted — `profile/choice`, vendor slug, gateway wire, and `{ provider, modelId }`. See [CHANGELOG.md](CHANGELOG.md).
|
|
6
|
+
>
|
|
7
|
+
> **v2.0** (still relevant): every `resolveAIProfile` call must pass `catalogLane` (`"text"`, `"image"`, …). Profile keys `deepseek` and `summarization` are gone — use `vol` and `sum`.
|
|
6
8
|
|
|
7
9
|
## Why AI profiles
|
|
8
10
|
|
|
@@ -31,9 +33,7 @@ Every profile has a **`defaultChoice`** (recommended) and typically **two altern
|
|
|
31
33
|
- **Execution mode** — e.g. `cheap` + `google_floor` with `executionMode: batch` for background bulk work.
|
|
32
34
|
- **Resilience** — swap choice or fall back within the same profile when a provider is down or rate-limited.
|
|
33
35
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
Tasks should declare **requirements** (`profile` + optional `choice`), not model names. Profiles are the vocabulary; choices are how that vocabulary is implemented under different constraints.
|
|
36
|
+
Tasks should declare **requirements** as explicit `profile/choice` keys (e.g. `cheap/default`), not model names. Use discovery APIs (`listAIProfiles`, `resolveAIProfileByTags`) to pick a profile when the caller does not already have a composite key.
|
|
37
37
|
|
|
38
38
|
### Profile catalog (bundled)
|
|
39
39
|
|
|
@@ -81,8 +81,6 @@ Each profile’s `choices` in `models-profiles.json` follow a consistent pattern
|
|
|
81
81
|
| `vision` | `default`, `document_ocr` | General multimodal vs schema OCR from scans/PDFs |
|
|
82
82
|
| `local` | `llama_cpp_gguf`, `transformersjs_default` | **CPU / offline** — GGUF via llama.cpp vs Hugging Face Transformers.js (no cloud LLM) |
|
|
83
83
|
|
|
84
|
-
Bundled **shortcuts** that pin a choice include `cheapest`, `absolute-floor`, `final-answer`, `hard-reason`, `mm-coding`, `fast-cheap`, `cheap-json`, `audit`, `intel-cyber`, `pseo`, `ocr`, and FuncX-style `weak` / `normal` / `strong` / `ultra` (see [Profile matrix](#profile-matrix-funcx-contract)). Shortcut keys are **intent names only** — never vendor or model SKU strings.
|
|
85
|
-
|
|
86
84
|
Every **remote** profile choice must resolve to an active OpenRouter catalog id. Profiles without OpenRouter support are not included (use vendor APIs outside this registry, or add catalog coverage first). The only exception is the **`local`** profile, which is explicitly CPU / self-hosted.
|
|
87
85
|
|
|
88
86
|
### OpenRouter-only and catalog lanes
|
|
@@ -96,7 +94,7 @@ Not every profile is OpenRouter-backed: **`local`** is CPU/self-hosted only (2 c
|
|
|
96
94
|
| `listAIProfiles({ catalogLane: "image" })` | List only lane-matching profiles. |
|
|
97
95
|
|
|
98
96
|
```ts
|
|
99
|
-
await resolveAIProfile("cyber", {
|
|
97
|
+
await resolveAIProfile("cyber/default", {
|
|
100
98
|
catalogLane: "text",
|
|
101
99
|
requireOpenRouterCatalog: true,
|
|
102
100
|
});
|
|
@@ -112,7 +110,7 @@ If you want to restrict model selection by price, you can either set an explicit
|
|
|
112
110
|
import { resolveAIProfile } from "@x12i/ai-profiles";
|
|
113
111
|
|
|
114
112
|
// Tier-based (default tiers: tier1=$0.5/1M output, tier2=$3, tier3=$10, tier4=$30)
|
|
115
|
-
const cheapTier1 = await resolveAIProfile("balanced", {
|
|
113
|
+
const cheapTier1 = await resolveAIProfile("balanced/default", {
|
|
116
114
|
catalogLane: "text",
|
|
117
115
|
costTier: "tier1",
|
|
118
116
|
});
|
|
@@ -183,7 +181,7 @@ const reasoningProfiles = await listAIProfiles({
|
|
|
183
181
|
Every resolved primary and secondary includes a stable boolean:
|
|
184
182
|
|
|
185
183
|
```ts
|
|
186
|
-
const resolved = await resolveAIProfile("cheap", {
|
|
184
|
+
const resolved = await resolveAIProfile("cheap/default", {
|
|
187
185
|
catalogLane: "text",
|
|
188
186
|
includeSecondary: true,
|
|
189
187
|
});
|
|
@@ -206,24 +204,24 @@ npm install @x12i/ai-profiles
|
|
|
206
204
|
|
|
207
205
|
| Export | Sync? | Purpose |
|
|
208
206
|
|--------|-------|---------|
|
|
209
|
-
| `listAIProfiles(options?)` | No (async) | Profile summaries: primary `profile` key,
|
|
210
|
-
| `getAIRegistryStatistics(options?)` | No (async) | Counts: profiles, choices, providers,
|
|
207
|
+
| `listAIProfiles(options?)` | No (async) | Profile summaries: primary `profile` key, tags, choices, defaults |
|
|
208
|
+
| `getAIRegistryStatistics(options?)` | No (async) | Counts: profiles, choices, providers, catalog models, linkage health |
|
|
211
209
|
| `formatRegistryStatistics(stats)` | Yes | Human-readable summary for logs / CLI |
|
|
212
|
-
| `loadAIProfilesRegistry(options?)` | No (async) | Raw profiles
|
|
210
|
+
| `loadAIProfilesRegistry(options?)` | No (async) | Raw profiles registry (`auto` / `remote` / `bundled`, 24h memory cache) |
|
|
213
211
|
| `loadAIProfilesRegistryWithWarnings(options?)` | No (async) | Same as above, plus `warnings[]` (stale cache, bundled fallback, etc.) |
|
|
214
212
|
| `loadModelsCatalog(options?)` | No (async) | Unified models catalog (`auto` / `remote` / `bundled`, same cache pattern as profiles) |
|
|
215
213
|
| `loadBundledModelsCatalog()` | Yes | Package-shipped `models-catalog.json` only |
|
|
216
214
|
| `loadBundledModelsRegistry()` | Yes | Package-shipped `models-registry.json` (linkage index) |
|
|
217
215
|
| `listAIProfileChoices(options?)` | No (async) | List explicit `profile/choice` keys for strict pickers and stored config |
|
|
218
|
-
| `
|
|
219
|
-
| `
|
|
220
|
-
| `
|
|
221
|
-
| `
|
|
222
|
-
| `
|
|
223
|
-
| `
|
|
224
|
-
| `resolveBundledCatalogModel(input, options?)` | Yes | Sync catalog resolution for vendor slugs and gateway wire ids |
|
|
216
|
+
| `isKnownProfileChoice(input)` | Yes (bundled only) | Whether input is a known valid `profile/choice` key |
|
|
217
|
+
| `getBundledRegistry()` | Yes | Sync bundled profiles registry (no network) |
|
|
218
|
+
| `resolveBundledAIProfile(input, options)` | Yes | Strict `profile/choice` → model, pricing, runtime (`source: "bundled"`) |
|
|
219
|
+
| `resolveBundledInput(input, options)` | Yes | Unified resolver: `profile/choice` → registry; vendor slug / gateway wire / `{ provider, modelId }` → catalog |
|
|
220
|
+
| `resolveBundledCatalogModel(input, options?)` | Yes | Sync strict catalog resolution (exact/high confidence only) |
|
|
221
|
+
| `ensureConcreteModel(input, options?)` | Yes | String normalizer: `profile/choice` (strict) or concrete model (catalog best-effort) → invoke-time `{ provider, modelId }` |
|
|
225
222
|
| `lookupBundledCatalogCaps({ provider, modelId })` | Yes | Sync `{ contextWindow, maxOutputTokens, supportsReasoning }` from bundled catalog |
|
|
226
|
-
| `
|
|
223
|
+
| `isReasoningModel(input, options?)` | Yes | `true`/`false` for supported inputs (throws `UNKNOWN_MODEL` on unknown concrete models) |
|
|
224
|
+
| `resolveAIProfile(input, options?)` | No (async) | Resolve an explicit `profile/choice` key → model, pricing, runtime. Pass `includeSecondary: true` to attach `secondary`. |
|
|
227
225
|
| `resolveSecondaryModel(input, options?)` | No (async) | Resolve primary choice + optional companion `secondary` from profile `secondary` refs |
|
|
228
226
|
| `getSecondaryForResolvedProfile(resolved, registry, catalog?)` | Yes | Secondary for an already-resolved primary (no extra I/O when catalog is passed) |
|
|
229
227
|
| `listProfileSecondaries(profileKey, registry)` | Yes | List per-choice `secondary` declarations on a profile |
|
|
@@ -271,7 +269,6 @@ Registry JSON lives in four bundled assets:
|
|
|
271
269
|
| `models-profiles.json` | `x12i.ai-profiles.model-registry.v3` | Profile intent, choices, `requiredCapabilities`, `modelStatus` — **no embedded pricing** |
|
|
272
270
|
| `models-catalog.json` | `x12i.ai-profiles.models-catalog` | Per-model pricing, context window, capabilities (OpenRouter-normalized) |
|
|
273
271
|
| `models-registry.json` | `x12i.ai-profiles.models-registry` | Built linkage index: vendor keys, OpenRouter slugs, `invocation` pairs |
|
|
274
|
-
| `profiles-shortcuts.json` | `x12i.ai-profiles.shortcuts` | Named entry points |
|
|
275
272
|
|
|
276
273
|
**v3 contract:** Each profile choice stores only `provider` + **vendor-native** `modelId` as a pointer into `models-catalog.json`, which owns the `direct` and `openrouter` listings. Never embed `api`, `defaultTransport`, or OpenRouter slugs on profile choices. `resolveAIProfile` picks transport via env/options and merges catalog pricing, limits, and capabilities — the client-facing shape is unchanged. Run `npm run registry:finish` to strip legacy fields, verify linkage, and rebuild `models-registry.json`.
|
|
277
274
|
|
|
@@ -283,7 +280,9 @@ For consumers that need **no network** and a single entry point:
|
|
|
283
280
|
|
|
284
281
|
```ts
|
|
285
282
|
import {
|
|
286
|
-
|
|
283
|
+
ensureConcreteModel,
|
|
284
|
+
isKnownProfileChoice,
|
|
285
|
+
isReasoningModel,
|
|
287
286
|
resolveBundledInput,
|
|
288
287
|
resolveBundledAIProfile,
|
|
289
288
|
applyModelRouting,
|
|
@@ -292,18 +291,32 @@ import {
|
|
|
292
291
|
getBundledRegistry,
|
|
293
292
|
} from "@x12i/ai-profiles";
|
|
294
293
|
|
|
295
|
-
//
|
|
296
|
-
// 1.
|
|
297
|
-
// 2.
|
|
294
|
+
// Four supported resolution forms:
|
|
295
|
+
// 1. profile/choice → registry (strict)
|
|
296
|
+
// 2. vendor slug → catalog (strict in resolveBundledCatalogModel; best-effort in ensureConcreteModel)
|
|
297
|
+
// 3. gateway wire → catalog
|
|
298
|
+
// 4. { provider, modelId } → catalog
|
|
299
|
+
|
|
300
|
+
ensureConcreteModel("cheap/default");
|
|
301
|
+
// → { provider: "openrouter", modelId: "google/gemini-2.5-flash-lite", profileChoice: { profile: "cheap", choice: "default" } }
|
|
298
302
|
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
303
|
+
ensureConcreteModel("google/gemini-2.5-flash-lite");
|
|
304
|
+
// → { provider: "openrouter", modelId: "google/gemini-2.5-flash-lite", matchConfidence: "exact" }
|
|
305
|
+
|
|
306
|
+
ensureConcreteModel("openrouter/openai/gpt-5.5");
|
|
307
|
+
// → { provider: "openrouter", modelId: "openai/gpt-5.5" }
|
|
308
|
+
|
|
309
|
+
if (isKnownProfileChoice("cheap/default")) {
|
|
310
|
+
const resolved = resolveBundledInput("cheap/default", { catalogLane: "text" });
|
|
302
311
|
}
|
|
303
312
|
|
|
304
313
|
const wire = normalizeGatewayWireId("openrouter/openai/gpt-5.5");
|
|
305
314
|
// → { provider: "openrouter", modelId: "openai/gpt-5.5" }
|
|
306
315
|
|
|
316
|
+
isReasoningModel("deep/default"); // true
|
|
317
|
+
isReasoningModel("cheap/default"); // true (catalog marks gemini-2.5-flash-lite reasoning-capable)
|
|
318
|
+
isReasoningModel("google/gemini-2.5-flash-lite"); // false
|
|
319
|
+
|
|
307
320
|
const caps = lookupBundledCatalogCaps({
|
|
308
321
|
provider: "openrouter",
|
|
309
322
|
modelId: "google/gemini-2.5-flash-lite",
|
|
@@ -317,7 +330,7 @@ const routed = applyModelRouting(
|
|
|
317
330
|
);
|
|
318
331
|
```
|
|
319
332
|
|
|
320
|
-
`
|
|
333
|
+
`isKnownProfileChoice` returns **false** for bare profiles (`cheap`), legacy shortcuts (`cheapest`), and concrete slugs (`google/gemini-2.5-flash-lite`).
|
|
321
334
|
|
|
322
335
|
## Basic usage
|
|
323
336
|
|
|
@@ -325,7 +338,6 @@ const routed = applyModelRouting(
|
|
|
325
338
|
import {
|
|
326
339
|
listAIProfiles,
|
|
327
340
|
listAIProfileChoices,
|
|
328
|
-
listAIShortcuts,
|
|
329
341
|
isKnownProfileChoice,
|
|
330
342
|
resolveAIProfile,
|
|
331
343
|
resolveCatalogModel,
|
|
@@ -384,28 +396,22 @@ console.log(formatRegistryStatistics(statistics));
|
|
|
384
396
|
|
|
385
397
|
CLI (after build): `npm run stats` (text) or `npm run stats:json`.
|
|
386
398
|
|
|
387
|
-
##
|
|
388
|
-
|
|
389
|
-
Each **profile** has exactly one **short primary key** (e.g. `balanced`, `cyber`, `vol`) and **many aliases** — intent/task strings only, never vendor or model SKU names. Data is in `models-profiles.json` under each profile’s `aliases` array.
|
|
399
|
+
## Supported resolution inputs
|
|
390
400
|
|
|
391
|
-
|
|
401
|
+
Resolution accepts exactly **four** input forms:
|
|
392
402
|
|
|
393
|
-
|
|
403
|
+
| Form | Example | Resolver |
|
|
404
|
+
|------|---------|----------|
|
|
405
|
+
| Profile + choice | `cheap/default` | Registry (`resolveAIProfile`, `resolveBundledAIProfile`) |
|
|
406
|
+
| Vendor slug | `google/gemini-2.5-flash-lite` | Catalog (`resolveCatalogModel`, `resolveBundledCatalogModel`) |
|
|
407
|
+
| Gateway wire | `openrouter/openai/gpt-5.5` | Catalog (gateway normalization) |
|
|
408
|
+
| Object | `{ provider: "google", modelId: "gemini-2.5-flash-lite" }` | Catalog |
|
|
394
409
|
|
|
395
|
-
|
|
410
|
+
**Not supported:** shortcuts (`cheapest`), bare profiles (`cheap`), aliases (`cost-sensitive`). Use discovery to pick a profile, then resolve an explicit `profile/choice`.
|
|
396
411
|
|
|
397
|
-
|
|
412
|
+
**Tags** are short (2–4 chars), many per profile (`cyb`, `eco`, `ds`, …). Use `listAIProfiles({ tags })` or `resolveAIProfileByTags(['cyb', 'eco'])` for discovery — partial overlap is OK; the profile with the most matching tags wins, then an explicit choice is resolved.
|
|
398
413
|
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
`resolveAIProfile(input)` accepts only:
|
|
402
|
-
|
|
403
|
-
1. **Composite key** — `profile/choice` (e.g. `cheap/default`)
|
|
404
|
-
2. **Shortcut** — a shortcut key that pins a choice (all bundled shortcuts do)
|
|
405
|
-
|
|
406
|
-
Profile-only inputs and profile aliases are **discovery-only**; they are not valid for `resolveAIProfile`.
|
|
407
|
-
|
|
408
|
-
Input is normalized (trimmed, lowercased) before matching. Composite keys accept **`/` or `\`** as the separator on input (`cyber\default` → `cyber/default`); listed and resolved keys always use `/`. **Profile, choice, and shortcut segment names treat `-` and `_` as equivalent** (`cheap/google-floor` → `cheap/google_floor`).
|
|
414
|
+
Input is normalized (trimmed, lowercased) before matching. Composite keys accept **`/` or `\`** as the separator (`cyber\default` → `cyber/default`). **Profile and choice segment names treat `-` and `_` as equivalent** (`cheap/google-floor` → `cheap/google_floor`).
|
|
409
415
|
|
|
410
416
|
### Examples
|
|
411
417
|
|
|
@@ -413,17 +419,18 @@ Input is normalized (trimmed, lowercased) before matching. Composite keys accept
|
|
|
413
419
|
// Composite key
|
|
414
420
|
await resolveAIProfile("balanced/default", { catalogLane: "text" });
|
|
415
421
|
|
|
416
|
-
//
|
|
417
|
-
await
|
|
418
|
-
|
|
419
|
-
// Tag-based pick (partial overlap OK)
|
|
420
|
-
await resolveAIProfileByTags(["cyb", "eco", "ds"], { catalogLane: "text" }); // cyber/<auto>
|
|
422
|
+
// Tag-based pick (partial overlap OK) → explicit profile/choice
|
|
423
|
+
await resolveAIProfileByTags(["cyb", "eco", "ds"], { catalogLane: "text" });
|
|
421
424
|
|
|
422
425
|
// Model SKU → catalog, not a profile
|
|
423
|
-
await resolveCatalogModel("
|
|
426
|
+
await resolveCatalogModel("google/gemini-2.5-flash-lite", { source: "bundled" });
|
|
427
|
+
|
|
428
|
+
// String normalizer for invoke-time routing
|
|
429
|
+
ensureConcreteModel("cheap/default");
|
|
430
|
+
ensureConcreteModel("google/gemini-2.5-flash-lite");
|
|
424
431
|
```
|
|
425
432
|
|
|
426
|
-
`listAIProfiles()` returns
|
|
433
|
+
`listAIProfiles()` returns profile keys, tags, and choices for pickers. `listAIProfileChoices()` lists every valid `profile/choice` composite key.
|
|
427
434
|
|
|
428
435
|
## Sync validation (bundled registry)
|
|
429
436
|
|
|
@@ -435,15 +442,15 @@ const canRun =
|
|
|
435
442
|
isKnownProfileChoice(fallbackKey);
|
|
436
443
|
```
|
|
437
444
|
|
|
438
|
-
Accepts
|
|
445
|
+
Accepts **valid `profile/choice` keys only**. Unknown strings return `false`.
|
|
439
446
|
|
|
440
447
|
After validation, call `resolveAIProfile` (usually `source: "auto"` or `"bundled"`) to get the canonical `resolved.profile` and the concrete model details.
|
|
441
448
|
|
|
442
449
|
### UI guidance
|
|
443
450
|
|
|
444
|
-
- **Profile picker**: `await listAIProfiles()` → use each row’s `profile` as the value; show `displayName`
|
|
445
|
-
- **
|
|
446
|
-
- **Stored config**:
|
|
451
|
+
- **Profile picker**: `await listAIProfiles()` → use each row’s `profile` as the value; show `displayName` as the label.
|
|
452
|
+
- **Choice picker**: `await listAIProfileChoices({ profile: "cheap" })` or list choices from the profile summary.
|
|
453
|
+
- **Stored config**: store `profile/choice` composite keys (e.g. `cheap/default`).
|
|
447
454
|
|
|
448
455
|
## Pick a specific model implementation (choice)
|
|
449
456
|
|
|
@@ -480,7 +487,7 @@ await resolveAIProfile("cheap/default", { catalogLane: "text", useOpenRouter: tr
|
|
|
480
487
|
|
|
481
488
|
Registry choices store vendor-native ids (e.g. `gpt-5.4`, `gemini-2.5-flash-lite`). When routing via OpenRouter, this package rewrites them to full slugs: `{vendor}/{model}` (e.g. `openai/gpt-5.4`, `anthropic/claude-sonnet-4.6`). Anthropic version segments are normalized to dotted form (`4.6`, not `4-6`).
|
|
482
489
|
|
|
483
|
-
This applies to
|
|
490
|
+
This applies to any `profile/choice` input that resolves to a remote profile choice.
|
|
484
491
|
|
|
485
492
|
### Avoid hardcoded OpenRouter slugs (especially dated previews)
|
|
486
493
|
|
|
@@ -563,7 +570,8 @@ Tests: `test/resolveModelRouting.test.ts`, `test/modelIdentity.test.ts`, `test/r
|
|
|
563
570
|
## Use bundled only
|
|
564
571
|
|
|
565
572
|
```ts
|
|
566
|
-
const model = await resolveAIProfile("balanced", {
|
|
573
|
+
const model = await resolveAIProfile("balanced/default", {
|
|
574
|
+
catalogLane: "text",
|
|
567
575
|
source: "bundled",
|
|
568
576
|
});
|
|
569
577
|
```
|
|
@@ -571,7 +579,8 @@ const model = await resolveAIProfile("balanced", {
|
|
|
571
579
|
## Force refresh
|
|
572
580
|
|
|
573
581
|
```ts
|
|
574
|
-
const model = await resolveAIProfile("balanced", {
|
|
582
|
+
const model = await resolveAIProfile("balanced/default", {
|
|
583
|
+
catalogLane: "text",
|
|
575
584
|
refresh: true,
|
|
576
585
|
});
|
|
577
586
|
```
|
|
@@ -580,7 +589,7 @@ const model = await resolveAIProfile("balanced", {
|
|
|
580
589
|
|
|
581
590
|
**Default (`source: "auto"`):**
|
|
582
591
|
|
|
583
|
-
1. Fetch `models-profiles.json`
|
|
592
|
+
1. Fetch `models-profiles.json` from the assets URL (see below).
|
|
584
593
|
2. Validate the response; if valid, use it and cache it in process memory for 24 hours.
|
|
585
594
|
3. If fetch or validation fails, use the JSON shipped inside this npm package (bundled fallback).
|
|
586
595
|
4. After TTL, the next call tries fetch again; if that fails but an earlier fetch was cached, reuse the stale cache with a warning.
|
|
@@ -596,13 +605,13 @@ The `version` field in the JSON files (and `registryVersion` on resolved output)
|
|
|
596
605
|
## Remote assets
|
|
597
606
|
|
|
598
607
|
- `https://open-assets.x12i.com/models-profiles.json`
|
|
599
|
-
- `https://open-assets.x12i.com/profiles-shortcuts.json`
|
|
600
608
|
|
|
601
609
|
## Integration example
|
|
602
610
|
|
|
603
611
|
```ts
|
|
604
612
|
const resolved = await resolveAIProfile(
|
|
605
|
-
node.taskConfiguration.aiProfile ?? "balanced"
|
|
613
|
+
node.taskConfiguration.aiProfile ?? "balanced/default",
|
|
614
|
+
{ catalogLane: "text" },
|
|
606
615
|
);
|
|
607
616
|
|
|
608
617
|
const modelConfig = {
|
|
@@ -646,8 +655,6 @@ Default choice per profile (vendor-native ids in registry; OpenRouter slugs when
|
|
|
646
655
|
| `local` | CPU (no OpenRouter) | **`cpu`** | `llama_cpp_gguf` | `funcx:llama-cpp:gguf` |
|
|
647
656
|
| `local` | CPU | **`cpu`** | `transformersjs_default` | `Xenova/distilbart-cnn-6-6` |
|
|
648
657
|
|
|
649
|
-
FuncX mode shortcuts (bundled): `weak` → local, `normal` → balanced, `strong` → pro, `ultra` → deep, `default` → balanced.
|
|
650
|
-
|
|
651
658
|
Local CPU choices expose FuncX env keys in `resolved.metadata` (e.g. `LLAMA_CPP_MODEL_PATH`, `TRANSFORMERS_JS_MODEL_ID`).
|
|
652
659
|
|
|
653
660
|
### OpenRouter model ids
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import type { AIProfileChoice, AIProfileDefinition,
|
|
1
|
+
import type { AIProfileChoice, AIProfileDefinition, AIProfileWarning, AIProfilesRegistry, CostCapPer1M, ModelsCatalogJson, ResolvedAIProfile } from "./types.js";
|
|
2
2
|
interface BuildResolvedProfileInput {
|
|
3
3
|
input: string;
|
|
4
|
-
shortcutKey?: string;
|
|
5
4
|
profile: AIProfileDefinition;
|
|
6
5
|
choice: AIProfileChoice;
|
|
7
6
|
choiceKey: string;
|
|
8
|
-
shortcut?: AIProfileShortcut;
|
|
9
7
|
registry: AIProfilesRegistry;
|
|
10
8
|
loaderWarnings?: AIProfileWarning[];
|
|
11
9
|
useOpenRouter?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildResolvedProfile.d.ts","sourceRoot":"","sources":["../src/buildResolvedProfile.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EACV,eAAe,EACf,mBAAmB,EACnB,
|
|
1
|
+
{"version":3,"file":"buildResolvedProfile.d.ts","sourceRoot":"","sources":["../src/buildResolvedProfile.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EACV,eAAe,EACf,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,YAAY,EAEZ,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,YAAY,CAAC;AAEpB,UAAU,yBAAyB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,mBAAmB,CAAC;IAC7B,MAAM,EAAE,eAAe,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,cAAc,CAAC,EAAE,gBAAgB,EAAE,CAAC;IACpC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B,cAAc,CAAC,EAAE,YAAY,CAAC;CAC/B;AA8CD,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,yBAAyB,GAChC,iBAAiB,CAyLnB"}
|
|
@@ -38,7 +38,7 @@ function loadCatalogForEnrichment(catalog) {
|
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
export function buildResolvedProfile(params) {
|
|
41
|
-
const { input,
|
|
41
|
+
const { input, profile, choice, registry, loaderWarnings = [], useOpenRouter: explicitUseOpenRouter, catalog: catalogInput, } = params;
|
|
42
42
|
const costCapApplied = params.costCapApplied;
|
|
43
43
|
const warnings = [...loaderWarnings];
|
|
44
44
|
const cache = getMemoryCache();
|
|
@@ -180,13 +180,6 @@ export function buildResolvedProfile(params) {
|
|
|
180
180
|
loadedAt: registry.loadedAt,
|
|
181
181
|
expiresAt,
|
|
182
182
|
};
|
|
183
|
-
if (shortcut && shortcutKey) {
|
|
184
|
-
resolved.shortcut = {
|
|
185
|
-
key: shortcutKey,
|
|
186
|
-
profile: shortcut.profile,
|
|
187
|
-
choice: shortcut.choice,
|
|
188
|
-
};
|
|
189
|
-
}
|
|
190
183
|
if (warnings.length > 0) {
|
|
191
184
|
resolved.warnings = warnings;
|
|
192
185
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildResolvedProfile.js","sourceRoot":"","sources":["../src/buildResolvedProfile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAChF,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EACL,mBAAmB,EACnB,yBAAyB,GAC1B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,yBAAyB,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AAC/F,OAAO,EAAE,8BAA8B,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EACL,cAAc,EACd,sBAAsB,GACvB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACL,iBAAiB,EACjB,oBAAoB,GACrB,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"buildResolvedProfile.js","sourceRoot":"","sources":["../src/buildResolvedProfile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAChF,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EACL,mBAAmB,EACnB,yBAAyB,GAC1B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,yBAAyB,EAAE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CAAC,OAAO,EAAE;YACvC,CAAC,CAAC,EAAE,CAAC;QACP,QAAQ,EAAE,QAAQ,CAAC,QAAQ;QAC3B,SAAS;KACV,CAAC;IAEF,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACxB,QAAQ,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC/B,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { AIProfilesRegistry, AIRegistryStatistics, ModelsCatalogJson, ModelsProfilesJson, ModelsRegistryJson, ProfileStatisticsFilter } from "./types.js";
|
|
2
2
|
export declare function computeProfilesStatistics(registry: AIProfilesRegistry, filter?: ProfileStatisticsFilter): AIRegistryStatistics["profiles"];
|
|
3
|
-
export declare function computeShortcutsStatistics(registry: AIProfilesRegistry): AIRegistryStatistics["shortcuts"];
|
|
4
3
|
export declare function computeCatalogStatistics(catalog: ModelsCatalogJson): AIRegistryStatistics["catalog"];
|
|
5
4
|
export declare function computeLinkageStatistics(linkageRegistry: ModelsRegistryJson): AIRegistryStatistics["linkage"];
|
|
6
5
|
export declare function buildRegistryStatistics(input: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"computeRegistryStatistics.d.ts","sourceRoot":"","sources":["../src/computeRegistryStatistics.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,kBAAkB,EAElB,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,uBAAuB,EACxB,MAAM,YAAY,CAAC;AAmCpB,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,kBAAkB,EAC5B,MAAM,GAAE,uBAA4B,GACnC,oBAAoB,CAAC,UAAU,CAAC,
|
|
1
|
+
{"version":3,"file":"computeRegistryStatistics.d.ts","sourceRoot":"","sources":["../src/computeRegistryStatistics.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,kBAAkB,EAElB,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,uBAAuB,EACxB,MAAM,YAAY,CAAC;AAmCpB,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,kBAAkB,EAC5B,MAAM,GAAE,uBAA4B,GACnC,oBAAoB,CAAC,UAAU,CAAC,CA2DlC;AAED,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,iBAAiB,GACzB,oBAAoB,CAAC,SAAS,CAAC,CA2CjC;AAED,wBAAgB,wBAAwB,CACtC,eAAe,EAAE,kBAAkB,GAClC,oBAAoB,CAAC,SAAS,CAAC,CAsBjC;AAED,wBAAgB,uBAAuB,CAAC,KAAK,EAAE;IAC7C,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,cAAc,EAAE,QAAQ,GAAG,SAAS,CAAC;IACrC,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B,aAAa,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;IACrC,eAAe,CAAC,EAAE,kBAAkB,CAAC;IACrC,MAAM,CAAC,EAAE,uBAAuB,CAAC;CAClC,GAAG,oBAAoB,CA6BvB;AAED,wBAAgB,8BAA8B,CAC5C,QAAQ,EAAE,kBAAkB,EAC5B,OAAO,EAAE,iBAAiB,GACzB,kBAAkB,CAEpB"}
|
|
@@ -27,7 +27,6 @@ export function computeProfilesStatistics(registry, filter = {}) {
|
|
|
27
27
|
const categories = [];
|
|
28
28
|
let profileCount = 0;
|
|
29
29
|
let choiceCount = 0;
|
|
30
|
-
let aliasCount = 0;
|
|
31
30
|
for (const profile of Object.values(registry.profiles)) {
|
|
32
31
|
if (!profilePassesFilter(profile.status, filter)) {
|
|
33
32
|
continue;
|
|
@@ -36,7 +35,6 @@ export function computeProfilesStatistics(registry, filter = {}) {
|
|
|
36
35
|
continue;
|
|
37
36
|
}
|
|
38
37
|
profileCount += 1;
|
|
39
|
-
aliasCount += profile.aliases?.length ?? 0;
|
|
40
38
|
statuses.push(profile.status ?? "active");
|
|
41
39
|
categories.push(profile.category);
|
|
42
40
|
for (const choice of Object.values(profile.choices)) {
|
|
@@ -59,7 +57,6 @@ export function computeProfilesStatistics(registry, filter = {}) {
|
|
|
59
57
|
return {
|
|
60
58
|
total: profileCount,
|
|
61
59
|
choices: choiceCount,
|
|
62
|
-
aliases: aliasCount,
|
|
63
60
|
uniqueProviders: providers.size,
|
|
64
61
|
providers: [...providers].sort((a, b) => a.localeCompare(b)),
|
|
65
62
|
uniqueModelKeys: modelKeys.size,
|
|
@@ -70,11 +67,6 @@ export function computeProfilesStatistics(registry, filter = {}) {
|
|
|
70
67
|
averageChoicesPerProfile: profileCount > 0 ? Math.round((choiceCount / profileCount) * 100) / 100 : 0,
|
|
71
68
|
};
|
|
72
69
|
}
|
|
73
|
-
export function computeShortcutsStatistics(registry) {
|
|
74
|
-
return {
|
|
75
|
-
total: Object.keys(registry.shortcuts).length,
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
70
|
export function computeCatalogStatistics(catalog) {
|
|
79
71
|
const directProviders = new Set();
|
|
80
72
|
let withPricing = 0;
|
|
@@ -146,7 +138,6 @@ export function buildRegistryStatistics(input) {
|
|
|
146
138
|
: {}),
|
|
147
139
|
},
|
|
148
140
|
profiles: computeProfilesStatistics(input.registry, input.filter),
|
|
149
|
-
shortcuts: computeShortcutsStatistics(input.registry),
|
|
150
141
|
registry: {
|
|
151
142
|
version: input.registry.version,
|
|
152
143
|
loadedAt: input.registry.loadedAt,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"computeRegistryStatistics.js","sourceRoot":"","sources":["../src/computeRegistryStatistics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAW/D,SAAS,OAAO,CACd,MAAmB;IAEnB,MAAM,MAAM,GAA2B,EAAE,CAAC;IAE1C,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAA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,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,UAAU,8BAA8B,CAC5C,QAA4B,EAC5B,OAA0B;IAE1B,OAAO,mBAAmB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC;AACzD,CAAC"}
|
package/dist/constants.d.ts
CHANGED
|
@@ -2,14 +2,12 @@ import type { AIRuntimeDefaults } from "./types.js";
|
|
|
2
2
|
export declare const DEFAULT_CACHE_TTL_MS: number;
|
|
3
3
|
export declare const DEFAULT_FETCH_TIMEOUT_MS = 5000;
|
|
4
4
|
export declare const REMOTE_MODELS_PROFILES_URL = "https://open-assets.x12i.com/models-profiles.json";
|
|
5
|
-
export declare const REMOTE_PROFILES_SHORTCUTS_URL = "https://open-assets.x12i.com/profiles-shortcuts.json";
|
|
6
5
|
export declare const REMOTE_MODELS_CATALOG_URL = "https://open-assets.x12i.com/models-catalog.json";
|
|
7
6
|
/** Public OpenRouter model list (used by maintainers to regenerate the catalog). */
|
|
8
7
|
export declare const OPENROUTER_MODELS_API_URL = "https://openrouter.ai/api/v1/models";
|
|
9
8
|
export declare const MODELS_PROFILES_SCHEMA_V3: "x12i.ai-profiles.model-registry.v3";
|
|
10
9
|
/** Only v3 registry JSON is accepted (no v1/v2). */
|
|
11
10
|
export declare const MODELS_PROFILES_SCHEMAS: readonly ["x12i.ai-profiles.model-registry.v3"];
|
|
12
|
-
export declare const PROFILES_SHORTCUTS_SCHEMA: "x12i.ai-profiles.shortcuts";
|
|
13
11
|
export declare const INSTRUCTION_TIERS: readonly ["default", "cpu", "reasoning"];
|
|
14
12
|
export declare const AI_PROFILE_BACKENDS: readonly ["openrouter", "llama-cpp", "transformersjs", "custom"];
|
|
15
13
|
/** Canonical media types for model input/output (aligned with OpenRouter catalog). */
|
package/dist/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpD,eAAO,MAAM,oBAAoB,QAAsB,CAAC;AACxD,eAAO,MAAM,wBAAwB,OAAO,CAAC;AAE7C,eAAO,MAAM,0BAA0B,sDACc,CAAC;AAEtD,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpD,eAAO,MAAM,oBAAoB,QAAsB,CAAC;AACxD,eAAO,MAAM,wBAAwB,OAAO,CAAC;AAE7C,eAAO,MAAM,0BAA0B,sDACc,CAAC;AAEtD,eAAO,MAAM,yBAAyB,qDACc,CAAC;AAErD,oFAAoF;AACpF,eAAO,MAAM,yBAAyB,wCACC,CAAC;AAExC,eAAO,MAAM,yBAAyB,EACpC,oCAA6C,CAAC;AAEhD,oDAAoD;AACpD,eAAO,MAAM,uBAAuB,iDAAuC,CAAC;AAC5E,eAAO,MAAM,iBAAiB,0CAA2C,CAAC;AAE1E,eAAO,MAAM,mBAAmB,kEAKtB,CAAC;AAEX,sFAAsF;AACtF,eAAO,MAAM,gBAAgB,sDAMnB,CAAC;AAEX,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,iBAAiB,CAahE,CAAC"}
|
package/dist/constants.js
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
export const DEFAULT_CACHE_TTL_MS = 24 * 60 * 60 * 1000;
|
|
2
2
|
export const DEFAULT_FETCH_TIMEOUT_MS = 5000;
|
|
3
3
|
export const REMOTE_MODELS_PROFILES_URL = "https://open-assets.x12i.com/models-profiles.json";
|
|
4
|
-
export const REMOTE_PROFILES_SHORTCUTS_URL = "https://open-assets.x12i.com/profiles-shortcuts.json";
|
|
5
4
|
export const REMOTE_MODELS_CATALOG_URL = "https://open-assets.x12i.com/models-catalog.json";
|
|
6
5
|
/** Public OpenRouter model list (used by maintainers to regenerate the catalog). */
|
|
7
6
|
export const OPENROUTER_MODELS_API_URL = "https://openrouter.ai/api/v1/models";
|
|
8
7
|
export const MODELS_PROFILES_SCHEMA_V3 = "x12i.ai-profiles.model-registry.v3";
|
|
9
8
|
/** Only v3 registry JSON is accepted (no v1/v2). */
|
|
10
9
|
export const MODELS_PROFILES_SCHEMAS = [MODELS_PROFILES_SCHEMA_V3];
|
|
11
|
-
export const PROFILES_SHORTCUTS_SCHEMA = "x12i.ai-profiles.shortcuts";
|
|
12
10
|
export const INSTRUCTION_TIERS = ["default", "cpu", "reasoning"];
|
|
13
11
|
export const AI_PROFILE_BACKENDS = [
|
|
14
12
|
"openrouter",
|
package/dist/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AACxD,MAAM,CAAC,MAAM,wBAAwB,GAAG,IAAI,CAAC;AAE7C,MAAM,CAAC,MAAM,0BAA0B,GACrC,mDAAmD,CAAC;AAEtD,MAAM,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AACxD,MAAM,CAAC,MAAM,wBAAwB,GAAG,IAAI,CAAC;AAE7C,MAAM,CAAC,MAAM,0BAA0B,GACrC,mDAAmD,CAAC;AAEtD,MAAM,CAAC,MAAM,yBAAyB,GACpC,kDAAkD,CAAC;AAErD,oFAAoF;AACpF,MAAM,CAAC,MAAM,yBAAyB,GACpC,qCAAqC,CAAC;AAExC,MAAM,CAAC,MAAM,yBAAyB,GACpC,oCAA6C,CAAC;AAEhD,oDAAoD;AACpD,MAAM,CAAC,M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