@oh-my-pi/pi-catalog 17.0.6 → 17.0.7
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.
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* may strip `search`-style markers and prefers cache-pricing-complete
|
|
9
9
|
* references, both of which would be wrong for canonical coalescing.
|
|
10
10
|
*/
|
|
11
|
-
import type { Api, Model } from "../types.js";
|
|
11
|
+
import type { Api, Model, ThinkingConfig } from "../types.js";
|
|
12
12
|
export interface ModelReferenceIndex {
|
|
13
13
|
exact: Map<string, Model<Api>>;
|
|
14
14
|
suffixAlias: Map<string, Model<Api>>;
|
|
@@ -19,5 +19,11 @@ export declare function isZeroCostXaiOAuthReference(candidate: Model<Api>): bool
|
|
|
19
19
|
* Pure: callers are responsible for memoizing the result.
|
|
20
20
|
*/
|
|
21
21
|
export declare function buildModelReferenceIndex(models: Iterable<Model<Api>>): ModelReferenceIndex;
|
|
22
|
+
/**
|
|
23
|
+
* Inherit bundled reference thinking only for same-provider matches. Wire routing
|
|
24
|
+
* (`effortRouting`) is provider-specific; cross-provider inheritance can rewrite
|
|
25
|
+
* gateway ids (e.g. Portkey `@modal/GLM-5-2-FP8` → devin `glm-5-2`).
|
|
26
|
+
*/
|
|
27
|
+
export declare function inheritReferenceThinking(modelThinking: ThinkingConfig | undefined, reference: Pick<Model<Api>, "provider" | "thinking"> | undefined, provider: string): ThinkingConfig | undefined;
|
|
22
28
|
/** Resolve a (possibly proxied/affixed) model id to its bundled upstream reference. */
|
|
23
29
|
export declare function resolveModelReference(modelId: string, index: ModelReferenceIndex): Model<Api> | undefined;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@oh-my-pi/pi-catalog",
|
|
4
|
-
"version": "17.0.
|
|
4
|
+
"version": "17.0.7",
|
|
5
5
|
"description": "Model catalog for omp: bundled model database, provider discovery descriptors, model identity, classification, and equivalence",
|
|
6
6
|
"homepage": "https://omp.sh",
|
|
7
7
|
"author": "Can Boluk",
|
|
@@ -34,12 +34,12 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@bufbuild/protobuf": "^2.12.1",
|
|
37
|
-
"@oh-my-pi/pi-utils": "17.0.
|
|
37
|
+
"@oh-my-pi/pi-utils": "17.0.7",
|
|
38
38
|
"arktype": "2.2.3",
|
|
39
39
|
"zod": "^4"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@oh-my-pi/pi-ai": "17.0.
|
|
42
|
+
"@oh-my-pi/pi-ai": "17.0.7",
|
|
43
43
|
"@types/bun": "^1.3.14"
|
|
44
44
|
},
|
|
45
45
|
"engines": {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* may strip `search`-style markers and prefers cache-pricing-complete
|
|
9
9
|
* references, both of which would be wrong for canonical coalescing.
|
|
10
10
|
*/
|
|
11
|
-
import type { Api, Model } from "../types";
|
|
11
|
+
import type { Api, Model, ThinkingConfig } from "../types";
|
|
12
12
|
import { getBracketStrippedModelIdCandidates, getLongestModelLikeIdSegment, getModelLikeIdSegments } from "./id";
|
|
13
13
|
import { REFERENCE_TRAILING_MARKER_PATTERN } from "./markers";
|
|
14
14
|
|
|
@@ -137,8 +137,27 @@ function getReferenceCandidateIds(modelId: string): string[] {
|
|
|
137
137
|
return [...candidates];
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
+
/**
|
|
141
|
+
* Inherit bundled reference thinking only for same-provider matches. Wire routing
|
|
142
|
+
* (`effortRouting`) is provider-specific; cross-provider inheritance can rewrite
|
|
143
|
+
* gateway ids (e.g. Portkey `@modal/GLM-5-2-FP8` → devin `glm-5-2`).
|
|
144
|
+
*/
|
|
145
|
+
export function inheritReferenceThinking(
|
|
146
|
+
modelThinking: ThinkingConfig | undefined,
|
|
147
|
+
reference: Pick<Model<Api>, "provider" | "thinking"> | undefined,
|
|
148
|
+
provider: string,
|
|
149
|
+
): ThinkingConfig | undefined {
|
|
150
|
+
if (modelThinking !== undefined) return modelThinking;
|
|
151
|
+
if (!reference?.thinking) return undefined;
|
|
152
|
+
if (reference.provider !== provider) return undefined;
|
|
153
|
+
return reference.thinking;
|
|
154
|
+
}
|
|
155
|
+
|
|
140
156
|
/** Resolve a (possibly proxied/affixed) model id to its bundled upstream reference. */
|
|
141
157
|
export function resolveModelReference(modelId: string, index: ModelReferenceIndex): Model<Api> | undefined {
|
|
158
|
+
// Portkey/gateway wire ids (`@provider/model`) are opaque; fuzzy matching would
|
|
159
|
+
// map them to unrelated bundled entries (e.g. `@modal/GLM-5-2-FP8` → devin/glm-5-2).
|
|
160
|
+
if (modelId.startsWith("@")) return undefined;
|
|
142
161
|
for (const candidate of getReferenceCandidateIds(modelId)) {
|
|
143
162
|
const key = normalizeReferenceKey(candidate);
|
|
144
163
|
const reference = index.exact.get(key) ?? index.suffixAlias.get(key);
|