@llmops/core 0.6.10-beta.1 → 0.6.10

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/index.mjs CHANGED
@@ -3920,9 +3920,9 @@ var LLMOpsPricingProvider = class {
3920
3920
  }
3921
3921
  }
3922
3922
  /**
3923
- * Get pricing for a specific model
3923
+ * Internal: fetch with cache and deduplication for a specific provider+model
3924
3924
  */
3925
- async getModelPricing(provider, model) {
3925
+ async getCachedPricing(provider, model) {
3926
3926
  const cacheKey = this.getCacheKey(provider, model);
3927
3927
  const cached = this.cache.get(cacheKey);
3928
3928
  if (cached && Date.now() - cached.fetchedAt < this.cacheTTL) return cached.pricing;
@@ -3942,6 +3942,22 @@ var LLMOpsPricingProvider = class {
3942
3942
  return pending;
3943
3943
  }
3944
3944
  /**
3945
+ * Get pricing for a specific model.
3946
+ *
3947
+ * When the model name contains a slash (e.g. "google/gemini-2.5-flash"),
3948
+ * it's likely an OpenRouter model ID. If the initial provider lookup fails,
3949
+ * we automatically retry with "openrouter" as the provider.
3950
+ */
3951
+ async getModelPricing(provider, model) {
3952
+ const pricing = await this.getCachedPricing(provider, model);
3953
+ if (pricing) return pricing;
3954
+ if (!pricing && model.includes("/") && provider.toLowerCase() !== "openrouter") {
3955
+ logger.debug(`[Pricing] Retrying ${provider}/${model} as openrouter/${model}`);
3956
+ return this.getCachedPricing("openrouter", model);
3957
+ }
3958
+ return pricing;
3959
+ }
3960
+ /**
3945
3961
  * Force refresh the pricing cache (clears all cached entries)
3946
3962
  */
3947
3963
  async refreshCache() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@llmops/core",
3
- "version": "0.6.10-beta.1",
3
+ "version": "0.6.10",
4
4
  "description": "Core LLMOps functionality and utilities",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -55,7 +55,7 @@
55
55
  "kysely": "^0.28.8",
56
56
  "kysely-neon": "^2.0.2",
57
57
  "pino": "^10.1.0",
58
- "@llmops/gateway": "^0.6.10-beta.1"
58
+ "@llmops/gateway": "^0.6.10"
59
59
  },
60
60
  "devDependencies": {
61
61
  "@types/json-logic-js": "^2.0.8",