@blockrun/franklin 3.49.23 → 3.49.25
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 +8 -8
- package/dist/tools/modal.d.ts +10 -1
- package/dist/tools/modal.js +35 -6
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
|
|
46
46
|
## The pitch in one paragraph
|
|
47
47
|
|
|
48
|
-
Franklin Agent is an **autonomous economic agent** — an AI that holds a USDC wallet and spends it to get real work done, with **trading as its flagship arena**. It buys live market data, proposes trade plans you approve before a cent moves, pursues long-running goals across sessions, keeps a wallet-bound trading journal, and picks the best model per task from <!-- br:models.chatVisible -->
|
|
48
|
+
Franklin Agent is an **autonomous economic agent** — an AI that holds a USDC wallet and spends it to get real work done, with **trading as its flagship arena**. It buys live market data, proposes trade plans you approve before a cent moves, pursues long-running goals across sessions, keeps a wallet-bound trading journal, and picks the best model per task from <!-- br:models.chatVisible -->91<!-- /br:models.chatVisible --> models. You state an outcome and set a budget. Franklin Agent decides what to call, what to pay for, and when to stop. No subscriptions, no seats, no rate limits.
|
|
49
49
|
|
|
50
50
|
Funding it is your choice. Fund a **USDC wallet** and every paid action routes through the [x402](https://x402.org) micropayment protocol, settling on-chain against a wallet only you control — no signup, no account, the wallet is the identity. Or top up a **prepaid balance** at [user.blockrun.ai](https://user.blockrun.ai) and hand Franklin an API key. Same models, same tools, same agent. See [Two ways to pay](#two-ways-to-pay).
|
|
51
51
|
|
|
@@ -387,7 +387,7 @@ Every tool call is itemized. Every token is priced. When the wallet hits zero, F
|
|
|
387
387
|
|
|
388
388
|
## Smart Router
|
|
389
389
|
|
|
390
|
-
**<!-- br:models.chatVisible -->
|
|
390
|
+
**<!-- br:models.chatVisible -->91<!-- /br:models.chatVisible --> models. One decision. Zero guesswork.**
|
|
391
391
|
|
|
392
392
|
You don't pick models. Franklin picks for you.
|
|
393
393
|
|
|
@@ -467,7 +467,7 @@ No email. No phone. No KYC. Your Solana, Base or Arc address is your account —
|
|
|
467
467
|
| -------------------------------------- | ---------------- | ----------------------- | -------------------- | ------------------------------- |
|
|
468
468
|
| **Spends money for you** | ❌ | ⚠️ you wire payments | ⚠️ trades only | ✅ **USDC wallet or prepaid key** |
|
|
469
469
|
| **Buys data + APIs + images + search** | ❌ | ⚠️ one key per service | ❌ | ✅ **one wallet pays for all** |
|
|
470
|
-
| Picks best model per task | ❌ single-vendor | ⚠️ you pick | ❌ | ✅ **Smart Router, <!-- br:models.chatVisible -->
|
|
470
|
+
| Picks best model per task | ❌ single-vendor | ⚠️ you pick | ❌ | ✅ **Smart Router, <!-- br:models.chatVisible -->91<!-- /br:models.chatVisible --> models** |
|
|
471
471
|
| **Money moves only on your approval** | — | ⚠️ build it yourself | ❌ runs on rules | ✅ **trade plan, every mode** |
|
|
472
472
|
| Spend guardrails | — | ⚠️ build it yourself | ⚠️ per-bot limits | ✅ **budget caps + hooks** |
|
|
473
473
|
| Works when a provider goes down | ❌ | ⚠️ if you code it | ❌ | ✅ **routes to another** |
|
|
@@ -494,14 +494,14 @@ Ask "what's BTC looking like?" — Franklin fetches live price data, computes RS
|
|
|
494
494
|
**🎨 AI image generation**
|
|
495
495
|
Ask "generate a logo" — Franklin calls DALL-E / GPT Image, saves the result locally, paid from your wallet.
|
|
496
496
|
|
|
497
|
-
**🧠 <!-- br:models.chatVisible -->
|
|
497
|
+
**🧠 <!-- br:models.chatVisible -->91<!-- /br:models.chatVisible --> models via one wallet**
|
|
498
498
|
Anthropic, OpenAI, Google, xAI, DeepSeek, GLM, Kimi, Minimax, plus a free tier. One wallet, one interface, automatic fallback.
|
|
499
499
|
|
|
500
500
|
**💳 x402 micropayments (YOPO)**
|
|
501
501
|
HTTP 402 native. Every paid action is a signed USDC micropayment — an EIP-712 authorization on Base and Arc, a signed SPL transfer on Solana. Non-custodial: your keys never leave your machine. YOPO: you pay only for outcomes.
|
|
502
502
|
|
|
503
503
|
**🧠 Learned model router**
|
|
504
|
-
Trained on 2M+ real requests. Classifies your task and picks the best model from <!-- br:models.chatVisible -->
|
|
504
|
+
Trained on 2M+ real requests. Classifies your task and picks the best model from <!-- br:models.chatVisible -->91<!-- /br:models.chatVisible --> LLMs. Four profiles (auto/eco/premium/free). Adapts to your usage over time.
|
|
505
505
|
|
|
506
506
|
</td>
|
|
507
507
|
<td width="50%" valign="top">
|
|
@@ -581,13 +581,13 @@ Found a vulnerability? Please report it privately — see [SECURITY.md](SECURITY
|
|
|
581
581
|
│ Intent → Smart Router → Tool Use → Spend Control → Result │
|
|
582
582
|
├──────────────────────────────────────────────────────────────┤
|
|
583
583
|
│ Learned Router │
|
|
584
|
-
│ 2M+ requests · <!-- br:models.chatVisible@live -->
|
|
584
|
+
│ 2M+ requests · <!-- br:models.chatVisible@live -->91<!-- /br:models.chatVisible@live --> models · category detection · Elo scores │
|
|
585
585
|
├──────────────────────────────────────────────────────────────┤
|
|
586
586
|
│ Agent Loop │
|
|
587
587
|
│ 60+ tools · Sessions · Compaction · Pricing · Plugin SDK │
|
|
588
588
|
├──────────────────────────────────────────────────────────────┤
|
|
589
589
|
│ BlockRun Gateway │
|
|
590
|
-
│ <!-- br:models.chatVisible@live -->
|
|
590
|
+
│ <!-- br:models.chatVisible@live -->91<!-- /br:models.chatVisible@live --> LLMs · CoinGecko · Search · Image APIs · paid services │
|
|
591
591
|
├──────────────────────────────────────────────────────────────┤
|
|
592
592
|
│ x402 Micropayment Protocol │
|
|
593
593
|
│ HTTP 402 · USDC on Solana, Base & Arc · signed payloads │
|
|
@@ -636,7 +636,7 @@ src/
|
|
|
636
636
|
├── stats/ Usage tracking + insights engine
|
|
637
637
|
├── ui/ Ink-based terminal UI
|
|
638
638
|
├── proxy/ Payment proxy for external tools
|
|
639
|
-
├── router/ Learned model router (<!-- br:models.chatVisible@live -->
|
|
639
|
+
├── router/ Learned model router (<!-- br:models.chatVisible@live -->91<!-- /br:models.chatVisible@live --> models, Elo scoring)
|
|
640
640
|
├── wallet/ Wallet management (Base/Arc + Solana)
|
|
641
641
|
├── mcp/ MCP server auto-discovery
|
|
642
642
|
└── commands/ CLI subcommands
|
package/dist/tools/modal.d.ts
CHANGED
|
@@ -5,7 +5,9 @@
|
|
|
5
5
|
* underlying primitives.
|
|
6
6
|
*
|
|
7
7
|
* Pricing (per-call, USDC):
|
|
8
|
-
* create: $0.01 (CPU) / $0.05 (T4) / $0.08 (L4) / $0.10 (A10G) / $0.20 (A100) / $0.40 (H100)
|
|
8
|
+
* create at up to 1 CPU and 1024 MB: $0.01 (CPU) / $0.05 (T4) / $0.08 (L4) / $0.10 (A10G) / $0.20 (A100) / $0.40 (H100)
|
|
9
|
+
* create above that: hourly rate x lifetime, never below the flat rate:
|
|
10
|
+
* $4 (T4) / $4.50 (L4) / $5 (A10G) / $7 (A100) / $9 (H100) per hour
|
|
9
11
|
* exec: $0.001
|
|
10
12
|
* status: $0.001
|
|
11
13
|
* terminate: $0.001
|
|
@@ -28,6 +30,13 @@
|
|
|
28
30
|
import type { CapabilityHandler } from '../agent/types.js';
|
|
29
31
|
import { type Chain } from '../config.js';
|
|
30
32
|
import { type ReservationToken } from '../wallet/reservation.js';
|
|
33
|
+
/**
|
|
34
|
+
* What the gateway will ask for this create. The reservation and the confirm
|
|
35
|
+
* dialog both read it, so it has to see size as well as GPU type: an 8-core T4
|
|
36
|
+
* is $0.33, not the $0.05 a tier lookup says. Lifetime is capped at 300s here,
|
|
37
|
+
* so the CPU tier is always flat.
|
|
38
|
+
*/
|
|
39
|
+
export declare function modalCreatePriceUsd(tier: string, cpu?: number, memory?: number, timeoutSeconds?: number): number;
|
|
31
40
|
export interface SandboxRecord {
|
|
32
41
|
id: string;
|
|
33
42
|
gpu: string;
|
package/dist/tools/modal.js
CHANGED
|
@@ -5,7 +5,9 @@
|
|
|
5
5
|
* underlying primitives.
|
|
6
6
|
*
|
|
7
7
|
* Pricing (per-call, USDC):
|
|
8
|
-
* create: $0.01 (CPU) / $0.05 (T4) / $0.08 (L4) / $0.10 (A10G) / $0.20 (A100) / $0.40 (H100)
|
|
8
|
+
* create at up to 1 CPU and 1024 MB: $0.01 (CPU) / $0.05 (T4) / $0.08 (L4) / $0.10 (A10G) / $0.20 (A100) / $0.40 (H100)
|
|
9
|
+
* create above that: hourly rate x lifetime, never below the flat rate:
|
|
10
|
+
* $4 (T4) / $4.50 (L4) / $5 (A10G) / $7 (A100) / $9 (H100) per hour
|
|
9
11
|
* exec: $0.001
|
|
10
12
|
* status: $0.001
|
|
11
13
|
* terminate: $0.001
|
|
@@ -41,6 +43,32 @@ const CREATE_PRICE_USD = {
|
|
|
41
43
|
A100: 0.20,
|
|
42
44
|
H100: 0.40,
|
|
43
45
|
};
|
|
46
|
+
// The gateway bills a larger sandbox by the hour for its whole lifetime. Keep in
|
|
47
|
+
// step with getModalCreatePricing in the gateway's src/lib/modal.ts.
|
|
48
|
+
const GPU_HOURLY_PRICE_USD = {
|
|
49
|
+
T4: 4.00,
|
|
50
|
+
L4: 4.50,
|
|
51
|
+
A10G: 5.00,
|
|
52
|
+
A100: 7.00,
|
|
53
|
+
H100: 9.00,
|
|
54
|
+
};
|
|
55
|
+
const FLAT_RATE_MAX_CPU = 1;
|
|
56
|
+
const FLAT_RATE_MAX_MEMORY_MB = 1024;
|
|
57
|
+
const DEFAULT_TIMEOUT_SECONDS = 300;
|
|
58
|
+
/**
|
|
59
|
+
* What the gateway will ask for this create. The reservation and the confirm
|
|
60
|
+
* dialog both read it, so it has to see size as well as GPU type: an 8-core T4
|
|
61
|
+
* is $0.33, not the $0.05 a tier lookup says. Lifetime is capped at 300s here,
|
|
62
|
+
* so the CPU tier is always flat.
|
|
63
|
+
*/
|
|
64
|
+
export function modalCreatePriceUsd(tier, cpu, memory, timeoutSeconds = DEFAULT_TIMEOUT_SECONDS) {
|
|
65
|
+
const flat = CREATE_PRICE_USD[tier];
|
|
66
|
+
const hourly = GPU_HOURLY_PRICE_USD[tier];
|
|
67
|
+
const small = (cpu ?? 1) <= FLAT_RATE_MAX_CPU && (memory ?? 512) <= FLAT_RATE_MAX_MEMORY_MB;
|
|
68
|
+
if (small || hourly === undefined)
|
|
69
|
+
return flat;
|
|
70
|
+
return Math.max(flat, hourly * (timeoutSeconds / 3600));
|
|
71
|
+
}
|
|
44
72
|
const EXEC_PRICE_USD = 0.001;
|
|
45
73
|
const STATUS_PRICE_USD = 0.001;
|
|
46
74
|
const TERMINATE_PRICE_USD = 0.001;
|
|
@@ -274,8 +302,9 @@ export const modalCreateCapability = {
|
|
|
274
302
|
spec: {
|
|
275
303
|
name: 'ModalCreate',
|
|
276
304
|
description: 'Create a Modal Python 3.11 sandbox (CPU or GPU) via the BlockRun gateway. ' +
|
|
277
|
-
'Returns a sandbox_id you pass to ModalExec. Charged once per create
|
|
278
|
-
'
|
|
305
|
+
'Returns a sandbox_id you pass to ModalExec. Charged once per create. Up to 1 CPU and ' +
|
|
306
|
+
'1024 MB: CPU $0.01, T4 $0.05, L4 $0.08, A10G $0.10, A100 $0.20, H100 $0.40. Larger GPU ' +
|
|
307
|
+
'sandboxes pay hourly for the lifetime, at least the same: T4 $4, L4 $4.50, A10G $5, A100 $7, H100 $9 per hour. ' +
|
|
279
308
|
'IMPORTANT — current limitations (BlockRun gateway is in early-access for sandboxes):\n' +
|
|
280
309
|
' - sandbox lifetime: 5 minutes MAX (gateway hard-cap, regardless of GPU tier)\n' +
|
|
281
310
|
' - per ModalExec call: 60 seconds MAX wall-clock\n' +
|
|
@@ -299,8 +328,8 @@ export const modalCreateCapability = {
|
|
|
299
328
|
properties: {
|
|
300
329
|
gpu: { type: 'string', description: 'GPU tier. One of T4, L4, A10G, A100, H100. Omit for CPU-only ($0.01).' },
|
|
301
330
|
timeout: { type: 'number', description: 'Lifetime cap in seconds. Default + Max = 300 (5 min). Gateway rejects values > 300 with HTTP 400.' },
|
|
302
|
-
cpu: { type: 'number', description: 'Number of CPU cores. Default 0.125, max 8.' },
|
|
303
|
-
memory: { type: 'number', description: 'Memory MB. Default
|
|
331
|
+
cpu: { type: 'number', description: 'Number of CPU cores. Default 1, min 0.125, max 1 for CPU sandboxes and 8 with a GPU. Above 1 bills hourly.' },
|
|
332
|
+
memory: { type: 'number', description: 'Memory MB. Default 512, max 1024 for CPU sandboxes and 32768 with a GPU. Above 1024 bills hourly.' },
|
|
304
333
|
},
|
|
305
334
|
},
|
|
306
335
|
},
|
|
@@ -326,7 +355,6 @@ export const modalCreateCapability = {
|
|
|
326
355
|
};
|
|
327
356
|
}
|
|
328
357
|
const tier = gpu ?? 'cpu';
|
|
329
|
-
const price = CREATE_PRICE_USD[tier];
|
|
330
358
|
// Coerce numeric fields. Reject NaN explicitly so we don't ship
|
|
331
359
|
// garbage to the gateway.
|
|
332
360
|
const coerceNum = (v, name) => {
|
|
@@ -359,6 +387,7 @@ export const modalCreateCapability = {
|
|
|
359
387
|
isError: true,
|
|
360
388
|
};
|
|
361
389
|
}
|
|
390
|
+
const price = modalCreatePriceUsd(tier, typeof cpuCoerced === 'number' ? cpuCoerced : undefined, typeof memoryCoerced === 'number' ? memoryCoerced : undefined, typeof timeoutCoerced === 'number' ? timeoutCoerced : undefined);
|
|
362
391
|
// ── AskUser cost preview (skipped if env auto-approve or non-UI mode) ──
|
|
363
392
|
const autoApprove = process.env.FRANKLIN_MEDIA_AUTO_APPROVE_ALL === '1';
|
|
364
393
|
if (ctx.onAskUser && !autoApprove) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blockrun/franklin",
|
|
3
|
-
"version": "3.49.
|
|
3
|
+
"version": "3.49.25",
|
|
4
4
|
"description": "Franklin Agent — The AI agent with a wallet. Spends USDC autonomously to get real work done. Pay per action, no subscriptions.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"dependencies": {
|
|
78
78
|
"@blockrun/llm": "^3.19.1",
|
|
79
79
|
"@blockrun/model-catalog": "https://codeload.github.com/BlockRunAI/model-catalog/tar.gz/aecf20b4d5ee51af4a38a69a1b9c81e3e64b955c",
|
|
80
|
-
"@blockrun/router-core": "https://codeload.github.com/BlockRunAI/router-core/tar.gz/
|
|
80
|
+
"@blockrun/router-core": "https://codeload.github.com/BlockRunAI/router-core/tar.gz/273c2af0a9abe70212efbad7117b72eb3038cffc",
|
|
81
81
|
"@colbymchenry/codegraph": "^1.5.0",
|
|
82
82
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
83
83
|
"@polymarket/builder-relayer-client": "^0.0.10",
|