@blockrun/llm 1.7.0 → 1.8.1

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
@@ -103,7 +103,7 @@ const client = new LLMClient();
103
103
  // Auto-routes to cheapest capable model
104
104
  const result = await client.smartChat('What is 2+2?');
105
105
  console.log(result.response); // '4'
106
- console.log(result.model); // 'nvidia/kimi-k2.5' (cheap, fast)
106
+ console.log(result.model); // 'moonshot/kimi-k2.5' (cheap, fast)
107
107
  console.log(`Saved ${(result.routing.savings * 100).toFixed(0)}%`); // 'Saved 78%'
108
108
 
109
109
  // Complex reasoning task -> routes to reasoning model
@@ -144,7 +144,7 @@ The classifier runs in <1ms, 100% locally, and routes to one of four tiers:
144
144
 
145
145
  | Tier | Example Tasks | Auto Profile Model |
146
146
  |------|---------------|-------------------|
147
- | SIMPLE | "What is 2+2?", definitions | nvidia/kimi-k2.5 |
147
+ | SIMPLE | "What is 2+2?", definitions | moonshot/kimi-k2.5 |
148
148
  | MEDIUM | Code snippets, explanations | xai/grok-code-fast-1 |
149
149
  | COMPLEX | Architecture, long documents | google/gemini-3.1-pro |
150
150
  | REASONING | Proofs, multi-step reasoning | xai/grok-4-1-fast-reasoning |
@@ -227,6 +227,7 @@ The classifier runs in <1ms, 100% locally, and routes to one of four tiers:
227
227
  ### Moonshot Kimi
228
228
  | Model | Input Price | Output Price |
229
229
  |-------|-------------|--------------|
230
+ | `moonshot/kimi-k2.6` | $0.95/M | $4.00/M |
230
231
  | `moonshot/kimi-k2.5` | $0.60/M | $3.00/M |
231
232
 
232
233
  ### MiniMax
@@ -235,11 +236,23 @@ The classifier runs in <1ms, 100% locally, and routes to one of four tiers:
235
236
  | `minimax/minimax-m2.7` | $0.30/M | $1.20/M |
236
237
  | `minimax/minimax-m2.5` | $0.30/M | $1.20/M |
237
238
 
238
- ### NVIDIA (Free & Hosted)
239
+ ### NVIDIA (Free) + Moonshot
240
+
241
+ Free tier refreshed 2026-04-21: retired the Nemotron family, `mistral-large-3-675b`,
242
+ `devstral-2-123b`, and paid `nvidia/kimi-k2.5`. The backend auto-redirects the
243
+ old IDs; the recommended replacements are listed below.
244
+
239
245
  | Model | Input Price | Output Price | Notes |
240
246
  |-------|-------------|--------------|-------|
241
- | `nvidia/gpt-oss-120b` | **FREE** | **FREE** | OpenAI open-weight 120B (Apache 2.0) |
242
- | `nvidia/kimi-k2.5` | $0.60/M | $3.00/M | Moonshot 1T MoE with vision |
247
+ | `nvidia/qwen3-next-80b-a3b-thinking` | **FREE** | **FREE** | Reasoning flagship 116 tok/s, thinking mode |
248
+ | `nvidia/mistral-small-4-119b` | **FREE** | **FREE** | Fastest free chat 114 tok/s |
249
+ | `nvidia/glm-4.7` | **FREE** | **FREE** | GLM-4.7 with thinking — 237 tok/s |
250
+ | `nvidia/llama-4-maverick` | **FREE** | **FREE** | Llama 4 Maverick MoE |
251
+ | `nvidia/qwen3-coder-480b` | **FREE** | **FREE** | Coding-optimised 480B MoE |
252
+ | `nvidia/deepseek-v3.2` | **FREE** | **FREE** | DeepSeek V3.2 hosted |
253
+ | `nvidia/gpt-oss-120b` | **FREE** | **FREE** | OpenAI open-weight 120B — 123 tok/s |
254
+ | `nvidia/gpt-oss-20b` | **FREE** | **FREE** | OpenAI open-weight 20B — 155 tok/s |
255
+ | `moonshot/kimi-k2.5` | $0.60/M | $3.00/M | Direct from Moonshot — replaces `nvidia/kimi-k2.5` |
243
256
 
