pi-lilac-provider 1.6.1 → 1.6.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.
Files changed (2) hide show
  1. package/index.ts +11 -0
  2. package/package.json +1 -1
package/index.ts CHANGED
@@ -493,9 +493,20 @@ function mergeWithEmbedded(liveModels: JsonModel[], embeddedModels: JsonModel[])
493
493
  const embedded = embeddedMap.get(liveModel.id);
494
494
  seen.add(liveModel.id);
495
495
  if (embedded) {
496
+ // Self-heal: live API pricing is authoritative field-by-field. Prefer the
497
+ // live cost when the API reports it (non-zero); fall back to embedded when
498
+ // the API is silent (0) so curated cacheRead/cacheWrite isn't clobbered and
499
+ // providers whose /models endpoint exposes no pricing keep their curated
500
+ // cost. Curation (reasoning/input/compat/name) still wins via ...embedded.
496
501
  result.push({
497
502
  ...liveModel,
498
503
  ...embedded,
504
+ cost: {
505
+ input: liveModel.cost.input || embedded.cost.input,
506
+ output: liveModel.cost.output || embedded.cost.output,
507
+ cacheRead: liveModel.cost.cacheRead || embedded.cost.cacheRead,
508
+ cacheWrite: liveModel.cost.cacheWrite || embedded.cost.cacheWrite,
509
+ },
499
510
  contextWindow: liveModel.contextWindow || embedded.contextWindow,
500
511
  });
501
512
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-lilac-provider",
3
- "version": "1.6.1",
3
+ "version": "1.6.2",
4
4
  "description": "Lilac provider extension for pi - Access Kimi K2.6, GLM 5.1, and Gemma 4 models through Lilac's OpenAI-compatible API on idle GPUs",
5
5
  "type": "module",
6
6
  "main": "index.ts",