@blockrun/llm 0.2.0 → 0.3.0
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 +87 -1
- package/dist/{chunk-4LEERQOK.js → chunk-S7BEMV6T.js} +1534 -1008
- package/dist/{esm-W3HWUFAT.js → esm-EBZAIN5N.js} +121 -121
- package/dist/index.cjs +41 -6
- package/dist/index.d.cts +97 -8
- package/dist/index.d.ts +97 -8
- package/dist/{index.esm-DGL5QIKD.js → index.esm-WP2DIBSK.js} +1 -1
- package/dist/index.js +39 -5
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -2,7 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Pay-per-request access to GPT-4o, Claude 4, Gemini 2.5, and more via x402 micropayments on Base and Solana.
|
|
4
4
|
|
|
5
|
-
**Networks:**
|
|
5
|
+
**Networks:**
|
|
6
|
+
- **Base Mainnet:** Chain ID 8453 - Production with real USDC
|
|
7
|
+
- **Base Sepolia (Testnet):** Chain ID 84532 - Developer testing with testnet USDC
|
|
8
|
+
- **Solana Mainnet** - Production with real USDC
|
|
9
|
+
|
|
6
10
|
**Payment:** USDC
|
|
7
11
|
**Protocol:** x402 v2 (CDP Facilitator)
|
|
8
12
|
|
|
@@ -94,6 +98,37 @@ For Solana, set `BLOCKRUN_SOLANA_KEY` environment variable with your base58-enco
|
|
|
94
98
|
| `google/gemini-2.5-pro` | $1.25/M | $10.00/M |
|
|
95
99
|
| `google/gemini-2.5-flash` | $0.15/M | $0.60/M |
|
|
96
100
|
|
|
101
|
+
### DeepSeek
|
|
102
|
+
| Model | Input Price | Output Price |
|
|
103
|
+
|-------|-------------|--------------|
|
|
104
|
+
| `deepseek/deepseek-chat` | $0.28/M | $0.42/M |
|
|
105
|
+
| `deepseek/deepseek-reasoner` | $0.28/M | $0.42/M |
|
|
106
|
+
|
|
107
|
+
### xAI Grok
|
|
108
|
+
| Model | Input Price | Output Price |
|
|
109
|
+
|-------|-------------|--------------|
|
|
110
|
+
| `xai/grok-3` | $3.00/M | $15.00/M |
|
|
111
|
+
| `xai/grok-3-fast` | $5.00/M | $25.00/M |
|
|
112
|
+
| `xai/grok-3-mini` | $0.30/M | $0.50/M |
|
|
113
|
+
|
|
114
|
+
### Moonshot Kimi
|
|
115
|
+
| Model | Input Price | Output Price |
|
|
116
|
+
|-------|-------------|--------------|
|
|
117
|
+
| `moonshot/kimi-k2.5` | $0.60/M | $3.00/M |
|
|
118
|
+
|
|
119
|
+
### E2E Verified Models
|
|
120
|
+
|
|
121
|
+
All models below have been tested end-to-end via the TypeScript SDK (Feb 2026):
|
|
122
|
+
|
|
123
|
+
| Provider | Model | Status |
|
|
124
|
+
|----------|-------|--------|
|
|
125
|
+
| OpenAI | `openai/gpt-4o-mini` | Passed |
|
|
126
|
+
| Anthropic | `anthropic/claude-sonnet-4` | Passed |
|
|
127
|
+
| Google | `google/gemini-2.5-flash` | Passed |
|
|
128
|
+
| DeepSeek | `deepseek/deepseek-chat` | Passed |
|
|
129
|
+
| xAI | `xai/grok-3-fast` | Passed |
|
|
130
|
+
| Moonshot | `moonshot/kimi-k2.5` | Passed |
|
|
131
|
+
|
|
97
132
|
### Image Generation
|
|
98
133
|
| Model | Price |
|
|
99
134
|
|-------|-------|
|
|
@@ -103,6 +138,56 @@ For Solana, set `BLOCKRUN_SOLANA_KEY` environment variable with your base58-enco
|
|
|
103
138
|
| `google/nano-banana-pro` | $0.10-0.15/image |
|
|
104
139
|
| `black-forest/flux-1.1-pro` | $0.04/image |
|
|
105
140
|
|
|
141
|
+
### Testnet Models (Base Sepolia)
|
|
142
|
+
| Model | Price |
|
|
143
|
+
|-------|-------|
|
|
144
|
+
| `openai/gpt-oss-20b` | $0.001/request |
|
|
145
|
+
| `openai/gpt-oss-120b` | $0.002/request |
|
|
146
|
+
|
|
147
|
+
*Testnet models use flat pricing (no token counting) for simplicity.*
|
|
148
|
+
|
|
149
|
+
## Testnet Usage
|
|
150
|
+
|
|
151
|
+
For development and testing without real USDC, use the testnet:
|
|
152
|
+
|
|
153
|
+
```typescript
|
|
154
|
+
import { testnetClient } from '@blockrun/llm';
|
|
155
|
+
|
|
156
|
+
// Create testnet client (uses Base Sepolia)
|
|
157
|
+
const client = testnetClient({ privateKey: '0x...' });
|
|
158
|
+
|
|
159
|
+
// Chat with testnet model
|
|
160
|
+
const response = await client.chat('openai/gpt-oss-20b', 'Hello!');
|
|
161
|
+
console.log(response);
|
|
162
|
+
|
|
163
|
+
// Check if client is on testnet
|
|
164
|
+
console.log(client.isTestnet()); // true
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
### Testnet Setup
|
|
168
|
+
|
|
169
|
+
1. Get testnet ETH from [Alchemy Base Sepolia Faucet](https://www.alchemy.com/faucets/base-sepolia)
|
|
170
|
+
2. Get testnet USDC from [Circle USDC Faucet](https://faucet.circle.com/)
|
|
171
|
+
3. Set your wallet key: `export BASE_CHAIN_WALLET_KEY=0x...`
|
|
172
|
+
|
|
173
|
+
### Available Testnet Models
|
|
174
|
+
|
|
175
|
+
- `openai/gpt-oss-20b` - $0.001/request (flat price)
|
|
176
|
+
- `openai/gpt-oss-120b` - $0.002/request (flat price)
|
|
177
|
+
|
|
178
|
+
### Manual Testnet Configuration
|
|
179
|
+
|
|
180
|
+
```typescript
|
|
181
|
+
import { LLMClient } from '@blockrun/llm';
|
|
182
|
+
|
|
183
|
+
// Or configure manually
|
|
184
|
+
const client = new LLMClient({
|
|
185
|
+
privateKey: '0x...',
|
|
186
|
+
apiUrl: 'https://testnet.blockrun.ai/api'
|
|
187
|
+
});
|
|
188
|
+
const response = await client.chat('openai/gpt-oss-20b', 'Hello!');
|
|
189
|
+
```
|
|
190
|
+
|
|
106
191
|
## Usage Examples
|
|
107
192
|
|
|
108
193
|
### Simple Chat
|
|
@@ -299,6 +384,7 @@ Full TypeScript support with exported types:
|
|
|
299
384
|
```typescript
|
|
300
385
|
import {
|
|
301
386
|
LLMClient,
|
|
387
|
+
testnetClient,
|
|
302
388
|
type ChatMessage,
|
|
303
389
|
type ChatResponse,
|
|
304
390
|
type ChatOptions,
|