244
257
  ### E2E Verified Models
245
258
 
@@ -254,7 +267,7 @@ All models below have been tested end-to-end via the TypeScript SDK (Feb 2026):
254
267
  | Google | `google/gemini-2.5-flash` | Passed |
255
268
  | DeepSeek | `deepseek/deepseek-chat` | Passed |
256
269
  | xAI | `xai/grok-3` | Passed |
257
- | Moonshot | `moonshot/kimi-k2.5` | Passed |
270
+ | Moonshot | `moonshot/kimi-k2.6` | Passed |
258
271
 
259
272
  ### Image Generation
260
273
  | Model | Price |
@@ -287,6 +300,70 @@ const r2 = await client.generate('the subject turns and smiles', {
287
300
  });
288
301
  ```
289
302
 
303
+ ### Standalone Search
304
+
305
+ `SearchClient` wraps `POST /v1/search` — standalone Grok Live Search.
306
+ Pricing: `$0.025/source + margin` (10 sources ≈ `$0.26`).
307
+
308
+ ```ts
309
+ import { SearchClient } from '@blockrun/llm';
310
+
311
+ const client = new SearchClient();
312
+ const result = await client.search('Latest news on x402 adoption', {
313
+ sources: ['x', 'web'],
314
+ maxResults: 10,
315
+ });
316
+ console.log(result.summary);
317
+ for (const url of result.citations ?? []) console.log(url);
318
+ ```
319
+
320
+ ### X/Twitter (AttentionVC)
321
+
322
+ `XClient` covers the full `/v1/x/*` endpoint family — previously the `X*`
323
+ types were exported but there was no client to call them with.
324
+
325
+ ```ts
326
+ import { XClient } from '@blockrun/llm';
327
+
328
+ const x = new XClient();
329
+ const info = await x.userInfo('elonmusk');
330
+ const followers = await x.followers('paulg');
331
+ const results = await x.search('x402 micropayments', { queryType: 'Latest' });
332
+ const tweets = await x.userTweets({ username: 'vitalikbuterin', includeReplies: false });
333
+ ```
334
+
335
+ Methods: `userLookup`, `userInfo`, `followers`, `following`, `followings`,
336
+ `verifiedFollowers`, `userTweets`, `mentions`, `tweetLookup`, `tweetReplies`,
337
+ `tweetThread`, `search`, `trending`, `articlesRising`.
338
+
339
+ ### Market Data (Pyth)
340
+
341
+ `PriceClient` wraps the Pyth-backed market-data endpoints. Crypto, FX and
342
+ commodity are fully free (price + history + list); 12 global stock markets
343
+ and the `usstock` legacy alias charge `$0.001` for price + history (list is
344
+ always free). Pass `requireWallet: false` to construct a free-only client.
345
+
346
+ ```ts
347
+ import { PriceClient } from '@blockrun/llm';
348
+
349
+ const p = new PriceClient({ requireWallet: false });
350
+ const btc = await p.price('crypto', 'BTC-USD');
351
+ const eur = await p.price('fx', 'EUR-USD');
352
+
353
+ // Paid — requires a wallet
354
+ const p2 = new PriceClient();
355
+ const aapl = await p2.price('stocks', 'AAPL', { market: 'us' });
356
+ const bars = await p2.history('stocks', 'AAPL', {
357
+ market: 'us',
358
+ resolution: 'D',
359
+ from: 1700000000,
360
+ to: 1710000000,
361
+ });
362
+ const symbols = await p.listSymbols('crypto', { query: 'sol', limit: 20 });
363
+ ```
364
+
365
+ Supported `StockMarket` values: `us, hk, jp, kr, gb, de, fr, nl, ie, lu, cn, ca`.
366
+
290
367
  ### Testnet Models (Base Sepolia)
291
368
  | Model | Price |
292
369
  |-------|-------|