@blockrun/llm 3.24.5 → 3.24.6

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/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  ### Cut your LLM bill by <!-- br:savings.autoVsBaselinePct -->84<!-- /br:savings.autoVsBaselinePct -->%. One line of TypeScript.
6
6
 
7
- The smart-routing SDK for <!-- br:models.chatVisible -->88<!-- /br:models.chatVisible --> models — every request goes to the cheapest model that can handle it,
7
+ The smart-routing SDK for <!-- br:models.chatVisible -->90<!-- /br:models.chatVisible --> models — every request goes to the cheapest model that can handle it,
8
8
  paid with an API key or per-request USDC on Solana, Base or Arc. No vendor lock-in.
9
9
 
10
10
  [![npm](https://img.shields.io/npm/v/@blockrun/llm.svg?style=flat-square)](https://www.npmjs.com/package/@blockrun/llm)
@@ -56,7 +56,7 @@ console.log(r.response); // the proof
56
56
  | | OpenAI SDK | OpenRouter | LiteLLM | **@blockrun/llm** |
57
57
  | ------------------ | -------------- | ----------------- | ---------------- | ----------------------------------------------------------------------- |
58
58
  | **Cost routing** | ✗ one vendor | Manual selection | Manual selection | **Automatic — <!-- br:savings.autoVsBaselinePct -->84<!-- /br:savings.autoVsBaselinePct -->% cheaper** |
59
- | **Models** | GPT only | 200+ | 100+ (BYO keys) | **<!-- br:models.chatVisible -->88<!-- /br:models.chatVisible -->, one credential** |
59
+ | **Models** | GPT only | 200+ | 100+ (BYO keys) | **<!-- br:models.chatVisible -->90<!-- /br:models.chatVisible -->, one credential** |
60
60
  | **Free tier** | ✗ | Rate-limited | ✗ | **<!-- br:models.free -->7<!-- /br:models.free --> models, no signup** |
61
61
  | **Auth** | API key | Account + API key | Your API keys | **API key *or* wallet signature** |
62
62
  | **Payment** | Card + invoice | Credit card | BYO keys | **Account credit or USDC per-request** |
@@ -1811,7 +1811,7 @@ to pick up security fixes.
1811
1811
  ## Frequently Asked Questions
1812
1812
 
1813
1813
  ### What is @blockrun/llm?
1814
- A TypeScript SDK that cuts LLM costs by <!-- br:savings.autoVsBaselinePct -->84<!-- /br:savings.autoVsBaselinePct -->% on a realistic workload with built-in smart routing: every request goes to the cheapest of <!-- br:models.chatVisible -->88<!-- /br:models.chatVisible --> models (OpenAI, Anthropic, Google, xAI, DeepSeek, Moonshot, and more) that can handle it, paid with an account API key or per-request USDC via x402 on Solana, Base or Arc.
1814
+ A TypeScript SDK that cuts LLM costs by <!-- br:savings.autoVsBaselinePct -->84<!-- /br:savings.autoVsBaselinePct -->% on a realistic workload with built-in smart routing: every request goes to the cheapest of <!-- br:models.chatVisible -->90<!-- /br:models.chatVisible --> models (OpenAI, Anthropic, Google, xAI, DeepSeek, Moonshot, and more) that can handle it, paid with an account API key or per-request USDC via x402 on Solana, Base or Arc.
1815
1815
 
1816
1816
  ### What is smart routing?
1817
1817
  Router Core V3, bundled into the SDK: the same deterministic engine that powers ClawRouter. It analyzes each request across <!-- br:clawrouter.dimensions -->15<!-- /br:clawrouter.dimensions --> dimensions locally, in under 1ms, and picks the cheapest capable model. Use `smartChat()`, `smartChatCompletion()`, or the `blockrun/auto` model alias. See [Smart Routing](#smart-routing-router-core-v3).
package/dist/index.cjs CHANGED
@@ -571,7 +571,7 @@ function withCost(body, response, bookedUsd, scheme) {
571
571
  // src/client.ts
572
572
  var import_accounts2 = require("viem/accounts");
573
573
 
574
- // node_modules/.pnpm/@blockrun+router-core@https+++codeload.github.com+BlockRunAI+router-core+tar.gz+8773a9954b091_rjdkm4uoakz3dfyojiwn3sv45i/node_modules/@blockrun/router-core/dist/index.js
574
+ // node_modules/.pnpm/@blockrun+router-core@https+++codeload.github.com+BlockRunAI+router-core+tar.gz+fd6d03d035ff6_meidvh7c7i3y7wjjl6r2ymc4py/node_modules/@blockrun/router-core/dist/index.js
575
575
  var UNSEGMENTED_SCRIPT = /[؀-ۿ -ヿ㐀-䶿一-鿿가-힯豈-﫿＀-￯]/;
576
576
  var WORD_CHAR = /[\p{L}\p{N}]/u;
577
577
  var ASCII_PHRASE = /^[a-z0-9' -]+$/;
@@ -2903,10 +2903,10 @@ function isEligible(modelId, features, maxOutputTokens, options) {
2903
2903
  return model.contextWindow >= (features.estimatedInputTokens + maxOutputTokens) * 1.1;
2904
2904
  }
2905
2905
  function estimatedCost(modelId, options, inputTokens, outputTokens) {
2906
- const price = options.modelPricing.get(modelId);
2907
- if (!price) return Number.POSITIVE_INFINITY;
2908
- if (price.flatPrice !== void 0) return price.flatPrice;
2909
- return (inputTokens * price.inputPrice + outputTokens * price.outputPrice) / 1e6;
2906
+ const price2 = options.modelPricing.get(modelId);
2907
+ if (!price2) return Number.POSITIVE_INFINITY;
2908
+ if (price2.flatPrice !== void 0) return price2.flatPrice;
2909
+ return (inputTokens * price2.inputPrice + outputTokens * price2.outputPrice) / 1e6;
2910
2910
  }
2911
2911
  function profileScore(modelId, options, now) {
2912
2912
  const profile = options.modelPerformance?.[modelId] ?? LIVE_MODEL_PROFILES[modelId] ?? HISTORICAL_MODEL_PROFILES[modelId];
@@ -5089,7 +5089,7 @@ function getCostSummary() {
5089
5089
  }
5090
5090
 
5091
5091
  // src/version.ts
5092
- var SDK_VERSION = "3.24.5";
5092
+ var SDK_VERSION = "3.24.6";
5093
5093
  var USER_AGENT = `blockrun-ts/${SDK_VERSION}`;
5094
5094
 
5095
5095
  // src/client.ts
package/dist/index.js CHANGED
@@ -440,7 +440,7 @@ function withCost(body, response, bookedUsd, scheme) {
440
440
  // src/client.ts
441
441
  import { privateKeyToAccount } from "viem/accounts";
442
442
 
443
- // node_modules/.pnpm/@blockrun+router-core@https+++codeload.github.com+BlockRunAI+router-core+tar.gz+8773a9954b091_rjdkm4uoakz3dfyojiwn3sv45i/node_modules/@blockrun/router-core/dist/index.js
443
+ // node_modules/.pnpm/@blockrun+router-core@https+++codeload.github.com+BlockRunAI+router-core+tar.gz+fd6d03d035ff6_meidvh7c7i3y7wjjl6r2ymc4py/node_modules/@blockrun/router-core/dist/index.js
444
444
  var UNSEGMENTED_SCRIPT = /[؀-ۿ -ヿ㐀-䶿一-鿿가-힯豈-﫿＀-￯]/;
445
445
  var WORD_CHAR = /[\p{L}\p{N}]/u;
446
446
  var ASCII_PHRASE = /^[a-z0-9' -]+$/;
@@ -2772,10 +2772,10 @@ function isEligible(modelId, features, maxOutputTokens, options) {
2772
2772
  return model.contextWindow >= (features.estimatedInputTokens + maxOutputTokens) * 1.1;
2773
2773
  }
2774
2774
  function estimatedCost(modelId, options, inputTokens, outputTokens) {
2775
- const price = options.modelPricing.get(modelId);
2776
- if (!price) return Number.POSITIVE_INFINITY;
2777
- if (price.flatPrice !== void 0) return price.flatPrice;
2778
- return (inputTokens * price.inputPrice + outputTokens * price.outputPrice) / 1e6;
2775
+ const price2 = options.modelPricing.get(modelId);
2776
+ if (!price2) return Number.POSITIVE_INFINITY;
2777
+ if (price2.flatPrice !== void 0) return price2.flatPrice;
2778
+ return (inputTokens * price2.inputPrice + outputTokens * price2.outputPrice) / 1e6;
2779
2779
  }
2780
2780
  function profileScore(modelId, options, now) {
2781
2781
  const profile = options.modelPerformance?.[modelId] ?? LIVE_MODEL_PROFILES[modelId] ?? HISTORICAL_MODEL_PROFILES[modelId];
@@ -4958,7 +4958,7 @@ function getCostSummary() {
4958
4958
  }
4959
4959
 
4960
4960
  // src/version.ts
4961
- var SDK_VERSION = "3.24.5";
4961
+ var SDK_VERSION = "3.24.6";
4962
4962
  var USER_AGENT = `blockrun-ts/${SDK_VERSION}`;
4963
4963
 
4964
4964
  // src/client.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blockrun/llm",
3
- "version": "3.24.5",
3
+ "version": "3.24.6",
4
4
  "type": "module",
5
5
  "description": "TypeScript SDK for BlockRun - every frontier model behind one OpenAI-compatible client. Pay with a BlockRun API key or per-call in USDC. Smart routing picks the cheapest capable model. No rate limits.",
6
6
  "main": "dist/index.cjs",
@@ -58,7 +58,7 @@
58
58
  },
59
59
  "devDependencies": {
60
60
  "@blockrun/core": "^0.1.0",
61
- "@blockrun/router-core": "https://codeload.github.com/BlockRunAI/router-core/tar.gz/8773a9954b091bd0090acdfec67c75a006c0e156",
61
+ "@blockrun/router-core": "https://codeload.github.com/BlockRunAI/router-core/tar.gz/fd6d03d035ff676642ba1683c333d929939f8a00",
62
62
  "@eslint/js": "^10.0.1",
63
63
  "@solana/kit": "^5.5.1",
64
64
  "@types/node": "^26.4.1",