@kortix/llm-catalog 0.10.9 → 0.10.11
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/dist/catalog.generated.json +176455 -37361
- package/dist/index.d.ts +133 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +276 -129
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,16 +1,146 @@
|
|
|
1
|
+
export interface ProviderAuthMethod {
|
|
2
|
+
/** Optional label, surfaced only if a provider ever exposes >1 method in the UI (none do today — the connect form always uses methods[0]). */
|
|
3
|
+
label?: string;
|
|
4
|
+
/** Every one of these project-secret env vars must be set for this method to count as satisfied. */
|
|
5
|
+
envVars: string[];
|
|
6
|
+
}
|
|
7
|
+
export interface ProviderAuthRequirement {
|
|
8
|
+
/**
|
|
9
|
+
* One or more independent ways to authenticate. A provider is CONNECTED if
|
|
10
|
+
* ANY method's envVars are all present — see `isProviderAuthSatisfied`.
|
|
11
|
+
*/
|
|
12
|
+
methods: ProviderAuthMethod[];
|
|
13
|
+
}
|
|
14
|
+
interface CatalogProviderLike {
|
|
15
|
+
id: string;
|
|
16
|
+
env?: string[];
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The auth requirement Kortix actually enforces for a catalog provider.
|
|
20
|
+
* Falls back to a single method requiring every var in `provider.env`
|
|
21
|
+
* (unchanged behavior) unless an override above corrects it.
|
|
22
|
+
*/
|
|
23
|
+
export declare function providerAuthRequirement(provider: CatalogProviderLike): ProviderAuthRequirement;
|
|
24
|
+
/**
|
|
25
|
+
* The env vars the connect form should collect for a provider — always the
|
|
26
|
+
* first (primary) auth method. Every provider has exactly one usable method
|
|
27
|
+
* today; this is the field list `ApiKeyConnectForm` renders and writes.
|
|
28
|
+
*/
|
|
29
|
+
export declare function primaryAuthEnvVars(provider: CatalogProviderLike): string[];
|
|
30
|
+
/**
|
|
31
|
+
* True when at least one of the requirement's auth methods has every one of
|
|
32
|
+
* its env vars present, per `hasEnvVar`. ANY-OF-methods, ALL-OF-vars-within-
|
|
33
|
+
* a-method — the one predicate every "is this provider connected" check
|
|
34
|
+
* (web connect modal, model-selector gating, native-mode provider merge, CLI
|
|
35
|
+
* `providers ls`) should use instead of hand-rolling `envVars.every(...)`
|
|
36
|
+
* over the raw catalog list.
|
|
37
|
+
*/
|
|
38
|
+
export declare function isProviderAuthSatisfied(requirement: ProviderAuthRequirement, hasEnvVar: (envVar: string) => boolean): boolean;
|
|
39
|
+
export interface CatalogReasoningOption {
|
|
40
|
+
type: string;
|
|
41
|
+
values?: string[];
|
|
42
|
+
min?: number;
|
|
43
|
+
max?: number;
|
|
44
|
+
}
|
|
45
|
+
export interface CatalogCostTier {
|
|
46
|
+
input?: number;
|
|
47
|
+
output?: number;
|
|
48
|
+
cache_read?: number;
|
|
49
|
+
cache_write?: number;
|
|
50
|
+
tier?: {
|
|
51
|
+
type: string;
|
|
52
|
+
size: number;
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
export interface CatalogCost {
|
|
56
|
+
input?: number;
|
|
57
|
+
output?: number;
|
|
58
|
+
cache_read?: number;
|
|
59
|
+
cache_write?: number;
|
|
60
|
+
tiers?: CatalogCostTier[];
|
|
61
|
+
context_over_200k?: CatalogCostTier;
|
|
62
|
+
}
|
|
63
|
+
export interface CatalogModalities {
|
|
64
|
+
input?: string[];
|
|
65
|
+
output?: string[];
|
|
66
|
+
}
|
|
1
67
|
export interface CatalogModel {
|
|
2
68
|
id: string;
|
|
3
69
|
name: string;
|
|
4
70
|
released?: string | null;
|
|
71
|
+
description?: string;
|
|
5
72
|
attachment?: boolean;
|
|
6
73
|
reasoning?: boolean;
|
|
74
|
+
reasoning_options?: CatalogReasoningOption[];
|
|
7
75
|
tool_call?: boolean;
|
|
8
76
|
temperature?: boolean;
|
|
77
|
+
structured_output?: boolean;
|
|
78
|
+
interleaved?: boolean | {
|
|
79
|
+
field?: string;
|
|
80
|
+
};
|
|
81
|
+
open_weights?: boolean;
|
|
82
|
+
knowledge?: string;
|
|
83
|
+
last_updated?: string;
|
|
84
|
+
family?: string;
|
|
85
|
+
modalities?: CatalogModalities;
|
|
9
86
|
limit?: {
|
|
10
87
|
context?: number;
|
|
88
|
+
input?: number;
|
|
11
89
|
output?: number;
|
|
12
90
|
};
|
|
91
|
+
cost?: CatalogCost;
|
|
92
|
+
}
|
|
93
|
+
/** Generic per-model generation defaults a project can configure. Extensible
|
|
94
|
+
* without a schema/migration change — see packages/db's jsonb column. */
|
|
95
|
+
export interface GenerationConfig {
|
|
96
|
+
reasoningEffort?: string;
|
|
97
|
+
temperature?: number;
|
|
98
|
+
topP?: number;
|
|
99
|
+
maxOutputTokens?: number;
|
|
13
100
|
}
|
|
101
|
+
export interface GenerationControlCapabilities {
|
|
102
|
+
/**
|
|
103
|
+
* Present iff the model publishes a REAL reasoning_options knob — from
|
|
104
|
+
* EITHER an `effort` entry (its exact `values`) OR a `budget_tokens` entry
|
|
105
|
+
* (a synthesized standard low/medium/high tier set — `budget_tokens` has no
|
|
106
|
+
* discrete values of its own, but it IS a real published knob, e.g. every
|
|
107
|
+
* mainline Claude model, which the transport maps via
|
|
108
|
+
* `resolveAnthropicThinkingBudget`/`REASONING_EFFORT_BUDGET_TOKENS`
|
|
109
|
+
* — so exposing an effort-style control for it is not fabrication the way
|
|
110
|
+
* inventing one for a bare `reasoning:true` model with NO reasoning_options
|
|
111
|
+
* at all would be). A `toggle` entry gets no control here (on/off is not an
|
|
112
|
+
* effort enum) but does not crash — see the `toggle` branch below. Absent
|
|
113
|
+
* entirely when the model publishes no real reasoning_options at all (we
|
|
114
|
+
* never fabricate one out of thin air).
|
|
115
|
+
*/
|
|
116
|
+
reasoningEffort?: {
|
|
117
|
+
values: string[];
|
|
118
|
+
};
|
|
119
|
+
/** True iff the model accepts a client-supplied temperature (models.dev
|
|
120
|
+
* `temperature:false` means FIXED — e.g. gpt-5.6-sol — hide the control). */
|
|
121
|
+
temperature: boolean;
|
|
122
|
+
/** top_p has no distinct models.dev flag — gated on the same standard-
|
|
123
|
+
* sampling capability as temperature (documented heuristic: models that
|
|
124
|
+
* reject a custom temperature reject a custom top_p too). */
|
|
125
|
+
topP: boolean;
|
|
126
|
+
/** Present iff the model declares a positive max output-token window —
|
|
127
|
+
* the ceiling a "max output tokens" control must clamp to. */
|
|
128
|
+
maxOutputTokens?: {
|
|
129
|
+
ceiling: number;
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
/** Pure capability derivation — NEVER a per-model id lookup table. */
|
|
133
|
+
export declare function generationControlCapabilities(model: CatalogModel | undefined | null): GenerationControlCapabilities;
|
|
134
|
+
/**
|
|
135
|
+
* Drop/clamp every field of a (possibly user- or client-supplied)
|
|
136
|
+
* `GenerationConfig` against what `model` actually supports — the single
|
|
137
|
+
* gate BOTH the routing-policy write path (persistence) and the gateway
|
|
138
|
+
* resolution-layer injection path (see apps/api's routing/resolve-route.ts)
|
|
139
|
+
* must run a value through before it's trusted. A field the model doesn't
|
|
140
|
+
* support is silently dropped (never a validation error) so a model swap
|
|
141
|
+
* doesn't require the caller to also scrub unrelated config.
|
|
142
|
+
*/
|
|
143
|
+
export declare function clampGenerationConfig(config: GenerationConfig | null | undefined, model: CatalogModel | undefined | null): GenerationConfig;
|
|
14
144
|
interface CatalogProvider {
|
|
15
145
|
id: string;
|
|
16
146
|
name: string;
|
|
@@ -32,9 +162,9 @@ export interface ManagedModel {
|
|
|
32
162
|
id: string;
|
|
33
163
|
name: string;
|
|
34
164
|
upstreamModelId: string;
|
|
35
|
-
transport:
|
|
165
|
+
transport: 'bedrock' | 'openrouter';
|
|
36
166
|
pricingRef: string;
|
|
37
|
-
tier:
|
|
167
|
+
tier: 'flagship' | 'balanced' | 'fast';
|
|
38
168
|
vision: boolean;
|
|
39
169
|
limit: {
|
|
40
170
|
context: number;
|
|
@@ -42,6 +172,7 @@ export interface ManagedModel {
|
|
|
42
172
|
};
|
|
43
173
|
openrouterProvider?: Record<string, unknown>;
|
|
44
174
|
}
|
|
175
|
+
export declare function pricingRefLookupCandidates(pricingRef: string): string[];
|
|
45
176
|
export declare const MANAGED_MODELS: ManagedModel[];
|
|
46
177
|
export declare function getManagedModel(id: string): ManagedModel | undefined;
|
|
47
178
|
export declare function isManagedModelId(id: string): boolean;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AA+EA,MAAM,WAAW,kBAAkB;IACjC,8IAA8I;IAC9I,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oGAAoG;IACpG,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,uBAAuB;IACtC;;;OAGG;IACH,OAAO,EAAE,kBAAkB,EAAE,CAAC;CAC/B;AAED,UAAU,mBAAmB;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC;CAChB;AA4BD;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,mBAAmB,GAAG,uBAAuB,CAK9F;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,mBAAmB,GAAG,MAAM,EAAE,CAE1E;AAED;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACrC,WAAW,EAAE,uBAAuB,EACpC,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,GACrC,OAAO,CAIT;AAsBD,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAKD,MAAM,WAAW,eAAe;IAC9B,KAAK,CA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