@blockrun/llm 3.26.0 → 3.26.4

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 -->90<!-- /br:models.chatVisible --> models — every request goes to the cheapest model that can handle it,
7
+ The smart-routing SDK for <!-- br:models.chatVisible -->91<!-- /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)
@@ -44,7 +44,7 @@ console.log(r.response); // the proof
44
44
  ## Why This SDK
45
45
 
46
46
  - 🧠 **Smart routing that pays for itself.** The bundled [Router Core V3](https://github.com/BlockRunAI/router-core) engine (shared with [ClawRouter](https://github.com/BlockRunAI/ClawRouter)) classifies every request locally in <1ms across <!-- br:clawrouter.dimensions -->15<!-- /br:clawrouter.dimensions --> dimensions and routes to the cheapest capable model.
47
- - 🆓 **<!-- br:models.free -->7<!-- /br:models.free --> genuinely free models.** $0 in and out, including two 1M-context Nemotrons, two that accept images, and free coding models from Cohere and Poolside.
47
+ - 🆓 **<!-- br:models.free -->8<!-- /br:models.free --> genuinely free models.** $0 in and out, including two 1M-context Nemotrons, two that accept images, and free coding models from Cohere and Poolside.
48
48
  - 🔐 **Two ways to connect.** A **BlockRun API key** billed against account credit ([sign up](https://user.blockrun.ai), [create a key](https://user.blockrun.ai/dashboard/keys), [add credit](https://user.blockrun.ai/dashboard/credits)), or a wallet signature with x402 micropayments and no account at all. Same code either way.
49
49
  - 💸 **Pay per request in USDC.** x402 micropayments on Solana, Base or Arc. Agents can fund and pay their own way.
50
50
  - 🛡️ **Automatic failover.** Transient errors (timeouts, 429, 5xx) before payment walk the router's ranked fallback chain instead of failing your request; a failure after a payment was sent never buys a second model.
@@ -56,8 +56,8 @@ 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 -->90<!-- /br:models.chatVisible -->, one credential** |
60
- | **Free tier** | ✗ | Rate-limited | ✗ | **<!-- br:models.free -->7<!-- /br:models.free --> models, no signup** |
59
+ | **Models** | GPT only | 200+ | 100+ (BYO keys) | **<!-- br:models.chatVisible -->91<!-- /br:models.chatVisible -->, one credential** |
60
+ | **Free tier** | ✗ | Rate-limited | ✗ | **<!-- br:models.free -->8<!-- /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** |
63
63
  | **Agent-ready** | ✗ | ✗ | ✗ | **✓ — one key, or agents fund their own wallet** |
@@ -341,7 +341,7 @@ try {
341
341
 
342
342
  // Manually pass a fallback chain to chat() / chatCompletion()
343
343
  const reply = await client.chat('nvidia/nemotron-3.5-lightning', 'hello', {
344
- fallbackModels: ['nvidia/nemotron-3-ultra-550b', 'cohere/north-mini-code'],
344
+ fallbackModels: ['nvidia/nemotron-3-ultra-550b', 'nvidia/nemotron-3-nano-omni-30b-a3b-reasoning'],
345
345
  });
346
346
  // If nemotron-3.5-lightning times out, the SDK retries against the next model
347
347
  // and logs each hop to stderr: "[@blockrun/llm] <from> -> <to> (...)".
@@ -351,7 +351,7 @@ const reply = await client.chat('nvidia/nemotron-3.5-lightning', 'hello', {
351
351
 
352
352
  | Profile | Strategy | Savings vs Opus 5 | Best For |
353
353
  |---------|----------|-------------------|----------|
354
- | `eco` | Cheapest capable model — ranks the <!-- br:models.free -->7<!-- /br:models.free -->-model free tier first | **<!-- br:savings.ecoVsBaselinePct -->98<!-- /br:savings.ecoVsBaselinePct -->%** | Cost-sensitive production, zero-cost testing |
354
+ | `eco` | Cheapest capable model — ranks the <!-- br:models.free -->8<!-- /br:models.free -->-model free tier first | **<!-- br:savings.ecoVsBaselinePct -->98<!-- /br:savings.ecoVsBaselinePct -->%** | Cost-sensitive production, zero-cost testing |
355
355
  | `auto` | Best balance of cost and quality (default) | **<!-- br:savings.autoVsBaselinePct -->84<!-- /br:savings.autoVsBaselinePct -->%** | General use |
356
356
  | `premium` | Highest-quality model per tier | 0% | Quality-critical tasks |
357
357
 
@@ -928,14 +928,17 @@ prefix, or let `routingProfile: 'eco'` rank them first.
928
928
  | `nvidia/nemotron-3.5-lightning` | 1M | Thinking-mode reasoning at 1M context |
929
929
  | `nvidia/nemotron-3-ultra-550b` | 1M | Largest free model — 550B, 1M context |
930
930
  | `nvidia/nemotron-3-nano-omni-30b-a3b-reasoning` | 256K | Multimodal reasoning — text + images |
931
- | `nvidia/llama-3.2-11b-vision` | 128K | Vision-language — accepts images |
932
- | `nvidia/muse-glimmer-30b` | 128K | Chat, reasoning and coding |
933
- | `cohere/north-mini-code` | 256K | Compact coding model, sub-second responses |
931
+ | `nvidia/nemotron-3.5-bolt` | 128K | Free vision — verified on real image probes on Base and Solana |
934
932
  | `poolside/laguna-xs-2.1` | 128K | Coding model |
935
933
 
936
934
  A free model can be briefly marked unavailable in the live catalog while the
937
935
  gateway's health check holds it back; it stays on the free tier.
938
936
 
937
+ `nvidia/llama-3.2-11b-vision`, `cohere/north-mini-code` and `nvidia/muse-glimmer-30b`
938
+ still answer, but
939
+ since 2026-11 the gateway serves them with a different model. Don't pin them;
940
+ use `nemotron-3.5-bolt` for free image input.
941
+
939
942
  <details>
940
943
  <summary><strong>Paid chat models</strong> — OpenAI, Anthropic, Google, DeepSeek, xAI, Moonshot, MiniMax, Z.ai, Qwen, Mistral, Tencent, Poolside, Xiaomi</summary>
941
944
 
@@ -1826,7 +1829,7 @@ to pick up security fixes.
1826
1829
  ## Frequently Asked Questions
1827
1830
 
1828
1831
  ### What is @blockrun/llm?
1829
- 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.
1832
+ 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 -->91<!-- /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.
1830
1833
 
1831
1834
  ### What is smart routing?
1832
1835
  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).