pi-baseten-provider 1.0.2 → 1.0.3

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.
Files changed (2) hide show
  1. package/index.ts +11 -0
  2. package/package.json +1 -1
package/index.ts CHANGED
@@ -231,9 +231,20 @@ function mergeWithEmbedded(liveModels: JsonModel[], embeddedModels: JsonModel[])
231
231
  const embedded = embeddedMap.get(liveModel.id);
232
232
  seen.add(liveModel.id);
233
233
  if (embedded) {
234
+ // Self-heal: live API pricing is authoritative field-by-field. Prefer the
235
+ // live cost when the API reports it (non-zero); fall back to embedded when
236
+ // the API is silent (0) so curated cacheRead/cacheWrite isn't clobbered and
237
+ // providers whose /models endpoint exposes no pricing keep their curated
238
+ // cost. Curation (reasoning/input/compat/name) still wins via ...embedded.
234
239
  result.push({
235
240
  ...liveModel,
236
241
  ...embedded,
242
+ cost: {
243
+ input: liveModel.cost.input || embedded.cost.input,
244
+ output: liveModel.cost.output || embedded.cost.output,
245
+ cacheRead: liveModel.cost.cacheRead || embedded.cost.cacheRead,
246
+ cacheWrite: liveModel.cost.cacheWrite || embedded.cost.cacheWrite,
247
+ },
237
248
  contextWindow: liveModel.contextWindow || embedded.contextWindow,
238
249
  });
239
250
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-baseten-provider",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Baseten provider extension for pi - Access DeepSeek, Kimi, GLM, MiniMax, Nemotron, and GPT-OSS models through the Baseten Model API",
5
5
  "author": "monotykamary",
6
6
  "homepage": "https://github.com/monotykamary/pi-baseten-provider#readme",