@x12i/ai-tools 1.0.2 → 1.0.4
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 +114 -12
- package/dist/{AiModelsCatalogClient-CSVlKql5.d.cts → AiModelsCatalogClient-CNeqFiFs.d.cts} +2 -1
- package/dist/{AiModelsCatalogClient-B-dNLXX0.d.ts → AiModelsCatalogClient-nwFoEaqL.d.ts} +2 -1
- package/dist/aliases/index.d.cts +4 -3
- package/dist/aliases/index.d.ts +4 -3
- package/dist/catalog/index.cjs +30 -0
- package/dist/catalog/index.cjs.map +1 -0
- package/dist/catalog/index.d.cts +100 -0
- package/dist/catalog/index.d.ts +100 -0
- package/dist/catalog/index.js +30 -0
- package/dist/catalog/index.js.map +1 -0
- package/dist/catalox/index.cjs +2 -2
- package/dist/catalox/index.d.cts +7 -19
- package/dist/catalox/index.d.ts +7 -19
- package/dist/catalox/index.js +1 -1
- package/dist/chunk-C3H7RTFR.cjs +1 -0
- package/dist/chunk-C3H7RTFR.cjs.map +1 -0
- package/dist/{chunk-ONA73BU6.cjs → chunk-DKHGWHXP.cjs} +21 -12
- package/dist/chunk-DKHGWHXP.cjs.map +1 -0
- package/dist/{chunk-HHNHWYTP.cjs → chunk-FGP3QXWL.cjs} +94 -36
- package/dist/chunk-FGP3QXWL.cjs.map +1 -0
- package/dist/chunk-HS74X2OJ.cjs +172 -0
- package/dist/chunk-HS74X2OJ.cjs.map +1 -0
- package/dist/chunk-HYGXZY25.js +163 -0
- package/dist/chunk-HYGXZY25.js.map +1 -0
- package/dist/chunk-M5TMA73F.js +1 -0
- package/dist/chunk-M5TMA73F.js.map +1 -0
- package/dist/chunk-MX3AMQFC.js +172 -0
- package/dist/chunk-MX3AMQFC.js.map +1 -0
- package/dist/{chunk-MLRHYOCD.js → chunk-VRFVF5RH.js} +21 -12
- package/dist/chunk-VRFVF5RH.js.map +1 -0
- package/dist/cli/index.cjs +133 -30
- package/dist/cli/index.cjs.map +1 -1
- package/dist/cli/index.js +134 -31
- package/dist/cli/index.js.map +1 -1
- package/dist/cost/index.d.cts +4 -3
- package/dist/cost/index.d.ts +4 -3
- package/dist/index.cjs +17 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -16
- package/dist/index.d.ts +10 -16
- package/dist/index.js +22 -11
- package/dist/{modelNameResolver-Bn8QnkSj.d.ts → modelNameResolver-D9V_GfUK.d.cts} +3 -27
- package/dist/{modelNameResolver-bZD-eBSJ.d.cts → modelNameResolver-DqFt7g6W.d.ts} +3 -27
- package/dist/models/index.d.cts +3 -2
- package/dist/models/index.d.ts +3 -2
- package/dist/sync/index.cjs +3 -3
- package/dist/sync/index.d.cts +6 -3
- package/dist/sync/index.d.ts +6 -3
- package/dist/sync/index.js +2 -2
- package/dist/syncAiModelsCatalog-CnXRLm2c.d.cts +32 -0
- package/dist/syncAiModelsCatalog-DpkN_w7S.d.ts +32 -0
- package/dist/types-BYXnCvKx.d.cts +137 -0
- package/dist/types-BYXnCvKx.d.ts +137 -0
- package/dist/types-CX6QFNNy.d.cts +144 -0
- package/dist/types-CuiPDcVs.d.ts +144 -0
- package/dist/upsertAiModelRecord-C831wOIF.d.ts +35 -0
- package/dist/upsertAiModelRecord-CjY-sny0.d.cts +35 -0
- package/package.json +8 -1
- package/dist/chunk-HHNHWYTP.cjs.map +0 -1
- package/dist/chunk-ML2FRR4L.js +0 -105
- package/dist/chunk-ML2FRR4L.js.map +0 -1
- package/dist/chunk-MLRHYOCD.js.map +0 -1
- package/dist/chunk-ONA73BU6.cjs.map +0 -1
- package/dist/types-DdGB3YaA.d.cts +0 -278
- package/dist/types-DdGB3YaA.d.ts +0 -278
package/dist/index.cjs
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
+
var _chunkHN6UAQAEcjs = require('./chunk-HN6UAQAE.cjs');
|
|
4
|
+
|
|
5
|
+
|
|
3
6
|
var _chunk5HNFAYTOcjs = require('./chunk-5HNFAYTO.cjs');
|
|
4
7
|
|
|
5
8
|
|
|
@@ -7,26 +10,30 @@ var _chunk5HNFAYTOcjs = require('./chunk-5HNFAYTO.cjs');
|
|
|
7
10
|
|
|
8
11
|
var _chunkLYOU7CA2cjs = require('./chunk-LYOU7CA2.cjs');
|
|
9
12
|
require('./chunk-3E67S427.cjs');
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
var _chunkQWAX7VQOcjs = require('./chunk-QWAX7VQO.cjs');
|
|
10
17
|
require('./chunk-2PYACSZ5.cjs');
|
|
11
18
|
|
|
12
19
|
|
|
13
|
-
var _chunkHN6UAQAEcjs = require('./chunk-HN6UAQAE.cjs');
|
|
14
20
|
|
|
15
21
|
|
|
16
22
|
|
|
23
|
+
var _chunkQCRLKVB3cjs = require('./chunk-QCRLKVB3.cjs');
|
|
24
|
+
require('./chunk-C3H7RTFR.cjs');
|
|
17
25
|
|
|
18
|
-
var _chunkONA73BU6cjs = require('./chunk-ONA73BU6.cjs');
|
|
19
|
-
require('./chunk-HHNHWYTP.cjs');
|
|
20
26
|
|
|
21
27
|
|
|
22
28
|
|
|
23
|
-
var _chunkQWAX7VQOcjs = require('./chunk-QWAX7VQO.cjs');
|
|
24
29
|
|
|
30
|
+
var _chunkHS74X2OJcjs = require('./chunk-HS74X2OJ.cjs');
|
|
25
31
|
|
|
26
32
|
|
|
27
33
|
|
|
28
34
|
|
|
29
|
-
var
|
|
35
|
+
var _chunkDKHGWHXPcjs = require('./chunk-DKHGWHXP.cjs');
|
|
36
|
+
require('./chunk-FGP3QXWL.cjs');
|
|
30
37
|
|
|
31
38
|
|
|
32
39
|
|
|
@@ -100,5 +107,9 @@ var _chunk7Q742NI3cjs = require('./chunk-7Q742NI3.cjs');
|
|
|
100
107
|
|
|
101
108
|
|
|
102
109
|
|
|
103
|
-
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
exports.AIToolbox = _chunk5HNFAYTOcjs.AIToolbox; exports.AI_MODELS_CATALOG_ID = _chunkTF4L2NECcjs.AI_MODELS_CATALOG_ID; exports.AI_MODELS_DESCRIPTOR = _chunkTF4L2NECcjs.AI_MODELS_DESCRIPTOR; exports.AI_TOOLS_APP_ID = _chunkTF4L2NECcjs.AI_TOOLS_APP_ID; exports.AiModelsCatalogClient = _chunkF2F4UEFDcjs.AiModelsCatalogClient; exports.AiModelsService = _chunkQCRLKVB3cjs.AiModelsService; exports.AiToolsError = _chunk7Q742NI3cjs.AiToolsError; exports.AliasConflictError = _chunk7Q742NI3cjs.AliasConflictError; exports.AliasFileParseError = _chunk7Q742NI3cjs.AliasFileParseError; exports.AliasFileWriteError = _chunk7Q742NI3cjs.AliasFileWriteError; exports.AliasInvalidNameError = _chunk7Q742NI3cjs.AliasInvalidNameError; exports.AliasNotFoundError = _chunk7Q742NI3cjs.AliasNotFoundError; exports.AliasRegistry = _chunkQWAX7VQOcjs.AliasRegistry; exports.AliasResolver = _chunkQWAX7VQOcjs.AliasResolver; exports.CatalogSyncJobError = _chunkHS74X2OJcjs.CatalogSyncJobError; exports.CostCalculationError = _chunk7Q742NI3cjs.CostCalculationError; exports.CostCalculator = _chunkHN6UAQAEcjs.CostCalculator; exports.ModelNameResolver = _chunkTF4L2NECcjs.ModelNameResolver; exports.ModelNotFoundError = _chunk7Q742NI3cjs.ModelNotFoundError; exports.ModelResolutionError = _chunk7Q742NI3cjs.ModelResolutionError; exports.OpenRouterSyncProvider = _chunkDKHGWHXPcjs.OpenRouterSyncProvider; exports.REASONING_SUPPORTED_PARAMETERS = _chunkAV6OE2YQcjs.REASONING_SUPPORTED_PARAMETERS; exports.SyncError = _chunk7Q742NI3cjs.SyncError; exports.computeSupportsReasoning = _chunkAV6OE2YQcjs.computeSupportsReasoning; exports.countModels = _chunkQCRLKVB3cjs.countModels; exports.createModelNameResolver = _chunkLYOU7CA2cjs.createModelNameResolver; exports.ensureAiModelsCatalog = _chunkDKHGWHXPcjs.ensureAiModelsCatalog; exports.filterModels = _chunkQCRLKVB3cjs.filterModels; exports.getModelInfo = _chunkQCRLKVB3cjs.getModelInfo; exports.hasReasoningPricing = _chunkAV6OE2YQcjs.hasReasoningPricing; exports.isReasoningModel = _chunkAV6OE2YQcjs.isReasoningModel; exports.isRoutedViaOpenRouter = _chunkLYOU7CA2cjs.isRoutedViaOpenRouter; exports.loadOpenRouterRoutingEnv = _chunkTF4L2NECcjs.loadOpenRouterRoutingEnv; exports.normalizeOpenRouterModel = _chunkAV6OE2YQcjs.normalizeOpenRouterModel; exports.providerIdToEnvKeyPrefix = _chunkTF4L2NECcjs.providerIdToEnvKeyPrefix; exports.pruneStaleCatalogModels = _chunkHS74X2OJcjs.pruneStaleCatalogModels; exports.resolveModel = _chunkLYOU7CA2cjs.resolveModel; exports.runAiModelsCatalogSync = _chunkHS74X2OJcjs.runAiModelsCatalogSync; exports.shouldDefaultRouteViaOpenRouter = _chunkTF4L2NECcjs.shouldDefaultRouteViaOpenRouter; exports.supportsReasoningParameter = _chunkAV6OE2YQcjs.supportsReasoningParameter; exports.syncAiModelsCatalog = _chunkDKHGWHXPcjs.syncAiModelsCatalog; exports.vendorApiKeyEnvName = _chunkTF4L2NECcjs.vendorApiKeyEnvName; exports.verifyAiModelsCatalog = _chunkHS74X2OJcjs.verifyAiModelsCatalog;
|
|
104
115
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/ami/Documents/prometheus/x12i/ai-tools/dist/index.cjs"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACF,wDAA6B;AAC7B,gCAA6B;AAC7B
|
|
1
|
+
{"version":3,"sources":["/Users/ami/Documents/prometheus/x12i/ai-tools/dist/index.cjs"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACF,wDAA6B;AAC7B,gCAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B,gCAA6B;AAC7B;AACE;AACA;AACA;AACA;AACF,wDAA6B;AAC7B,gCAA6B;AAC7B;AACE;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACF,wDAA6B;AAC7B,gCAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,g4FAAC","file":"/Users/ami/Documents/prometheus/x12i/ai-tools/dist/index.cjs"}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,23 +1,17 @@
|
|
|
1
1
|
export { AiCostResult, AiUsageInput, CostCalculator, CostCalculatorOptions } from './cost/index.cjs';
|
|
2
|
-
export { A as AiModelsCatalogClient, a as AiModelsCatalogClientOptions } from './AiModelsCatalogClient-
|
|
2
|
+
export { A as AiModelsCatalogClient, a as AiModelsCatalogClientOptions } from './AiModelsCatalogClient-CNeqFiFs.cjs';
|
|
3
3
|
export { AiModelsService, AiModelsServiceOptions, REASONING_SUPPORTED_PARAMETERS, ReasoningModelInput, computeSupportsReasoning, countModels, filterModels, getModelInfo, hasReasoningPricing, isReasoningModel, normalizeOpenRouterModel, supportsReasoningParameter } from './models/index.cjs';
|
|
4
|
-
|
|
5
|
-
export {
|
|
6
|
-
|
|
7
|
-
export {
|
|
4
|
+
export { A as AiModelPricing, a as AiModelRecord, M as ModelListFilters, b as ModelListResult, c as OpenRouterModelApi, d as OpenRouterModelsQuery } from './types-BYXnCvKx.cjs';
|
|
5
|
+
export { AI_MODELS_CATALOG_ID, AI_MODELS_DESCRIPTOR, AI_TOOLS_APP_ID, CatalogSyncJobError, CatalogSyncJobOptions, CatalogSyncJobResult, CatalogVerifyOptions, CatalogVerifyReport, EnsureAiModelsCatalogOptions, PruneStaleCatalogModelsOptions, PruneStaleCatalogModelsResult, ensureAiModelsCatalog, pruneStaleCatalogModels, runAiModelsCatalogSync, verifyAiModelsCatalog } from './catalog/index.cjs';
|
|
6
|
+
export { M as ModelNameResolver, O as OpenRouterSyncProvider, a as OpenRouterSyncProviderOptions, c as createModelNameResolver, i as isRoutedViaOpenRouter, r as resolveModel } from './modelNameResolver-D9V_GfUK.cjs';
|
|
7
|
+
export { S as SyncOptions, a as SyncResult, s as syncAiModelsCatalog } from './syncAiModelsCatalog-CnXRLm2c.cjs';
|
|
8
8
|
export { AIToolbox, AiToolboxOptions, Fallback, FallbackChain, Guard, GuardConfig, RouteRule, Router, TrackResult, Tracker } from './toolbox/index.cjs';
|
|
9
|
+
import { M as ModelResolutionInput, e as ModelResolutionNotFound } from './types-CX6QFNNy.cjs';
|
|
10
|
+
export { A as AliasEntry, a as AliasFileSchema, b as AliasRegistry, c as AliasRegistryOptions, d as AliasValidationReport, f as ModelResolutionResult, g as ModelResolutionSuccess, h as ModelResolverOptions, O as OpenRouterRoutingConfig, R as ResolutionStrategy, i as ResolvedModel, j as ResolvedModelRef, l as loadOpenRouterRoutingEnv, p as providerIdToEnvKeyPrefix, s as shouldDefaultRouteViaOpenRouter, v as vendorApiKeyEnvName } from './types-CX6QFNNy.cjs';
|
|
9
11
|
export { AliasResolver, AliasResolverOptions } from './aliases/index.cjs';
|
|
12
|
+
import '@x12i/catalox';
|
|
10
13
|
import 'firebase-admin/firestore';
|
|
11
|
-
|
|
12
|
-
type EnsureAiModelsCatalogOptions = {
|
|
13
|
-
appId?: string;
|
|
14
|
-
catalogId?: string;
|
|
15
|
-
};
|
|
16
|
-
declare function ensureAiModelsCatalog(catalox: Catalox, options?: EnsureAiModelsCatalogOptions): Promise<void>;
|
|
17
|
-
|
|
18
|
-
declare const AI_MODELS_CATALOG_ID = "ai-models";
|
|
19
|
-
declare const AI_TOOLS_APP_ID = "ai-tools";
|
|
20
|
-
declare const AI_MODELS_DESCRIPTOR: CatalogDescriptor;
|
|
14
|
+
import './upsertAiModelRecord-CjY-sny0.cjs';
|
|
21
15
|
|
|
22
16
|
type AiToolsErrorCode = "MODEL_NOT_FOUND" | "SYNC_FETCH_FAILED" | "SYNC_UPSERT_FAILED" | "CATALOG_BOOTSTRAP_FAILED" | "COST_CALCULATION_FAILED" | "INVALID_USAGE_INPUT" | "OPENROUTER_AUTH_FAILED" | "OPENROUTER_MODELS_FETCH_FAILED" | "CACHE_READ_ERROR" | "ALIAS_NOT_FOUND" | "ALIAS_INVALID_NAME" | "ALIAS_CONFLICT" | "ALIAS_FILE_PARSE_ERROR" | "ALIAS_FILE_WRITE_ERROR";
|
|
23
17
|
declare class AiToolsError extends Error {
|
|
@@ -55,4 +49,4 @@ declare class CostCalculationError extends AiToolsError {
|
|
|
55
49
|
constructor(message: string, cause?: unknown);
|
|
56
50
|
}
|
|
57
51
|
|
|
58
|
-
export {
|
|
52
|
+
export { AiToolsError, type AiToolsErrorCode, AliasConflictError, AliasFileParseError, AliasFileWriteError, AliasInvalidNameError, AliasNotFoundError, CostCalculationError, ModelNotFoundError, ModelResolutionError, ModelResolutionInput, SyncError };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,23 +1,17 @@
|
|
|
1
1
|
export { AiCostResult, AiUsageInput, CostCalculator, CostCalculatorOptions } from './cost/index.js';
|
|
2
|
-
export { A as AiModelsCatalogClient, a as AiModelsCatalogClientOptions } from './AiModelsCatalogClient-
|
|
2
|
+
export { A as AiModelsCatalogClient, a as AiModelsCatalogClientOptions } from './AiModelsCatalogClient-nwFoEaqL.js';
|
|
3
3
|
export { AiModelsService, AiModelsServiceOptions, REASONING_SUPPORTED_PARAMETERS, ReasoningModelInput, computeSupportsReasoning, countModels, filterModels, getModelInfo, hasReasoningPricing, isReasoningModel, normalizeOpenRouterModel, supportsReasoningParameter } from './models/index.js';
|
|
4
|
-
|
|
5
|
-
export {
|
|
6
|
-
|
|
7
|
-
export {
|
|
4
|
+
export { A as AiModelPricing, a as AiModelRecord, M as ModelListFilters, b as ModelListResult, c as OpenRouterModelApi, d as OpenRouterModelsQuery } from './types-BYXnCvKx.js';
|
|
5
|
+
export { AI_MODELS_CATALOG_ID, AI_MODELS_DESCRIPTOR, AI_TOOLS_APP_ID, CatalogSyncJobError, CatalogSyncJobOptions, CatalogSyncJobResult, CatalogVerifyOptions, CatalogVerifyReport, EnsureAiModelsCatalogOptions, PruneStaleCatalogModelsOptions, PruneStaleCatalogModelsResult, ensureAiModelsCatalog, pruneStaleCatalogModels, runAiModelsCatalogSync, verifyAiModelsCatalog } from './catalog/index.js';
|
|
6
|
+
export { M as ModelNameResolver, O as OpenRouterSyncProvider, a as OpenRouterSyncProviderOptions, c as createModelNameResolver, i as isRoutedViaOpenRouter, r as resolveModel } from './modelNameResolver-DqFt7g6W.js';
|
|
7
|
+
export { S as SyncOptions, a as SyncResult, s as syncAiModelsCatalog } from './syncAiModelsCatalog-DpkN_w7S.js';
|
|
8
8
|
export { AIToolbox, AiToolboxOptions, Fallback, FallbackChain, Guard, GuardConfig, RouteRule, Router, TrackResult, Tracker } from './toolbox/index.js';
|
|
9
|
+
import { M as ModelResolutionInput, e as ModelResolutionNotFound } from './types-CuiPDcVs.js';
|
|
10
|
+
export { A as AliasEntry, a as AliasFileSchema, b as AliasRegistry, c as AliasRegistryOptions, d as AliasValidationReport, f as ModelResolutionResult, g as ModelResolutionSuccess, h as ModelResolverOptions, O as OpenRouterRoutingConfig, R as ResolutionStrategy, i as ResolvedModel, j as ResolvedModelRef, l as loadOpenRouterRoutingEnv, p as providerIdToEnvKeyPrefix, s as shouldDefaultRouteViaOpenRouter, v as vendorApiKeyEnvName } from './types-CuiPDcVs.js';
|
|
9
11
|
export { AliasResolver, AliasResolverOptions } from './aliases/index.js';
|
|
12
|
+
import '@x12i/catalox';
|
|
10
13
|
import 'firebase-admin/firestore';
|
|
11
|
-
|
|
12
|
-
type EnsureAiModelsCatalogOptions = {
|
|
13
|
-
appId?: string;
|
|
14
|
-
catalogId?: string;
|
|
15
|
-
};
|
|
16
|
-
declare function ensureAiModelsCatalog(catalox: Catalox, options?: EnsureAiModelsCatalogOptions): Promise<void>;
|
|
17
|
-
|
|
18
|
-
declare const AI_MODELS_CATALOG_ID = "ai-models";
|
|
19
|
-
declare const AI_TOOLS_APP_ID = "ai-tools";
|
|
20
|
-
declare const AI_MODELS_DESCRIPTOR: CatalogDescriptor;
|
|
14
|
+
import './upsertAiModelRecord-C831wOIF.js';
|
|
21
15
|
|
|
22
16
|
type AiToolsErrorCode = "MODEL_NOT_FOUND" | "SYNC_FETCH_FAILED" | "SYNC_UPSERT_FAILED" | "CATALOG_BOOTSTRAP_FAILED" | "COST_CALCULATION_FAILED" | "INVALID_USAGE_INPUT" | "OPENROUTER_AUTH_FAILED" | "OPENROUTER_MODELS_FETCH_FAILED" | "CACHE_READ_ERROR" | "ALIAS_NOT_FOUND" | "ALIAS_INVALID_NAME" | "ALIAS_CONFLICT" | "ALIAS_FILE_PARSE_ERROR" | "ALIAS_FILE_WRITE_ERROR";
|
|
23
17
|
declare class AiToolsError extends Error {
|
|
@@ -55,4 +49,4 @@ declare class CostCalculationError extends AiToolsError {
|
|
|
55
49
|
constructor(message: string, cause?: unknown);
|
|
56
50
|
}
|
|
57
51
|
|
|
58
|
-
export {
|
|
52
|
+
export { AiToolsError, type AiToolsErrorCode, AliasConflictError, AliasFileParseError, AliasFileWriteError, AliasInvalidNameError, AliasNotFoundError, CostCalculationError, ModelNotFoundError, ModelResolutionError, ModelResolutionInput, SyncError };
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CostCalculator
|
|
3
|
+
} from "./chunk-YHO57D2V.js";
|
|
1
4
|
import {
|
|
2
5
|
AIToolbox
|
|
3
6
|
} from "./chunk-XRBZQQQU.js";
|
|
@@ -7,26 +10,30 @@ import {
|
|
|
7
10
|
resolveModel
|
|
8
11
|
} from "./chunk-G2G4KSC5.js";
|
|
9
12
|
import "./chunk-KHODXGPV.js";
|
|
10
|
-
import "./chunk-COK34C6P.js";
|
|
11
|
-
import {
|
|
12
|
-
CostCalculator
|
|
13
|
-
} from "./chunk-YHO57D2V.js";
|
|
14
|
-
import {
|
|
15
|
-
OpenRouterSyncProvider,
|
|
16
|
-
ensureAiModelsCatalog,
|
|
17
|
-
syncAiModelsCatalog
|
|
18
|
-
} from "./chunk-MLRHYOCD.js";
|
|
19
|
-
import "./chunk-ML2FRR4L.js";
|
|
20
13
|
import {
|
|
21
14
|
AliasRegistry,
|
|
22
15
|
AliasResolver
|
|
23
16
|
} from "./chunk-O2A6OVEH.js";
|
|
17
|
+
import "./chunk-COK34C6P.js";
|
|
24
18
|
import {
|
|
25
19
|
AiModelsService,
|
|
26
20
|
countModels,
|
|
27
21
|
filterModels,
|
|
28
22
|
getModelInfo
|
|
29
23
|
} from "./chunk-4NAY6HRP.js";
|
|
24
|
+
import "./chunk-M5TMA73F.js";
|
|
25
|
+
import {
|
|
26
|
+
CatalogSyncJobError,
|
|
27
|
+
pruneStaleCatalogModels,
|
|
28
|
+
runAiModelsCatalogSync,
|
|
29
|
+
verifyAiModelsCatalog
|
|
30
|
+
} from "./chunk-MX3AMQFC.js";
|
|
31
|
+
import {
|
|
32
|
+
OpenRouterSyncProvider,
|
|
33
|
+
ensureAiModelsCatalog,
|
|
34
|
+
syncAiModelsCatalog
|
|
35
|
+
} from "./chunk-VRFVF5RH.js";
|
|
36
|
+
import "./chunk-HYGXZY25.js";
|
|
30
37
|
import {
|
|
31
38
|
REASONING_SUPPORTED_PARAMETERS,
|
|
32
39
|
computeSupportsReasoning,
|
|
@@ -75,6 +82,7 @@ export {
|
|
|
75
82
|
AliasNotFoundError,
|
|
76
83
|
AliasRegistry,
|
|
77
84
|
AliasResolver,
|
|
85
|
+
CatalogSyncJobError,
|
|
78
86
|
CostCalculationError,
|
|
79
87
|
CostCalculator,
|
|
80
88
|
ModelNameResolver,
|
|
@@ -95,10 +103,13 @@ export {
|
|
|
95
103
|
loadOpenRouterRoutingEnv,
|
|
96
104
|
normalizeOpenRouterModel,
|
|
97
105
|
providerIdToEnvKeyPrefix,
|
|
106
|
+
pruneStaleCatalogModels,
|
|
98
107
|
resolveModel,
|
|
108
|
+
runAiModelsCatalogSync,
|
|
99
109
|
shouldDefaultRouteViaOpenRouter,
|
|
100
110
|
supportsReasoningParameter,
|
|
101
111
|
syncAiModelsCatalog,
|
|
102
|
-
vendorApiKeyEnvName
|
|
112
|
+
vendorApiKeyEnvName,
|
|
113
|
+
verifyAiModelsCatalog
|
|
103
114
|
};
|
|
104
115
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { Firestore } from 'firebase-admin/firestore';
|
|
1
|
+
import { d as OpenRouterModelsQuery, a as AiModelRecord } from './types-BYXnCvKx.cjs';
|
|
2
|
+
import { h as ModelResolverOptions, M as ModelResolutionInput, f as ModelResolutionResult, g as ModelResolutionSuccess, b as AliasRegistry, i as ResolvedModel } from './types-CX6QFNNy.cjs';
|
|
4
3
|
|
|
5
4
|
type OpenRouterSyncProviderOptions = {
|
|
6
5
|
/** Optional — public GET /models needs no key. */
|
|
@@ -23,29 +22,6 @@ declare class OpenRouterSyncProvider {
|
|
|
23
22
|
getModelsUrl(): string;
|
|
24
23
|
}
|
|
25
24
|
|
|
26
|
-
type SyncOptions = {
|
|
27
|
-
catalox: Catalox;
|
|
28
|
-
firestore: Firestore;
|
|
29
|
-
openRouterApiKey?: string;
|
|
30
|
-
openRouterQuery?: OpenRouterModelsQuery;
|
|
31
|
-
appId?: string;
|
|
32
|
-
catalogId?: string;
|
|
33
|
-
dryRun?: boolean;
|
|
34
|
-
verbose?: boolean;
|
|
35
|
-
forceCache?: boolean;
|
|
36
|
-
};
|
|
37
|
-
type SyncResult = {
|
|
38
|
-
fetched: number;
|
|
39
|
-
upserted: number;
|
|
40
|
-
skipped: number;
|
|
41
|
-
errors: Array<{
|
|
42
|
-
modelId: string;
|
|
43
|
-
error: string;
|
|
44
|
-
}>;
|
|
45
|
-
durationMs: number;
|
|
46
|
-
};
|
|
47
|
-
declare function syncAiModelsCatalog(options: SyncOptions): Promise<SyncResult>;
|
|
48
|
-
|
|
49
25
|
declare class ModelNameResolver {
|
|
50
26
|
private readonly catalog;
|
|
51
27
|
private readonly indexes;
|
|
@@ -77,4 +53,4 @@ declare function createModelNameResolver(catalog: Map<string, AiModelRecord>, op
|
|
|
77
53
|
declare function resolveModel(input: string, models: Map<string, AiModelRecord>, aliasRegistry?: AliasRegistry, provider?: string): ResolvedModel | null;
|
|
78
54
|
declare function isRoutedViaOpenRouter(provider: string | undefined, model: AiModelRecord, matchedKey: string): boolean;
|
|
79
55
|
|
|
80
|
-
export { ModelNameResolver as M, OpenRouterSyncProvider as O, type
|
|
56
|
+
export { ModelNameResolver as M, OpenRouterSyncProvider as O, type OpenRouterSyncProviderOptions as a, createModelNameResolver as c, isRoutedViaOpenRouter as i, resolveModel as r };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { Firestore } from 'firebase-admin/firestore';
|
|
1
|
+
import { d as OpenRouterModelsQuery, a as AiModelRecord } from './types-BYXnCvKx.js';
|
|
2
|
+
import { h as ModelResolverOptions, M as ModelResolutionInput, f as ModelResolutionResult, g as ModelResolutionSuccess, b as AliasRegistry, i as ResolvedModel } from './types-CuiPDcVs.js';
|
|
4
3
|
|
|
5
4
|
type OpenRouterSyncProviderOptions = {
|
|
6
5
|
/** Optional — public GET /models needs no key. */
|
|
@@ -23,29 +22,6 @@ declare class OpenRouterSyncProvider {
|
|
|
23
22
|
getModelsUrl(): string;
|
|
24
23
|
}
|
|
25
24
|
|
|
26
|
-
type SyncOptions = {
|
|
27
|
-
catalox: Catalox;
|
|
28
|
-
firestore: Firestore;
|
|
29
|
-
openRouterApiKey?: string;
|
|
30
|
-
openRouterQuery?: OpenRouterModelsQuery;
|
|
31
|
-
appId?: string;
|
|
32
|
-
catalogId?: string;
|
|
33
|
-
dryRun?: boolean;
|
|
34
|
-
verbose?: boolean;
|
|
35
|
-
forceCache?: boolean;
|
|
36
|
-
};
|
|
37
|
-
type SyncResult = {
|
|
38
|
-
fetched: number;
|
|
39
|
-
upserted: number;
|
|
40
|
-
skipped: number;
|
|
41
|
-
errors: Array<{
|
|
42
|
-
modelId: string;
|
|
43
|
-
error: string;
|
|
44
|
-
}>;
|
|
45
|
-
durationMs: number;
|
|
46
|
-
};
|
|
47
|
-
declare function syncAiModelsCatalog(options: SyncOptions): Promise<SyncResult>;
|
|
48
|
-
|
|
49
25
|
declare class ModelNameResolver {
|
|
50
26
|
private readonly catalog;
|
|
51
27
|
private readonly indexes;
|
|
@@ -77,4 +53,4 @@ declare function createModelNameResolver(catalog: Map<string, AiModelRecord>, op
|
|
|
77
53
|
declare function resolveModel(input: string, models: Map<string, AiModelRecord>, aliasRegistry?: AliasRegistry, provider?: string): ResolvedModel | null;
|
|
78
54
|
declare function isRoutedViaOpenRouter(provider: string | undefined, model: AiModelRecord, matchedKey: string): boolean;
|
|
79
55
|
|
|
80
|
-
export { ModelNameResolver as M, OpenRouterSyncProvider as O, type
|
|
56
|
+
export { ModelNameResolver as M, OpenRouterSyncProvider as O, type OpenRouterSyncProviderOptions as a, createModelNameResolver as c, isRoutedViaOpenRouter as i, resolveModel as r };
|
package/dist/models/index.d.cts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { A as AiModelPricing, O as OpenRouterArchitectureApi, n as OpenRouterModelsQuery, o as OpenRouterModelsResponse, p as OpenRouterOutputModality, q as OpenRouterPricingApi, s as OpenRouterTopProviderApi } from '../types-DdGB3YaA.cjs';
|
|
1
|
+
import { f as ModelResolutionResult } from '../types-CX6QFNNy.cjs';
|
|
3
2
|
import { Catalox, CatalogQueryOptions } from '@x12i/catalox';
|
|
3
|
+
import { a as AiModelRecord, M as ModelListFilters, b as ModelListResult, c as OpenRouterModelApi } from '../types-BYXnCvKx.cjs';
|
|
4
|
+
export { A as AiModelPricing, O as OpenRouterArchitectureApi, d as OpenRouterModelsQuery, e as OpenRouterModelsResponse, f as OpenRouterOutputModality, g as OpenRouterPricingApi, h as OpenRouterTopProviderApi } from '../types-BYXnCvKx.cjs';
|
|
4
5
|
|
|
5
6
|
type AiModelsServiceOptions = {
|
|
6
7
|
catalox: Catalox;
|
package/dist/models/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { A as AiModelPricing, O as OpenRouterArchitectureApi, n as OpenRouterModelsQuery, o as OpenRouterModelsResponse, p as OpenRouterOutputModality, q as OpenRouterPricingApi, s as OpenRouterTopProviderApi } from '../types-DdGB3YaA.js';
|
|
1
|
+
import { f as ModelResolutionResult } from '../types-CuiPDcVs.js';
|
|
3
2
|
import { Catalox, CatalogQueryOptions } from '@x12i/catalox';
|
|
3
|
+
import { a as AiModelRecord, M as ModelListFilters, b as ModelListResult, c as OpenRouterModelApi } from '../types-BYXnCvKx.js';
|
|
4
|
+
export { A as AiModelPricing, O as OpenRouterArchitectureApi, d as OpenRouterModelsQuery, e as OpenRouterModelsResponse, f as OpenRouterOutputModality, g as OpenRouterPricingApi, h as OpenRouterTopProviderApi } from '../types-BYXnCvKx.js';
|
|
4
5
|
|
|
5
6
|
type AiModelsServiceOptions = {
|
|
6
7
|
catalox: Catalox;
|
package/dist/sync/index.cjs
CHANGED
|
@@ -6,8 +6,8 @@ var _chunkLYOU7CA2cjs = require('../chunk-LYOU7CA2.cjs');
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
10
|
-
require('../chunk-
|
|
9
|
+
var _chunkDKHGWHXPcjs = require('../chunk-DKHGWHXP.cjs');
|
|
10
|
+
require('../chunk-FGP3QXWL.cjs');
|
|
11
11
|
require('../chunk-AV6OE2YQ.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
@@ -34,5 +34,5 @@ require('../chunk-7Q742NI3.cjs');
|
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
|
|
37
|
-
exports.ModelNameResolver = _chunkTF4L2NECcjs.ModelNameResolver; exports.OpenRouterSyncProvider =
|
|
37
|
+
exports.ModelNameResolver = _chunkTF4L2NECcjs.ModelNameResolver; exports.OpenRouterSyncProvider = _chunkDKHGWHXPcjs.OpenRouterSyncProvider; exports.buildCatalogIndexes = _chunkTF4L2NECcjs.buildCatalogIndexes; exports.createModelNameResolver = _chunkLYOU7CA2cjs.createModelNameResolver; exports.isRoutedViaOpenRouter = _chunkLYOU7CA2cjs.isRoutedViaOpenRouter; exports.loadOpenRouterRoutingEnv = _chunkTF4L2NECcjs.loadOpenRouterRoutingEnv; exports.normalizeProvider = _chunkTF4L2NECcjs.normalizeProvider; exports.normalizeString = _chunkTF4L2NECcjs.normalizeString; exports.providerIdToEnvKeyPrefix = _chunkTF4L2NECcjs.providerIdToEnvKeyPrefix; exports.resolveModel = _chunkLYOU7CA2cjs.resolveModel; exports.shouldDefaultRouteViaOpenRouter = _chunkTF4L2NECcjs.shouldDefaultRouteViaOpenRouter; exports.syncAiModelsCatalog = _chunkDKHGWHXPcjs.syncAiModelsCatalog; exports.vendorApiKeyEnvName = _chunkTF4L2NECcjs.vendorApiKeyEnvName;
|
|
38
38
|
//# sourceMappingURL=index.cjs.map
|
package/dist/sync/index.d.cts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
export { M as ModelNameResolver, O as OpenRouterSyncProvider, a as OpenRouterSyncProviderOptions,
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export { M as ModelNameResolver, O as OpenRouterSyncProvider, a as OpenRouterSyncProviderOptions, c as createModelNameResolver, i as isRoutedViaOpenRouter, r as resolveModel } from '../modelNameResolver-D9V_GfUK.cjs';
|
|
2
|
+
export { S as SyncOptions, a as SyncResult, s as syncAiModelsCatalog } from '../syncAiModelsCatalog-CnXRLm2c.cjs';
|
|
3
|
+
import { C as CatalogIndexes } from '../types-CX6QFNNy.cjs';
|
|
4
|
+
export { M as ModelResolutionInput, f as ModelResolutionResult, g as ModelResolutionSuccess, h as ModelResolverOptions, O as OpenRouterRoutingConfig, R as ResolutionStrategy, i as ResolvedModel, l as loadOpenRouterRoutingEnv, p as providerIdToEnvKeyPrefix, s as shouldDefaultRouteViaOpenRouter, v as vendorApiKeyEnvName } from '../types-CX6QFNNy.cjs';
|
|
5
|
+
import { a as AiModelRecord } from '../types-BYXnCvKx.cjs';
|
|
4
6
|
import '@x12i/catalox';
|
|
5
7
|
import 'firebase-admin/firestore';
|
|
8
|
+
import '../upsertAiModelRecord-CjY-sny0.cjs';
|
|
6
9
|
|
|
7
10
|
declare function buildCatalogIndexes(catalog: Map<string, AiModelRecord>): CatalogIndexes;
|
|
8
11
|
|
package/dist/sync/index.d.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
export { M as ModelNameResolver, O as OpenRouterSyncProvider, a as OpenRouterSyncProviderOptions,
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export { M as ModelNameResolver, O as OpenRouterSyncProvider, a as OpenRouterSyncProviderOptions, c as createModelNameResolver, i as isRoutedViaOpenRouter, r as resolveModel } from '../modelNameResolver-DqFt7g6W.js';
|
|
2
|
+
export { S as SyncOptions, a as SyncResult, s as syncAiModelsCatalog } from '../syncAiModelsCatalog-DpkN_w7S.js';
|
|
3
|
+
import { C as CatalogIndexes } from '../types-CuiPDcVs.js';
|
|
4
|
+
export { M as ModelResolutionInput, f as ModelResolutionResult, g as ModelResolutionSuccess, h as ModelResolverOptions, O as OpenRouterRoutingConfig, R as ResolutionStrategy, i as ResolvedModel, l as loadOpenRouterRoutingEnv, p as providerIdToEnvKeyPrefix, s as shouldDefaultRouteViaOpenRouter, v as vendorApiKeyEnvName } from '../types-CuiPDcVs.js';
|
|
5
|
+
import { a as AiModelRecord } from '../types-BYXnCvKx.js';
|
|
4
6
|
import '@x12i/catalox';
|
|
5
7
|
import 'firebase-admin/firestore';
|
|
8
|
+
import '../upsertAiModelRecord-C831wOIF.js';
|
|
6
9
|
|
|
7
10
|
declare function buildCatalogIndexes(catalog: Map<string, AiModelRecord>): CatalogIndexes;
|
|
8
11
|
|
package/dist/sync/index.js
CHANGED
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
import {
|
|
7
7
|
OpenRouterSyncProvider,
|
|
8
8
|
syncAiModelsCatalog
|
|
9
|
-
} from "../chunk-
|
|
10
|
-
import "../chunk-
|
|
9
|
+
} from "../chunk-VRFVF5RH.js";
|
|
10
|
+
import "../chunk-HYGXZY25.js";
|
|
11
11
|
import "../chunk-6QGDZTGH.js";
|
|
12
12
|
import {
|
|
13
13
|
ModelNameResolver,
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Catalox } from '@x12i/catalox';
|
|
2
|
+
import { Firestore } from 'firebase-admin/firestore';
|
|
3
|
+
import { B as BatchUpsertProgress } from './upsertAiModelRecord-CjY-sny0.cjs';
|
|
4
|
+
import { d as OpenRouterModelsQuery } from './types-BYXnCvKx.cjs';
|
|
5
|
+
|
|
6
|
+
type SyncOptions = {
|
|
7
|
+
catalox: Catalox;
|
|
8
|
+
firestore: Firestore;
|
|
9
|
+
openRouterApiKey?: string;
|
|
10
|
+
openRouterQuery?: OpenRouterModelsQuery;
|
|
11
|
+
appId?: string;
|
|
12
|
+
catalogId?: string;
|
|
13
|
+
dryRun?: boolean;
|
|
14
|
+
verbose?: boolean;
|
|
15
|
+
forceCache?: boolean;
|
|
16
|
+
onProgress?: (progress: BatchUpsertProgress) => void;
|
|
17
|
+
};
|
|
18
|
+
type SyncResult = {
|
|
19
|
+
fetched: number;
|
|
20
|
+
upserted: number;
|
|
21
|
+
skipped: number;
|
|
22
|
+
errors: Array<{
|
|
23
|
+
modelId: string;
|
|
24
|
+
error: string;
|
|
25
|
+
}>;
|
|
26
|
+
durationMs: number;
|
|
27
|
+
/** Model ids written (or that would be written on dry-run). */
|
|
28
|
+
syncedModelIds: string[];
|
|
29
|
+
};
|
|
30
|
+
declare function syncAiModelsCatalog(options: SyncOptions): Promise<SyncResult>;
|
|
31
|
+
|
|
32
|
+
export { type SyncOptions as S, type SyncResult as a, syncAiModelsCatalog as s };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Catalox } from '@x12i/catalox';
|
|
2
|
+
import { Firestore } from 'firebase-admin/firestore';
|
|
3
|
+
import { B as BatchUpsertProgress } from './upsertAiModelRecord-C831wOIF.js';
|
|
4
|
+
import { d as OpenRouterModelsQuery } from './types-BYXnCvKx.js';
|
|
5
|
+
|
|
6
|
+
type SyncOptions = {
|
|
7
|
+
catalox: Catalox;
|
|
8
|
+
firestore: Firestore;
|
|
9
|
+
openRouterApiKey?: string;
|
|
10
|
+
openRouterQuery?: OpenRouterModelsQuery;
|
|
11
|
+
appId?: string;
|
|
12
|
+
catalogId?: string;
|
|
13
|
+
dryRun?: boolean;
|
|
14
|
+
verbose?: boolean;
|
|
15
|
+
forceCache?: boolean;
|
|
16
|
+
onProgress?: (progress: BatchUpsertProgress) => void;
|
|
17
|
+
};
|
|
18
|
+
type SyncResult = {
|
|
19
|
+
fetched: number;
|
|
20
|
+
upserted: number;
|
|
21
|
+
skipped: number;
|
|
22
|
+
errors: Array<{
|
|
23
|
+
modelId: string;
|
|
24
|
+
error: string;
|
|
25
|
+
}>;
|
|
26
|
+
durationMs: number;
|
|
27
|
+
/** Model ids written (or that would be written on dry-run). */
|
|
28
|
+
syncedModelIds: string[];
|
|
29
|
+
};
|
|
30
|
+
declare function syncAiModelsCatalog(options: SyncOptions): Promise<SyncResult>;
|
|
31
|
+
|
|
32
|
+
export { type SyncOptions as S, type SyncResult as a, syncAiModelsCatalog as s };
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/** OpenRouter Models API — https://openrouter.ai/api/v1/models */
|
|
2
|
+
type OpenRouterOutputModality = "text" | "image" | "audio" | "embeddings" | "video" | "speech" | "transcription" | "all";
|
|
3
|
+
type OpenRouterModelsQuery = {
|
|
4
|
+
/** Comma-separated or "all" — default on our sync is "all". */
|
|
5
|
+
output_modalities?: string;
|
|
6
|
+
supported_parameters?: string;
|
|
7
|
+
};
|
|
8
|
+
type OpenRouterPricingApi = {
|
|
9
|
+
prompt: string;
|
|
10
|
+
completion: string;
|
|
11
|
+
request: string;
|
|
12
|
+
image: string;
|
|
13
|
+
web_search?: string;
|
|
14
|
+
internal_reasoning?: string;
|
|
15
|
+
input_cache_read?: string;
|
|
16
|
+
input_cache_write?: string;
|
|
17
|
+
};
|
|
18
|
+
type OpenRouterArchitectureApi = {
|
|
19
|
+
modality?: string;
|
|
20
|
+
input_modalities: string[];
|
|
21
|
+
output_modalities: string[];
|
|
22
|
+
tokenizer: string;
|
|
23
|
+
instruct_type: string | null;
|
|
24
|
+
};
|
|
25
|
+
type OpenRouterTopProviderApi = {
|
|
26
|
+
context_length: number;
|
|
27
|
+
max_completion_tokens: number | null;
|
|
28
|
+
is_moderated: boolean;
|
|
29
|
+
};
|
|
30
|
+
type OpenRouterDefaultParametersApi = {
|
|
31
|
+
temperature?: number | null;
|
|
32
|
+
top_p?: number | null;
|
|
33
|
+
top_k?: number | null;
|
|
34
|
+
frequency_penalty?: number | null;
|
|
35
|
+
presence_penalty?: number | null;
|
|
36
|
+
repetition_penalty?: number | null;
|
|
37
|
+
};
|
|
38
|
+
type OpenRouterModelApi = {
|
|
39
|
+
id: string;
|
|
40
|
+
canonical_slug: string;
|
|
41
|
+
hugging_face_id?: string | null;
|
|
42
|
+
name: string;
|
|
43
|
+
created: number;
|
|
44
|
+
description: string;
|
|
45
|
+
context_length: number;
|
|
46
|
+
architecture: OpenRouterArchitectureApi;
|
|
47
|
+
pricing: OpenRouterPricingApi;
|
|
48
|
+
top_provider: OpenRouterTopProviderApi;
|
|
49
|
+
per_request_limits: unknown | null;
|
|
50
|
+
supported_parameters: string[];
|
|
51
|
+
default_parameters: OpenRouterDefaultParametersApi | null;
|
|
52
|
+
supported_voices?: unknown | null;
|
|
53
|
+
knowledge_cutoff?: string | null;
|
|
54
|
+
expiration_date?: string | null;
|
|
55
|
+
links?: {
|
|
56
|
+
details?: string;
|
|
57
|
+
} | null;
|
|
58
|
+
};
|
|
59
|
+
type OpenRouterModelsResponse = {
|
|
60
|
+
data: OpenRouterModelApi[];
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
type AiModelPricing = {
|
|
64
|
+
promptUsdPerToken: number;
|
|
65
|
+
completionUsdPerToken: number;
|
|
66
|
+
imageUsdPerUnit: number;
|
|
67
|
+
requestUsdPerRequest: number;
|
|
68
|
+
cacheReadUsdPerToken?: number;
|
|
69
|
+
cacheWriteUsdPerToken?: number;
|
|
70
|
+
reasoningUsdPerToken?: number;
|
|
71
|
+
webSearchUsdPerRequest?: number;
|
|
72
|
+
openRouterMarkupUsdPerInputToken?: number;
|
|
73
|
+
openRouterMarkupUsdPerOutputToken?: number;
|
|
74
|
+
pricedAt: string;
|
|
75
|
+
source: "openrouter" | "direct" | "manual";
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* Canonical catalog record — mirrors OpenRouter Models API fields plus normalized pricing.
|
|
79
|
+
* Stored as-is in Catalox `data`; scalar fields duplicated in `indexed` for queries.
|
|
80
|
+
*/
|
|
81
|
+
type AiModelRecord = {
|
|
82
|
+
modelId: string;
|
|
83
|
+
name: string;
|
|
84
|
+
providerId: string;
|
|
85
|
+
canonicalSlug: string;
|
|
86
|
+
status: "active" | "deprecated" | "unknown";
|
|
87
|
+
description: string;
|
|
88
|
+
created: number;
|
|
89
|
+
expirationDate: string | null;
|
|
90
|
+
contextLength: number;
|
|
91
|
+
maxCompletionTokens: number | null;
|
|
92
|
+
isModerated: boolean;
|
|
93
|
+
modality: string;
|
|
94
|
+
inputModalities: string[];
|
|
95
|
+
outputModalities: string[];
|
|
96
|
+
tokenizer: string;
|
|
97
|
+
instructType: string | null;
|
|
98
|
+
supportedParameters: string[];
|
|
99
|
+
defaultParameters: OpenRouterDefaultParametersApi | null;
|
|
100
|
+
perRequestLimits: unknown | null;
|
|
101
|
+
pricing: AiModelPricing;
|
|
102
|
+
/** Raw OpenRouter pricing strings (USD per token/request/unit). */
|
|
103
|
+
openRouterPricing: OpenRouterPricingApi;
|
|
104
|
+
architecture: OpenRouterArchitectureApi;
|
|
105
|
+
topProvider: OpenRouterTopProviderApi;
|
|
106
|
+
/** Full OpenRouter API object — complete mirror for forward compatibility. */
|
|
107
|
+
openRouter: OpenRouterModelApi;
|
|
108
|
+
aliases: string[];
|
|
109
|
+
availableOnOpenRouter: boolean;
|
|
110
|
+
supportsStreaming: boolean;
|
|
111
|
+
supportsTools: boolean;
|
|
112
|
+
/** Exposes reasoning/thinking tokens (OpenRouter `reasoning` param and/or `internal_reasoning` pricing). */
|
|
113
|
+
supportsReasoning: boolean;
|
|
114
|
+
primaryOutputModality: string;
|
|
115
|
+
syncedAt: string;
|
|
116
|
+
syncSource: "openrouter" | "manual";
|
|
117
|
+
};
|
|
118
|
+
type ModelListFilters = {
|
|
119
|
+
providerId?: string;
|
|
120
|
+
status?: AiModelRecord["status"];
|
|
121
|
+
outputModality?: string;
|
|
122
|
+
inputModality?: string;
|
|
123
|
+
supportedParameter?: string;
|
|
124
|
+
supportsTools?: boolean;
|
|
125
|
+
supportsReasoning?: boolean;
|
|
126
|
+
search?: string;
|
|
127
|
+
limit?: number;
|
|
128
|
+
offset?: number;
|
|
129
|
+
};
|
|
130
|
+
type ModelListResult = {
|
|
131
|
+
models: AiModelRecord[];
|
|
132
|
+
total: number;
|
|
133
|
+
limit: number;
|
|
134
|
+
offset: number;
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
export type { AiModelPricing as A, ModelListFilters as M, OpenRouterArchitectureApi as O, AiModelRecord as a, ModelListResult as b, OpenRouterModelApi as c, OpenRouterModelsQuery as d, OpenRouterModelsResponse as e, OpenRouterOutputModality as f, OpenRouterPricingApi as g, OpenRouterTopProviderApi as h };
|