@stablekernel/pi-bifrost 0.2.1 → 0.2.2
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/package.json +1 -1
- package/src/index.ts +4 -0
- package/src/plugin.test.ts +20 -0
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -101,6 +101,9 @@ type CliModel = {
|
|
|
101
101
|
};
|
|
102
102
|
limits_source: string;
|
|
103
103
|
cost_source?: string;
|
|
104
|
+
/** True when the gateway lists the model but it rejects completion on
|
|
105
|
+
* this key (not entitled, needs provisioned throughput, retired). */
|
|
106
|
+
disabled?: boolean;
|
|
104
107
|
reasoning?: boolean;
|
|
105
108
|
reasoning_efforts?: string[];
|
|
106
109
|
reasoning_budget_min?: number;
|
|
@@ -195,6 +198,7 @@ export function toPiModels(
|
|
|
195
198
|
const out: ProviderModelConfig[] = [];
|
|
196
199
|
for (const m of payload?.models ?? []) {
|
|
197
200
|
if (!m?.id) continue;
|
|
201
|
+
if (m.disabled) continue; // unavailable on this key: never offer it
|
|
198
202
|
const priced = m.cost !== undefined;
|
|
199
203
|
const reasoning = !!m.reasoning;
|
|
200
204
|
const model: ProviderModelConfig = {
|
package/src/plugin.test.ts
CHANGED
|
@@ -23,6 +23,9 @@ type CliModel = {
|
|
|
23
23
|
};
|
|
24
24
|
limits_source: string;
|
|
25
25
|
cost_source?: string;
|
|
26
|
+
/** True when the gateway lists the model but it rejects completion on
|
|
27
|
+
* this key (not entitled, needs provisioned throughput, retired). */
|
|
28
|
+
disabled?: boolean;
|
|
26
29
|
/** Reasoning capability and applicable efforts, from the catalog. */
|
|
27
30
|
reasoning?: boolean;
|
|
28
31
|
reasoning_efforts?: string[];
|
|
@@ -271,6 +274,23 @@ describe("unpriced models", () => {
|
|
|
271
274
|
});
|
|
272
275
|
});
|
|
273
276
|
|
|
277
|
+
describe("disabled models", () => {
|
|
278
|
+
test("omits models the CLI marks disabled", async () => {
|
|
279
|
+
const { toPiModels } = await import("./index.js");
|
|
280
|
+
const [model] = toPiModels(
|
|
281
|
+
{ models: [{ ...NOVA, disabled: true }] },
|
|
282
|
+
"openai-completions",
|
|
283
|
+
);
|
|
284
|
+
expect(model).toBeUndefined();
|
|
285
|
+
});
|
|
286
|
+
|
|
287
|
+
test("keeps models the CLI does not mark disabled", async () => {
|
|
288
|
+
const { toPiModels } = await import("./index.js");
|
|
289
|
+
const [model] = toPiModels({ models: [NOVA] }, "openai-completions");
|
|
290
|
+
expect(model?.id).toBe("bedrock/amazon.nova-lite-v1:0");
|
|
291
|
+
});
|
|
292
|
+
});
|
|
293
|
+
|
|
274
294
|
describe("reasoning", () => {
|
|
275
295
|
const KIMI: CliModel = {
|
|
276
296
|
id: "fireworks/models/kimi-k3",
|