@namzu/openrouter 2.4.1 → 3.0.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/CHANGELOG.md +38 -0
- package/README.md +29 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +175 -26
- package/dist/client.js.map +1 -1
- package/package.json +2 -2
- package/src/client.ts +208 -25
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,43 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 3.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- e83dfe5: `listModels()` omits `inputPrice` and `outputPrice` for a model this driver has no rate for, instead of reporting the rate as `0`.
|
|
8
|
+
|
|
9
|
+
The returned `ModelInfo[]` is the published signature that moved: both fields are optional on it now, so read them as `number | undefined`. Their runtime values changed too, and that half is not caught by a type — a key that used to be present is now absent, and code that defaulted it with `?? 0` will keep doing exactly what this release stopped doing for you.
|
|
10
|
+
|
|
11
|
+
What each driver does now:
|
|
12
|
+
|
|
13
|
+
- **`@namzu/anthropic`** — the live listing from `models.list` carries no rates, so it omits both. The bundled offline catalogue still carries its real published prices, unchanged.
|
|
14
|
+
- **`@namzu/openai`** — `client.models.list` publishes no rates, so both are omitted. `codex` likewise.
|
|
15
|
+
- **`@namzu/deepseek`** — the account listing and the bundled known-model list are unrated here, so both are omitted.
|
|
16
|
+
- **`@namzu/google`** — the two-row price table still prices `gemini-2.5-flash` and `gemini-2.5-pro`; every other model the API returns is now unpriced rather than free.
|
|
17
|
+
- **`@namzu/openrouter`** — a model whose listing carries no `pricing` block is unpriced. A model the vendor prices at `"0"` is still free and still reports `0`, which is the distinction this release is about.
|
|
18
|
+
|
|
19
|
+
An absent rate means unknown, and a consumer that shows one should say so rather than `$0.00`. `@namzu/sdk`'s `ModelInfo.inputPrice` carries the reasoning.
|
|
20
|
+
|
|
21
|
+
### Minor Changes
|
|
22
|
+
|
|
23
|
+
- e5411cc: Send and surface reasoning.
|
|
24
|
+
|
|
25
|
+
The driver now carries the SDK's thinking controls onto OpenRouter's unified `reasoning`
|
|
26
|
+
object — `thinking: { type: 'enabled', budgetTokens }` becomes `{ enabled: true, max_tokens }`,
|
|
27
|
+
`adaptive` becomes `{ enabled: true }`, `disabled` becomes `{ enabled: false }`, and `effort`
|
|
28
|
+
becomes `{ effort }` — and streams the model's thinking back on the reasoning channel
|
|
29
|
+
instead of dropping it. `effort: 'max'` and `effort: 'ultra'` are refused rather than sent:
|
|
30
|
+
this wire cannot carry those levels, and an effort that arrives as a different depth is
|
|
31
|
+
indistinguishable from one that was honoured.
|
|
32
|
+
|
|
33
|
+
What a host observes: a caller that set `thinking` or `effort` used to get
|
|
34
|
+
`OpenRouterProvider does not implement thinking`; the request is now made. Reasoning blocks
|
|
35
|
+
arrive on the assistant message for every model that returns them (verified against
|
|
36
|
+
`nvidia/nemotron-3.5-lightning:free`, which returns both `reasoning` and `reasoning_details`),
|
|
37
|
+
and `usage.reasoningTokens` reports the thinking share of the completion tokens the vendor
|
|
38
|
+
already billed. The text is emitted once, not twice: OpenRouter sends it in both fields, and
|
|
39
|
+
the indexed `reasoning_details` form is the one used.
|
|
40
|
+
|
|
3
41
|
## 2.4.1
|
|
4
42
|
|
|
5
43
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -65,6 +65,35 @@ for await (const chunk of provider.chatStream({
|
|
|
65
65
|
stream collected. In practice the kernel's run loop calls it and hands you
|
|
66
66
|
events.
|
|
67
67
|
|
|
68
|
+
## Reasoning
|
|
69
|
+
|
|
70
|
+
The driver carries the SDK's thinking controls and returns what the model thinks:
|
|
71
|
+
|
|
72
|
+
```ts
|
|
73
|
+
import { registerOpenRouter, OpenRouterProvider } from '@namzu/openrouter'
|
|
74
|
+
|
|
75
|
+
registerOpenRouter()
|
|
76
|
+
const provider = new OpenRouterProvider({ apiKey: 'sk-example' })
|
|
77
|
+
|
|
78
|
+
for await (const chunk of provider.chatStream({
|
|
79
|
+
model: 'nvidia/nemotron-3.5-lightning:free',
|
|
80
|
+
messages: [{ role: 'user', content: 'What is 17 times 3?' }],
|
|
81
|
+
thinking: { type: 'enabled', budgetTokens: 4_096 },
|
|
82
|
+
})) {
|
|
83
|
+
if (chunk.delta.reasoning?.text) process.stderr.write(chunk.delta.reasoning.text)
|
|
84
|
+
if (chunk.delta.content) process.stdout.write(chunk.delta.content)
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
`thinking: { type: 'enabled', budgetTokens }` is sent as `reasoning: { enabled: true,
|
|
89
|
+
max_tokens }`, `adaptive` as `{ enabled: true }`, `disabled` as `{ enabled: false }`, and
|
|
90
|
+
`effort` as `{ effort }`. `effort: 'max'` and `'ultra'` are refused rather than sent — this
|
|
91
|
+
wire cannot carry those levels. Reasoning arrives on the kernel's reasoning channel with an
|
|
92
|
+
index per block and a `done` marker when output starts, and `usage.reasoningTokens` reports
|
|
93
|
+
the thinking share of the completion tokens OpenRouter already bills as output. OpenRouter
|
|
94
|
+
sends each fragment twice (a flat `reasoning` string and the indexed `reasoning_details`);
|
|
95
|
+
the driver emits it once.
|
|
96
|
+
|
|
68
97
|
## Documentation
|
|
69
98
|
|
|
70
99
|
- [Namzu docs](https://github.com/cogitave/namzu/tree/main/docs)
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,oBAAoB,EACpB,WAAW,EACX,SAAS,EACT,oBAAoB,EACpB,WAAW,EAGX,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,oBAAoB,EACpB,WAAW,EACX,SAAS,EACT,oBAAoB,EACpB,WAAW,EAGX,MAAM,YAAY,CAAA;AASnB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AA4KlD;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,EAAE,oBAUrC,CAAA;AAED,qBAAa,kBAAmB,YAAW,WAAW;IACrD,QAAQ,CAAC,EAAE,gBAAe;IAC1B,QAAQ,CAAC,IAAI,gBAAe;IAC5B,QAAQ,CAAC,YAAY,uBAA0B;IAE/C,OAAO,CAAC,MAAM,CAAkB;IAChC,OAAO,CAAC,OAAO,CAAQ;gBAEX,MAAM,EAAE,gBAAgB;IAQpC,OAAO,CAAC,UAAU;IAkBlB,OAAO,CAAC,cAAc;IAwBtB,OAAO,CAAC,gBAAgB;IA4CjB,UAAU,CAAC,MAAM,EAAE,oBAAoB,GAAG,aAAa,CAAC,WAAW,CAAC;IA4K3E;;;;;;;;;;;;;OAaG;IACG,eAAe,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAgB1D;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACG,oBAAoB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAyB5F,uEAAuE;IACvE,OAAO,CAAC,cAAc,CAAC,CAAqB;IAEtC,UAAU,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IAsCtD,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;CAWrC"}
|
package/dist/client.js
CHANGED
|
@@ -1,6 +1,36 @@
|
|
|
1
|
-
import { ProviderRequestError,
|
|
1
|
+
import { ProviderRequestError, isCallerAbortError, isProviderRequestError, providerHttpError, providerVendorError, } from '@namzu/sdk';
|
|
2
2
|
import { attributionHeaders } from '@namzu/sdk';
|
|
3
3
|
const OPENROUTER_BASE_URL = process.env.OPENROUTER_BASE_URL ?? 'https://openrouter.ai/api/v1';
|
|
4
|
+
/**
|
|
5
|
+
* A rate OpenRouter published for a model, or nothing.
|
|
6
|
+
*
|
|
7
|
+
* This listing is the one place both answers arrive on the same field and
|
|
8
|
+
* only one of them used to survive. OpenRouter states each rate as a decimal
|
|
9
|
+
* string of USD per token and states `"0"` for the models it serves at no
|
|
10
|
+
* charge — so `?? '0'` did not default a missing price, it asserted one: every
|
|
11
|
+
* model whose pricing block was absent was reported as free, which is a claim
|
|
12
|
+
* about a bill. Absence now stays absent, a published `"0"` is still a real
|
|
13
|
+
* zero, and a value that does not parse is treated as absence rather than
|
|
14
|
+
* `NaN` — which would reach a consumer as a total nobody can read.
|
|
15
|
+
*
|
|
16
|
+
* See `ModelInfo.inputPrice`.
|
|
17
|
+
*/
|
|
18
|
+
function pricePerMillion(raw) {
|
|
19
|
+
if (raw === undefined)
|
|
20
|
+
return undefined;
|
|
21
|
+
const parsed = Number.parseFloat(raw);
|
|
22
|
+
return Number.isFinite(parsed) ? parsed * 1_000_000 : undefined;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* The reasoning breakdown, when the vendor reports one.
|
|
26
|
+
*
|
|
27
|
+
* `completion_tokens` already includes these — OpenRouter bills thinking as
|
|
28
|
+
* output — so this is a SUBSET, never an addition. It is reported rather than
|
|
29
|
+
* dropped because it is the only measure of how much of a turn was spent
|
|
30
|
+
* thinking, which is what a reader of `/cost` is looking at when a reasoning
|
|
31
|
+
* model looks expensive. Absent stays absent: a vendor that does not report
|
|
32
|
+
* the split has not reported zero.
|
|
33
|
+
*/
|
|
4
34
|
function parseUsage(raw) {
|
|
5
35
|
if (!raw) {
|
|
6
36
|
return {
|
|
@@ -11,12 +41,87 @@ function parseUsage(raw) {
|
|
|
11
41
|
cacheWriteTokens: 0,
|
|
12
42
|
};
|
|
13
43
|
}
|
|
44
|
+
const reasoningTokens = raw.completion_tokens_details?.reasoning_tokens;
|
|
14
45
|
return {
|
|
15
46
|
promptTokens: raw.prompt_tokens,
|
|
16
47
|
completionTokens: raw.completion_tokens,
|
|
17
48
|
totalTokens: raw.total_tokens,
|
|
18
49
|
cachedTokens: raw.prompt_tokens_details?.cached_tokens ?? raw.cache_read_input_tokens ?? 0,
|
|
19
50
|
cacheWriteTokens: raw.cache_creation_input_tokens ?? 0,
|
|
51
|
+
...(reasoningTokens !== undefined ? { reasoningTokens } : {}),
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Map one frame's reasoning onto the kernel's channel.
|
|
56
|
+
*
|
|
57
|
+
* The wire sends the same text twice: a flat `delta.reasoning` string AND a
|
|
58
|
+
* `delta.reasoning_details` array. Emitting both would double every block, so
|
|
59
|
+
* the array wins whenever it is present — it is the one that carries the index
|
|
60
|
+
* and the signature — and the flat string is the fallback for a vendor that
|
|
61
|
+
* sends only that.
|
|
62
|
+
*
|
|
63
|
+
* An empty array means the frame carried no reasoning at all; it is not a
|
|
64
|
+
* statement that the flat field should be trusted.
|
|
65
|
+
*/
|
|
66
|
+
function parseReasoning(details, flat) {
|
|
67
|
+
if (details && details.length > 0) {
|
|
68
|
+
const mapped = [];
|
|
69
|
+
for (const [position, detail] of details.entries()) {
|
|
70
|
+
const index = typeof detail.index === 'number' ? detail.index : position;
|
|
71
|
+
if (detail.type === 'reasoning.encrypted') {
|
|
72
|
+
if (detail.data)
|
|
73
|
+
mapped.push({ index, type: 'redacted_thinking', encrypted: detail.data });
|
|
74
|
+
continue;
|
|
75
|
+
}
|
|
76
|
+
if (typeof detail.text !== 'string' || detail.text.length === 0)
|
|
77
|
+
continue;
|
|
78
|
+
mapped.push({
|
|
79
|
+
index,
|
|
80
|
+
type: 'thinking',
|
|
81
|
+
text: detail.text,
|
|
82
|
+
...(detail.signature ? { signature: detail.signature } : {}),
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
return mapped;
|
|
86
|
+
}
|
|
87
|
+
return typeof flat === 'string' && flat.length > 0
|
|
88
|
+
? [{ index: 0, type: 'thinking', text: flat }]
|
|
89
|
+
: [];
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* The effort levels this wire can carry.
|
|
93
|
+
*
|
|
94
|
+
* OpenRouter's unified `reasoning.effort` publishes exactly these. The SDK's
|
|
95
|
+
* `max` and `ultra` are OpenAI-model-specific names with no equivalent here,
|
|
96
|
+
* and a driver must not send one and hope: an effort that arrives as a
|
|
97
|
+
* different depth is indistinguishable from one that was honoured.
|
|
98
|
+
*/
|
|
99
|
+
const OPENROUTER_REASONING_EFFORT = ['none', 'minimal', 'low', 'medium', 'high', 'xhigh'];
|
|
100
|
+
/**
|
|
101
|
+
* Map the SDK's thinking controls onto OpenRouter's unified `reasoning` object.
|
|
102
|
+
*
|
|
103
|
+
* `undefined` means "say nothing", which leaves the vendor's own default in
|
|
104
|
+
* place — the only correct answer for a driver that was asked for nothing.
|
|
105
|
+
*/
|
|
106
|
+
function formatReasoning(thinking, effort) {
|
|
107
|
+
if (effort !== undefined) {
|
|
108
|
+
const carried = OPENROUTER_REASONING_EFFORT.includes(effort);
|
|
109
|
+
if (!carried) {
|
|
110
|
+
throw new Error(`OpenRouterProvider cannot carry effort "${effort}". Its reasoning.effort accepts ${OPENROUTER_REASONING_EFFORT.join(', ')}. Sending a different level would return a perfectly ordinary completion that no caller could tell apart from the one that was asked for.`);
|
|
111
|
+
}
|
|
112
|
+
return { effort };
|
|
113
|
+
}
|
|
114
|
+
if (!thinking || thinking.type === undefined)
|
|
115
|
+
return undefined;
|
|
116
|
+
if (thinking.type === 'disabled')
|
|
117
|
+
return { enabled: false };
|
|
118
|
+
// 'adaptive' has no separate spelling on this wire: the model decides its
|
|
119
|
+
// own depth, which is what `enabled: true` without a budget expresses.
|
|
120
|
+
// 'enabled' fixes the depth with budgetTokens, so it carries the cap.
|
|
121
|
+
const budgetTokens = thinking.type === 'enabled' ? thinking.budgetTokens : undefined;
|
|
122
|
+
return {
|
|
123
|
+
enabled: true,
|
|
124
|
+
...(budgetTokens !== undefined ? { max_tokens: budgetTokens } : {}),
|
|
20
125
|
};
|
|
21
126
|
}
|
|
22
127
|
function formatToolChoice(tc) {
|
|
@@ -128,13 +233,18 @@ export class OpenRouterProvider {
|
|
|
128
233
|
if (params.cacheControl) {
|
|
129
234
|
body.cache_control = params.cacheControl;
|
|
130
235
|
}
|
|
236
|
+
// Refused, not dropped, when this wire cannot carry the level asked
|
|
237
|
+
// for — see `formatReasoning`.
|
|
238
|
+
const reasoning = formatReasoning(params.thinking, params.effort);
|
|
239
|
+
if (reasoning !== undefined) {
|
|
240
|
+
body.reasoning = reasoning;
|
|
241
|
+
}
|
|
131
242
|
if (params.responseFormat) {
|
|
132
243
|
body.response_format = params.responseFormat;
|
|
133
244
|
}
|
|
134
245
|
return body;
|
|
135
246
|
}
|
|
136
247
|
async *chatStream(params) {
|
|
137
|
-
assertThinkingUnsupported('OpenRouterProvider', params);
|
|
138
248
|
const body = this.buildRequestBody(params, true);
|
|
139
249
|
const timeout = AbortSignal.timeout(this.config.timeout ?? 120_000);
|
|
140
250
|
// Compose the caller abort with the request timeout so a Stop cancels the
|
|
@@ -180,6 +290,9 @@ export class OpenRouterProvider {
|
|
|
180
290
|
const reader = response.body.getReader();
|
|
181
291
|
const decoder = new TextDecoder();
|
|
182
292
|
let buffer = '';
|
|
293
|
+
// Reasoning blocks this stream has opened and not yet closed, in the
|
|
294
|
+
// order the wire reported them.
|
|
295
|
+
const openReasoning = new Set();
|
|
183
296
|
try {
|
|
184
297
|
while (true) {
|
|
185
298
|
params.signal?.throwIfAborted();
|
|
@@ -207,20 +320,52 @@ export class OpenRouterProvider {
|
|
|
207
320
|
const choice = parsed.choices[0];
|
|
208
321
|
if (!choice)
|
|
209
322
|
continue;
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
323
|
+
const fragments = parseReasoning(choice.delta.reasoning_details, choice.delta.reasoning);
|
|
324
|
+
const content = choice.delta.content;
|
|
325
|
+
const toolCalls = choice.delta.tool_calls?.map((tc) => ({
|
|
326
|
+
index: tc.index,
|
|
327
|
+
id: tc.id,
|
|
328
|
+
type: tc.type,
|
|
329
|
+
function: tc.function,
|
|
330
|
+
}));
|
|
331
|
+
// A block closes when output starts, which is the only boundary
|
|
332
|
+
// this wire gives: without it a consumer's reasoning pane never
|
|
333
|
+
// receives `done` and stays open for the life of the run. An
|
|
334
|
+
// empty `content` is NOT output — every reasoning frame on this
|
|
335
|
+
// wire carries `"content":""`, so treating it as the boundary
|
|
336
|
+
// would close each block on the frame that opened it.
|
|
337
|
+
if ((typeof content === 'string' && content.length > 0) || toolCalls?.length) {
|
|
338
|
+
for (const index of openReasoning) {
|
|
339
|
+
yield { id: parsed.id, delta: { reasoning: { index, done: true } } };
|
|
340
|
+
}
|
|
341
|
+
openReasoning.clear();
|
|
342
|
+
}
|
|
343
|
+
const [firstFragment, ...restFragments] = fragments;
|
|
344
|
+
if (firstFragment)
|
|
345
|
+
openReasoning.add(firstFragment.index);
|
|
346
|
+
if (firstFragment ||
|
|
347
|
+
content !== undefined ||
|
|
348
|
+
toolCalls !== undefined ||
|
|
349
|
+
choice.finish_reason !== undefined ||
|
|
350
|
+
parsed.usage !== undefined) {
|
|
351
|
+
yield {
|
|
352
|
+
id: parsed.id,
|
|
353
|
+
delta: {
|
|
354
|
+
...(firstFragment ? { reasoning: firstFragment } : {}),
|
|
355
|
+
content,
|
|
356
|
+
toolCalls,
|
|
357
|
+
},
|
|
358
|
+
finishReason: choice.finish_reason,
|
|
359
|
+
usage: parsed.usage ? parseUsage(parsed.usage) : undefined,
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
// The delta shape carries one reasoning object per chunk, so a
|
|
363
|
+
// frame reporting several blocks rides in sequence rather than
|
|
364
|
+
// being collapsed into one — order is what replay echoes back.
|
|
365
|
+
for (const fragment of restFragments) {
|
|
366
|
+
openReasoning.add(fragment.index);
|
|
367
|
+
yield { id: parsed.id, delta: { reasoning: fragment } };
|
|
368
|
+
}
|
|
224
369
|
}
|
|
225
370
|
catch (parseErr) {
|
|
226
371
|
if (isProviderRequestError(parseErr))
|
|
@@ -332,16 +477,20 @@ export class OpenRouterProvider {
|
|
|
332
477
|
}
|
|
333
478
|
const data = (await response.json());
|
|
334
479
|
signal?.throwIfAborted();
|
|
335
|
-
return data.data.map((m) =>
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
480
|
+
return data.data.map((m) => {
|
|
481
|
+
const inputPrice = pricePerMillion(m.pricing?.prompt);
|
|
482
|
+
const outputPrice = pricePerMillion(m.pricing?.completion);
|
|
483
|
+
return {
|
|
484
|
+
id: m.id,
|
|
485
|
+
name: m.name,
|
|
486
|
+
contextWindow: m.context_length,
|
|
487
|
+
maxOutputTokens: m.top_provider?.max_completion_tokens ?? 4096,
|
|
488
|
+
...(inputPrice !== undefined ? { inputPrice } : {}),
|
|
489
|
+
...(outputPrice !== undefined ? { outputPrice } : {}),
|
|
490
|
+
supportsToolUse: true,
|
|
491
|
+
supportsStreaming: true,
|
|
492
|
+
};
|
|
493
|
+
});
|
|
345
494
|
}
|
|
346
495
|
async healthCheck() {
|
|
347
496
|
try {
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AASA,OAAO,EACN,oBAAoB,EACpB,yBAAyB,EACzB,kBAAkB,EAClB,sBAAsB,EACtB,iBAAiB,EACjB,mBAAmB,GACnB,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAG/C,MAAM,mBAAmB,GAAG,OAAO,CAAC,GAAG,CAAC,mBAAmB,IAAI,8BAA8B,CAAA;AAc7F,SAAS,UAAU,CAAC,GAAc;IACjC,IAAI,CAAC,GAAG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for @namzu/sdk. Access to 200+ models (Claude, GPT-4, Llama, Mixtral) via OpenRouter's unified API.",
|
|
5
5
|
"license": "FSL-1.1-MIT",
|
|
6
6
|
"engines": {
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"@types/node": "^22.19.17",
|
|
56
56
|
"typescript": "^5.5.0",
|
|
57
57
|
"vitest": "^4.1.11",
|
|
58
|
-
"@namzu/sdk": "^
|
|
58
|
+
"@namzu/sdk": "^43.0.0"
|
|
59
59
|
},
|
|
60
60
|
"scripts": {
|
|
61
61
|
"build": "tsc --build",
|
package/src/client.ts
CHANGED
|
@@ -9,7 +9,6 @@ import type {
|
|
|
9
9
|
} from '@namzu/sdk'
|
|
10
10
|
import {
|
|
11
11
|
ProviderRequestError,
|
|
12
|
-
assertThinkingUnsupported,
|
|
13
12
|
isCallerAbortError,
|
|
14
13
|
isProviderRequestError,
|
|
15
14
|
providerHttpError,
|
|
@@ -20,6 +19,26 @@ import type { OpenRouterConfig } from './types.js'
|
|
|
20
19
|
|
|
21
20
|
const OPENROUTER_BASE_URL = process.env.OPENROUTER_BASE_URL ?? 'https://openrouter.ai/api/v1'
|
|
22
21
|
|
|
22
|
+
/**
|
|
23
|
+
* A rate OpenRouter published for a model, or nothing.
|
|
24
|
+
*
|
|
25
|
+
* This listing is the one place both answers arrive on the same field and
|
|
26
|
+
* only one of them used to survive. OpenRouter states each rate as a decimal
|
|
27
|
+
* string of USD per token and states `"0"` for the models it serves at no
|
|
28
|
+
* charge — so `?? '0'` did not default a missing price, it asserted one: every
|
|
29
|
+
* model whose pricing block was absent was reported as free, which is a claim
|
|
30
|
+
* about a bill. Absence now stays absent, a published `"0"` is still a real
|
|
31
|
+
* zero, and a value that does not parse is treated as absence rather than
|
|
32
|
+
* `NaN` — which would reach a consumer as a total nobody can read.
|
|
33
|
+
*
|
|
34
|
+
* See `ModelInfo.inputPrice`.
|
|
35
|
+
*/
|
|
36
|
+
function pricePerMillion(raw: string | undefined): number | undefined {
|
|
37
|
+
if (raw === undefined) return undefined
|
|
38
|
+
const parsed = Number.parseFloat(raw)
|
|
39
|
+
return Number.isFinite(parsed) ? parsed * 1_000_000 : undefined
|
|
40
|
+
}
|
|
41
|
+
|
|
23
42
|
interface RawUsage {
|
|
24
43
|
prompt_tokens: number
|
|
25
44
|
completion_tokens: number
|
|
@@ -27,11 +46,24 @@ interface RawUsage {
|
|
|
27
46
|
prompt_tokens_details?: {
|
|
28
47
|
cached_tokens?: number
|
|
29
48
|
}
|
|
49
|
+
completion_tokens_details?: {
|
|
50
|
+
reasoning_tokens?: number
|
|
51
|
+
}
|
|
30
52
|
cache_discount?: number
|
|
31
53
|
cache_read_input_tokens?: number
|
|
32
54
|
cache_creation_input_tokens?: number
|
|
33
55
|
}
|
|
34
56
|
|
|
57
|
+
/**
|
|
58
|
+
* The reasoning breakdown, when the vendor reports one.
|
|
59
|
+
*
|
|
60
|
+
* `completion_tokens` already includes these — OpenRouter bills thinking as
|
|
61
|
+
* output — so this is a SUBSET, never an addition. It is reported rather than
|
|
62
|
+
* dropped because it is the only measure of how much of a turn was spent
|
|
63
|
+
* thinking, which is what a reader of `/cost` is looking at when a reasoning
|
|
64
|
+
* model looks expensive. Absent stays absent: a vendor that does not report
|
|
65
|
+
* the split has not reported zero.
|
|
66
|
+
*/
|
|
35
67
|
function parseUsage(raw?: RawUsage): TokenUsage {
|
|
36
68
|
if (!raw) {
|
|
37
69
|
return {
|
|
@@ -42,12 +74,111 @@ function parseUsage(raw?: RawUsage): TokenUsage {
|
|
|
42
74
|
cacheWriteTokens: 0,
|
|
43
75
|
}
|
|
44
76
|
}
|
|
77
|
+
const reasoningTokens = raw.completion_tokens_details?.reasoning_tokens
|
|
45
78
|
return {
|
|
46
79
|
promptTokens: raw.prompt_tokens,
|
|
47
80
|
completionTokens: raw.completion_tokens,
|
|
48
81
|
totalTokens: raw.total_tokens,
|
|
49
82
|
cachedTokens: raw.prompt_tokens_details?.cached_tokens ?? raw.cache_read_input_tokens ?? 0,
|
|
50
83
|
cacheWriteTokens: raw.cache_creation_input_tokens ?? 0,
|
|
84
|
+
...(reasoningTokens !== undefined ? { reasoningTokens } : {}),
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* One entry of OpenRouter's unified `reasoning_details`.
|
|
90
|
+
*
|
|
91
|
+
* `reasoning.text` and `reasoning.summary` carry visible text; the encrypted
|
|
92
|
+
* form carries an opaque payload this driver must pass through unchanged, or
|
|
93
|
+
* a replaying caller loses the block it paid for.
|
|
94
|
+
*/
|
|
95
|
+
interface RawReasoningDetail {
|
|
96
|
+
type?: string
|
|
97
|
+
text?: string
|
|
98
|
+
signature?: string
|
|
99
|
+
data?: string
|
|
100
|
+
index?: number
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
type ReasoningDelta = NonNullable<StreamChunk['delta']['reasoning']>
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Map one frame's reasoning onto the kernel's channel.
|
|
107
|
+
*
|
|
108
|
+
* The wire sends the same text twice: a flat `delta.reasoning` string AND a
|
|
109
|
+
* `delta.reasoning_details` array. Emitting both would double every block, so
|
|
110
|
+
* the array wins whenever it is present — it is the one that carries the index
|
|
111
|
+
* and the signature — and the flat string is the fallback for a vendor that
|
|
112
|
+
* sends only that.
|
|
113
|
+
*
|
|
114
|
+
* An empty array means the frame carried no reasoning at all; it is not a
|
|
115
|
+
* statement that the flat field should be trusted.
|
|
116
|
+
*/
|
|
117
|
+
function parseReasoning(
|
|
118
|
+
details: readonly RawReasoningDetail[] | undefined,
|
|
119
|
+
flat: string | null | undefined,
|
|
120
|
+
): ReasoningDelta[] {
|
|
121
|
+
if (details && details.length > 0) {
|
|
122
|
+
const mapped: ReasoningDelta[] = []
|
|
123
|
+
for (const [position, detail] of details.entries()) {
|
|
124
|
+
const index = typeof detail.index === 'number' ? detail.index : position
|
|
125
|
+
if (detail.type === 'reasoning.encrypted') {
|
|
126
|
+
if (detail.data) mapped.push({ index, type: 'redacted_thinking', encrypted: detail.data })
|
|
127
|
+
continue
|
|
128
|
+
}
|
|
129
|
+
if (typeof detail.text !== 'string' || detail.text.length === 0) continue
|
|
130
|
+
mapped.push({
|
|
131
|
+
index,
|
|
132
|
+
type: 'thinking',
|
|
133
|
+
text: detail.text,
|
|
134
|
+
...(detail.signature ? { signature: detail.signature } : {}),
|
|
135
|
+
})
|
|
136
|
+
}
|
|
137
|
+
return mapped
|
|
138
|
+
}
|
|
139
|
+
return typeof flat === 'string' && flat.length > 0
|
|
140
|
+
? [{ index: 0, type: 'thinking', text: flat }]
|
|
141
|
+
: []
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* The effort levels this wire can carry.
|
|
146
|
+
*
|
|
147
|
+
* OpenRouter's unified `reasoning.effort` publishes exactly these. The SDK's
|
|
148
|
+
* `max` and `ultra` are OpenAI-model-specific names with no equivalent here,
|
|
149
|
+
* and a driver must not send one and hope: an effort that arrives as a
|
|
150
|
+
* different depth is indistinguishable from one that was honoured.
|
|
151
|
+
*/
|
|
152
|
+
const OPENROUTER_REASONING_EFFORT = ['none', 'minimal', 'low', 'medium', 'high', 'xhigh'] as const
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Map the SDK's thinking controls onto OpenRouter's unified `reasoning` object.
|
|
156
|
+
*
|
|
157
|
+
* `undefined` means "say nothing", which leaves the vendor's own default in
|
|
158
|
+
* place — the only correct answer for a driver that was asked for nothing.
|
|
159
|
+
*/
|
|
160
|
+
function formatReasoning(
|
|
161
|
+
thinking: ChatCompletionParams['thinking'],
|
|
162
|
+
effort: ChatCompletionParams['effort'],
|
|
163
|
+
): Record<string, unknown> | undefined {
|
|
164
|
+
if (effort !== undefined) {
|
|
165
|
+
const carried = (OPENROUTER_REASONING_EFFORT as readonly string[]).includes(effort)
|
|
166
|
+
if (!carried) {
|
|
167
|
+
throw new Error(
|
|
168
|
+
`OpenRouterProvider cannot carry effort "${effort}". Its reasoning.effort accepts ${OPENROUTER_REASONING_EFFORT.join(', ')}. Sending a different level would return a perfectly ordinary completion that no caller could tell apart from the one that was asked for.`,
|
|
169
|
+
)
|
|
170
|
+
}
|
|
171
|
+
return { effort }
|
|
172
|
+
}
|
|
173
|
+
if (!thinking || thinking.type === undefined) return undefined
|
|
174
|
+
if (thinking.type === 'disabled') return { enabled: false }
|
|
175
|
+
// 'adaptive' has no separate spelling on this wire: the model decides its
|
|
176
|
+
// own depth, which is what `enabled: true` without a budget expresses.
|
|
177
|
+
// 'enabled' fixes the depth with budgetTokens, so it carries the cap.
|
|
178
|
+
const budgetTokens = thinking.type === 'enabled' ? thinking.budgetTokens : undefined
|
|
179
|
+
return {
|
|
180
|
+
enabled: true,
|
|
181
|
+
...(budgetTokens !== undefined ? { max_tokens: budgetTokens } : {}),
|
|
51
182
|
}
|
|
52
183
|
}
|
|
53
184
|
|
|
@@ -162,6 +293,13 @@ export class OpenRouterProvider implements LLMProvider {
|
|
|
162
293
|
body.cache_control = params.cacheControl
|
|
163
294
|
}
|
|
164
295
|
|
|
296
|
+
// Refused, not dropped, when this wire cannot carry the level asked
|
|
297
|
+
// for — see `formatReasoning`.
|
|
298
|
+
const reasoning = formatReasoning(params.thinking, params.effort)
|
|
299
|
+
if (reasoning !== undefined) {
|
|
300
|
+
body.reasoning = reasoning
|
|
301
|
+
}
|
|
302
|
+
|
|
165
303
|
if (params.responseFormat) {
|
|
166
304
|
body.response_format = params.responseFormat
|
|
167
305
|
}
|
|
@@ -170,7 +308,6 @@ export class OpenRouterProvider implements LLMProvider {
|
|
|
170
308
|
}
|
|
171
309
|
|
|
172
310
|
async *chatStream(params: ChatCompletionParams): AsyncIterable<StreamChunk> {
|
|
173
|
-
assertThinkingUnsupported('OpenRouterProvider', params)
|
|
174
311
|
const body = this.buildRequestBody(params, true)
|
|
175
312
|
|
|
176
313
|
const timeout = AbortSignal.timeout(this.config.timeout ?? 120_000)
|
|
@@ -219,6 +356,9 @@ export class OpenRouterProvider implements LLMProvider {
|
|
|
219
356
|
const reader = response.body.getReader()
|
|
220
357
|
const decoder = new TextDecoder()
|
|
221
358
|
let buffer = ''
|
|
359
|
+
// Reasoning blocks this stream has opened and not yet closed, in the
|
|
360
|
+
// order the wire reported them.
|
|
361
|
+
const openReasoning = new Set<number>()
|
|
222
362
|
|
|
223
363
|
try {
|
|
224
364
|
while (true) {
|
|
@@ -243,6 +383,8 @@ export class OpenRouterProvider implements LLMProvider {
|
|
|
243
383
|
choices: Array<{
|
|
244
384
|
delta: {
|
|
245
385
|
content?: string
|
|
386
|
+
reasoning?: string | null
|
|
387
|
+
reasoning_details?: RawReasoningDetail[]
|
|
246
388
|
tool_calls?: Array<{
|
|
247
389
|
index: number
|
|
248
390
|
id?: string
|
|
@@ -265,19 +407,56 @@ export class OpenRouterProvider implements LLMProvider {
|
|
|
265
407
|
const choice = parsed.choices[0]
|
|
266
408
|
if (!choice) continue
|
|
267
409
|
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
410
|
+
const fragments = parseReasoning(choice.delta.reasoning_details, choice.delta.reasoning)
|
|
411
|
+
const content = choice.delta.content
|
|
412
|
+
const toolCalls = choice.delta.tool_calls?.map((tc) => ({
|
|
413
|
+
index: tc.index,
|
|
414
|
+
id: tc.id,
|
|
415
|
+
type: tc.type as 'function' | undefined,
|
|
416
|
+
function: tc.function,
|
|
417
|
+
}))
|
|
418
|
+
|
|
419
|
+
// A block closes when output starts, which is the only boundary
|
|
420
|
+
// this wire gives: without it a consumer's reasoning pane never
|
|
421
|
+
// receives `done` and stays open for the life of the run. An
|
|
422
|
+
// empty `content` is NOT output — every reasoning frame on this
|
|
423
|
+
// wire carries `"content":""`, so treating it as the boundary
|
|
424
|
+
// would close each block on the frame that opened it.
|
|
425
|
+
if ((typeof content === 'string' && content.length > 0) || toolCalls?.length) {
|
|
426
|
+
for (const index of openReasoning) {
|
|
427
|
+
yield { id: parsed.id, delta: { reasoning: { index, done: true } } }
|
|
428
|
+
}
|
|
429
|
+
openReasoning.clear()
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
const [firstFragment, ...restFragments] = fragments
|
|
433
|
+
if (firstFragment) openReasoning.add(firstFragment.index)
|
|
434
|
+
|
|
435
|
+
if (
|
|
436
|
+
firstFragment ||
|
|
437
|
+
content !== undefined ||
|
|
438
|
+
toolCalls !== undefined ||
|
|
439
|
+
choice.finish_reason !== undefined ||
|
|
440
|
+
parsed.usage !== undefined
|
|
441
|
+
) {
|
|
442
|
+
yield {
|
|
443
|
+
id: parsed.id,
|
|
444
|
+
delta: {
|
|
445
|
+
...(firstFragment ? { reasoning: firstFragment } : {}),
|
|
446
|
+
content,
|
|
447
|
+
toolCalls,
|
|
448
|
+
},
|
|
449
|
+
finishReason: choice.finish_reason as StreamChunk['finishReason'],
|
|
450
|
+
usage: parsed.usage ? parseUsage(parsed.usage) : undefined,
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
// The delta shape carries one reasoning object per chunk, so a
|
|
455
|
+
// frame reporting several blocks rides in sequence rather than
|
|
456
|
+
// being collapsed into one — order is what replay echoes back.
|
|
457
|
+
for (const fragment of restFragments) {
|
|
458
|
+
openReasoning.add(fragment.index)
|
|
459
|
+
yield { id: parsed.id, delta: { reasoning: fragment } }
|
|
281
460
|
}
|
|
282
461
|
} catch (parseErr) {
|
|
283
462
|
if (isProviderRequestError(parseErr)) throw parseErr
|
|
@@ -403,16 +582,20 @@ export class OpenRouterProvider implements LLMProvider {
|
|
|
403
582
|
}
|
|
404
583
|
signal?.throwIfAborted()
|
|
405
584
|
|
|
406
|
-
return data.data.map((m) =>
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
585
|
+
return data.data.map((m) => {
|
|
586
|
+
const inputPrice = pricePerMillion(m.pricing?.prompt)
|
|
587
|
+
const outputPrice = pricePerMillion(m.pricing?.completion)
|
|
588
|
+
return {
|
|
589
|
+
id: m.id,
|
|
590
|
+
name: m.name,
|
|
591
|
+
contextWindow: m.context_length,
|
|
592
|
+
maxOutputTokens: m.top_provider?.max_completion_tokens ?? 4096,
|
|
593
|
+
...(inputPrice !== undefined ? { inputPrice } : {}),
|
|
594
|
+
...(outputPrice !== undefined ? { outputPrice } : {}),
|
|
595
|
+
supportsToolUse: true,
|
|
596
|
+
supportsStreaming: true,
|
|
597
|
+
}
|
|
598
|
+
})
|
|
416
599
|
}
|
|
417
600
|
|
|
418
601
|
async healthCheck(): Promise<boolean> {
|