@namzu/bedrock 4.0.1 → 5.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 +69 -0
- package/dist/client.d.ts +75 -3
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +216 -27
- package/dist/client.js.map +1 -1
- package/dist/health.d.ts +77 -0
- package/dist/health.d.ts.map +1 -0
- package/dist/health.js +131 -0
- package/dist/health.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/client.ts +238 -32
- package/src/health.ts +194 -0
- package/src/index.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,74 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 5.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- 1033de9: Prompt caching is now requested, not only documented
|
|
8
|
+
|
|
9
|
+
The provider page said caching was requested when the caller set `cacheControl`, with breakpoints after the tool schemas, after the static system text, and after the last message. None of it was true. This wire enables caching with an explicit `cachePoint` block inside the request, and the driver emitted none — while mapping `cacheReadInputTokenCount` and `cacheWriteInputTokenCount` correctly, so the usage came back a truthful zero and a caller could not tell "caching does not help this workload" from "caching was never asked for". Prompt caching is the largest single cost lever on a long run, and this one was off with the switch documented as on.
|
|
10
|
+
|
|
11
|
+
The driver now emits the three cache points the page describes: after the last tool schema, after the last system message tagged `cacheHint: 'cache'`, and after the last content block of the last message. The system point is placed after the _static_ block rather than at the end of the array — a marker after the per-run dynamic text would cache a prefix that changes every run, so every read would miss and every write would be billed.
|
|
12
|
+
|
|
13
|
+
**Why this is major even though no exported type changed.** Your requests change shape without you changing a line. The runtime sets `cacheControl` on every iteration, so any caller on a model Anthropic serves through Converse starts sending cache points as soon as they take this version. Expect cache-write tokens on the first turn of a stable prefix — they are priced above ordinary input — and cache reads, priced below it, on the turns after. The steady state is cheaper; the first turn is not. There is no per-driver switch to decline: a request without `cacheControl` is uncached, and the runtime supplies it, so declining means not taking this version.
|
|
14
|
+
|
|
15
|
+
**Only for the models Anthropic serves on this wire.** Converse carries several vendors and prompt caching is a property of the models on it, not of the wire, so a cache point sent to a model that does not accept one is rejected outright — the whole request, not the caching. The gate reuses `isAnthropicServedModel`, which this driver already uses to pick a tool-schema dialect for the same reason. A model outside the gate sends exactly the bytes it sends today and `cacheControl` has no effect on it; the provider page now says so.
|
|
16
|
+
|
|
17
|
+
Two documentation claims on the same page were also false and are corrected: the capability snapshot reported `supportsVision: true` where the package exports `false`, and the paragraph beside it described images travelling as raw bytes. This driver maps no image content at all — a user attachment does not reach the model, and an image in a tool result becomes a named placeholder.
|
|
18
|
+
|
|
19
|
+
### Minor Changes
|
|
20
|
+
|
|
21
|
+
- 1f8aef7: the bedrock health check can pass, and says which failure it saw
|
|
22
|
+
|
|
23
|
+
`healthCheck()` hardcoded `anthropic.claude-haiku-4-20250514` — the exact
|
|
24
|
+
unversioned form this driver's own `assertModelReachable` refuses. It built its
|
|
25
|
+
command directly, so the predicate never ran locally: the service rejected the
|
|
26
|
+
id, and `catch { return false }` reported that rejection as an outage. The check
|
|
27
|
+
returned `false` with correct credentials, a correct region and a service that
|
|
28
|
+
was entirely up, and nothing could tell that apart from a real failure.
|
|
29
|
+
|
|
30
|
+
**What you do.** Pass the model you run:
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
const healthy = await provider.healthCheck(
|
|
34
|
+
"anthropic.claude-sonnet-4-20250514-v1:0"
|
|
35
|
+
);
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
`healthCheck()` still returns `Promise<boolean>` and still takes no required
|
|
39
|
+
argument, so nothing stops compiling. Called with no model it now returns
|
|
40
|
+
`false` without a network call, because this driver's config holds no model and
|
|
41
|
+
there is nothing to probe — the same value it returned before, and it could not
|
|
42
|
+
return any other one.
|
|
43
|
+
|
|
44
|
+
When the answer matters, call `doctorCheck(model)`. It returns the same probe
|
|
45
|
+
with its reasoning intact: `status` (`pass` / `fail` / `warn` / `inconclusive` /
|
|
46
|
+
`skipped`) plus a machine-readable `reason` separating a rejected credential
|
|
47
|
+
from a model this region does not serve, from a request the service refused,
|
|
48
|
+
from a throttle, from a timeout that established nothing. The return type of
|
|
49
|
+
`healthCheck` was deliberately NOT widened: every caller writing
|
|
50
|
+
`if (await provider.healthCheck())` would keep compiling and start always
|
|
51
|
+
passing against a truthy result object.
|
|
52
|
+
|
|
53
|
+
The probe now sends `ConverseStream` — the operation `chatStream` sends — so it
|
|
54
|
+
exercises `bedrock:InvokeModelWithResponseStream` rather than a permission your
|
|
55
|
+
real calls never use, and it reads the failures Bedrock reports as stream events
|
|
56
|
+
after a 200 rather than treating the handshake as the answer.
|
|
57
|
+
|
|
58
|
+
**`listModels()` model ids changed.** It advertised
|
|
59
|
+
`anthropic.claude-sonnet-4-20250514` and `anthropic.claude-haiku-4-20250514`;
|
|
60
|
+
both are ids the request path rejects, so an operator who picked either off the
|
|
61
|
+
menu got a throw before any call was made. They are now
|
|
62
|
+
`anthropic.claude-sonnet-4-20250514-v1:0` and
|
|
63
|
+
`anthropic.claude-haiku-4-5-20251001-v1:0`, which are the `bedrock-runtime`
|
|
64
|
+
Model IDs on the vendor's own model cards. There was never a "Claude Haiku 4".
|
|
65
|
+
If you copied an id out of this catalogue, it did not work; take the versioned
|
|
66
|
+
one, or the inference-profile form (`us.`, `eu.`, `apac.`, `jp.`, `global.`) for
|
|
67
|
+
a model served cross-region.
|
|
68
|
+
|
|
69
|
+
`BedrockHealthReason` and `BedrockHealthReport` are exported from the package
|
|
70
|
+
root.
|
|
71
|
+
|
|
3
72
|
## 4.0.1
|
|
4
73
|
|
|
5
74
|
### Patch Changes
|
package/dist/client.d.ts
CHANGED
|
@@ -1,8 +1,19 @@
|
|
|
1
|
-
import type { Message as BedrockMessage, ToolConfiguration } from '@aws-sdk/client-bedrock-runtime';
|
|
1
|
+
import type { Message as BedrockMessage, ConverseStreamOutput, ToolConfiguration } from '@aws-sdk/client-bedrock-runtime';
|
|
2
2
|
import type { ChatCompletionParams, LLMProvider, ModelInfo, ProviderCapabilities, StreamChunk, TokenUsage } from '@namzu/sdk';
|
|
3
|
+
import type { BedrockHealthReport } from './health.js';
|
|
3
4
|
import type { BedrockConfig } from './types.js';
|
|
4
5
|
export declare function toBedrockMessages(messages: ChatCompletionParams['messages']): BedrockMessage[];
|
|
5
|
-
export declare function toBedrockToolConfig(params: ChatCompletionParams): ToolConfiguration | undefined;
|
|
6
|
+
export declare function toBedrockToolConfig(params: ChatCompletionParams, cachingEnabled?: boolean): ToolConfiguration | undefined;
|
|
7
|
+
/**
|
|
8
|
+
* The failure Bedrock reported as a stream EVENT rather than as a throw.
|
|
9
|
+
*
|
|
10
|
+
* Several post-handshake failures arrive as members of the output union, after
|
|
11
|
+
* a 200. Ignoring them makes a throttled or failed stream look like a clean
|
|
12
|
+
* EOF — which is why this is read on the request path, and why the health probe
|
|
13
|
+
* reads it through the same function rather than through a second copy that
|
|
14
|
+
* could drift from this one.
|
|
15
|
+
*/
|
|
16
|
+
export declare function streamFailureIn(event: ConverseStreamOutput): unknown;
|
|
6
17
|
interface RawBedrockUsage {
|
|
7
18
|
inputTokens?: number;
|
|
8
19
|
outputTokens?: number;
|
|
@@ -26,8 +37,69 @@ export declare class BedrockProvider implements LLMProvider {
|
|
|
26
37
|
private config;
|
|
27
38
|
constructor(config: BedrockConfig);
|
|
28
39
|
chatStream(params: ChatCompletionParams): AsyncIterable<StreamChunk>;
|
|
40
|
+
/**
|
|
41
|
+
* The menu this driver offers.
|
|
42
|
+
*
|
|
43
|
+
* Every Claude id here is the `bedrock-runtime` Model ID from the vendor's
|
|
44
|
+
* own model card, and that is a correction rather than a preference: the
|
|
45
|
+
* two entries this list used to carry — `anthropic.claude-sonnet-4-20250514`
|
|
46
|
+
* and `anthropic.claude-haiku-4-20250514` — are ids `assertModelReachable`
|
|
47
|
+
* refuses, so an operator picking either off the menu got a throw before any
|
|
48
|
+
* request was built. A catalogue its own request path rejects is worse than
|
|
49
|
+
* a short one.
|
|
50
|
+
*
|
|
51
|
+
* The card for Claude Haiku 4.5 is what settles that the predicate is right
|
|
52
|
+
* rather than too strict. It lists the SAME model under two ids on two
|
|
53
|
+
* endpoints: `anthropic.claude-haiku-4-5-20251001-v1:0` on
|
|
54
|
+
* `bedrock-runtime`, and the unversioned `anthropic.claude-haiku-4-5` on
|
|
55
|
+
* `bedrock-mantle`, at a different URL. The bare form is a real id for the
|
|
56
|
+
* endpoint this driver does not speak — which is exactly the claim
|
|
57
|
+
* `model-reachability.ts` makes, stated by the vendor in one table.
|
|
58
|
+
*
|
|
59
|
+
* "Claude Haiku 4" was never a model. The Haiku line goes 3.5 to 4.5, and
|
|
60
|
+
* the id that shipped here carried Sonnet 4's launch date.
|
|
61
|
+
*
|
|
62
|
+
* `inputPrice`/`outputPrice` are per million tokens and are DISPLAY data:
|
|
63
|
+
* `resolveModelPricing` in `@namzu/sdk` has no `bedrock` vendor, so no run
|
|
64
|
+
* is costed from them. The Haiku 4.5 rates are the reviewed ones from that
|
|
65
|
+
* package's own `rates.source.json`. AWS publishes Bedrock's on-demand rates
|
|
66
|
+
* on a page that renders them client-side, so they could not be read here,
|
|
67
|
+
* and if Bedrock diverges from the vendor's list price this row is wrong in
|
|
68
|
+
* that direction only.
|
|
69
|
+
*/
|
|
29
70
|
listModels(): Promise<ModelInfo[]>;
|
|
30
|
-
|
|
71
|
+
/**
|
|
72
|
+
* Can this driver serve `model` right now?
|
|
73
|
+
*
|
|
74
|
+
* One bit, and deliberately still one bit. Widening the return type would
|
|
75
|
+
* break every caller that writes `if (await provider.healthCheck())`
|
|
76
|
+
* SILENTLY — the code keeps compiling and starts always passing, because a
|
|
77
|
+
* result object is truthy. {@link doctorCheck} is the same probe with its
|
|
78
|
+
* reasoning intact, and is what to call when the answer matters.
|
|
79
|
+
*
|
|
80
|
+
* `model` is required in practice though the type says optional: this
|
|
81
|
+
* driver's config holds no model, so with nothing passed there is nothing to
|
|
82
|
+
* probe, and the answer is `false` for the stated reason `no-model` rather
|
|
83
|
+
* than for a guessed one. It used to probe a hardcoded id instead, which is
|
|
84
|
+
* how it came to send an id its own reachability rule rejects and report the
|
|
85
|
+
* refusal as an outage.
|
|
86
|
+
*/
|
|
87
|
+
healthCheck(model?: string): Promise<boolean>;
|
|
88
|
+
/**
|
|
89
|
+
* The health probe, with the reason it reached its verdict.
|
|
90
|
+
*
|
|
91
|
+
* Probes with `ConverseStream` rather than `Converse` because that is the
|
|
92
|
+
* command {@link chatStream} sends. They are separate IAM actions —
|
|
93
|
+
* `bedrock:InvokeModelWithResponseStream` and `bedrock:InvokeModel` — so a
|
|
94
|
+
* probe on the other one can pass under a policy every real call fails
|
|
95
|
+
* under, which is a green check about a request nobody makes.
|
|
96
|
+
*
|
|
97
|
+
* It costs one inference of one token. Nothing cheaper on the runtime client
|
|
98
|
+
* establishes credentials, region and model reachability together, and the
|
|
99
|
+
* alternatives establish them for a permission the request path does not
|
|
100
|
+
* use.
|
|
101
|
+
*/
|
|
102
|
+
doctorCheck(model?: string): Promise<BedrockHealthReport>;
|
|
31
103
|
}
|
|
32
104
|
export {};
|
|
33
105
|
//# sourceMappingURL=client.d.ts.map
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACX,OAAO,IAAI,cAAc,EAKzB,oBAAoB,EAGpB,iBAAiB,EAEjB,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EACX,oBAAoB,EAEpB,WAAW,EACX,SAAS,EACT,oBAAoB,EACpB,WAAW,EACX,UAAU,EAEV,MAAM,YAAY,CAAA;AASnB,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA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C,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;CAsD/D"}
|
package/dist/client.js
CHANGED
|
@@ -1,11 +1,67 @@
|
|
|
1
|
-
import { BedrockRuntimeClient,
|
|
1
|
+
import { BedrockRuntimeClient, ConverseStreamCommand } from '@aws-sdk/client-bedrock-runtime';
|
|
2
2
|
import { assertThinkingUnsupported, toSchemaDialect, toolResultToText } from '@namzu/sdk';
|
|
3
3
|
import { ProviderRequestError, isCallerAbortError, isProviderRequestError, providerVendorError, } from '@namzu/sdk';
|
|
4
|
+
import { report, reportForError } from './health.js';
|
|
4
5
|
import { assertModelReachable, isAnthropicServedModel } from './model-reachability.js';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
/**
|
|
7
|
+
* The marker that asks this wire to cache everything before it.
|
|
8
|
+
*
|
|
9
|
+
* Caching is not a flag on the request here — it is a block spliced into
|
|
10
|
+
* the content, and a request without one is uncached however the caller
|
|
11
|
+
* configured it. That is why nothing was cached before: the driver read
|
|
12
|
+
* the cache counters faithfully and never emitted a marker, so the
|
|
13
|
+
* counters were honestly zero and a caller could not tell "caching does
|
|
14
|
+
* not help this workload" from "caching was never asked for".
|
|
15
|
+
*
|
|
16
|
+
* `default` is the only member of the wire's cache-point enum. `ttl` is
|
|
17
|
+
* deliberately not set: omitting it takes the service's own default,
|
|
18
|
+
* and an extended TTL is priced differently, so choosing one is a cost
|
|
19
|
+
* decision rather than a translation.
|
|
20
|
+
*/
|
|
21
|
+
const CACHE_POINT = { cachePoint: { type: 'default' } };
|
|
22
|
+
/**
|
|
23
|
+
* System text, with a cache point after the last STATIC block.
|
|
24
|
+
*
|
|
25
|
+
* Position is the whole point, not presence. The runtime tags its static
|
|
26
|
+
* segment `'cache'` and its per-run dynamic segment `'ephemeral'`, and a
|
|
27
|
+
* marker appended at the end of the array would put the dynamic text
|
|
28
|
+
* inside the cached prefix — which changes every run, so every read would
|
|
29
|
+
* miss and every write would be paid for. A caller would see cache writes
|
|
30
|
+
* and no reads, which looks like a cold cache forever.
|
|
31
|
+
*
|
|
32
|
+
* No static block means no system breakpoint, rather than a breakpoint in
|
|
33
|
+
* an arbitrary place.
|
|
34
|
+
*/
|
|
35
|
+
function extractSystemBlocks(messages, cachingEnabled = false) {
|
|
36
|
+
const blocks = [];
|
|
37
|
+
let lastStatic = -1;
|
|
38
|
+
for (const m of messages) {
|
|
39
|
+
if (m.role !== 'system')
|
|
40
|
+
continue;
|
|
41
|
+
blocks.push({ text: typeof m.content === 'string' ? m.content : '' });
|
|
42
|
+
if (m.cacheHint === 'cache')
|
|
43
|
+
lastStatic = blocks.length - 1;
|
|
44
|
+
}
|
|
45
|
+
if (cachingEnabled && lastStatic >= 0)
|
|
46
|
+
blocks.splice(lastStatic + 1, 0, CACHE_POINT);
|
|
47
|
+
return blocks;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* The final cache point: after the last content block of the last
|
|
51
|
+
* non-empty message.
|
|
52
|
+
*
|
|
53
|
+
* An iteration only appends messages, so caching the whole conversation
|
|
54
|
+
* prefix here is what makes the NEXT turn read its history at cache rates
|
|
55
|
+
* — which on a long run is the largest single cost lever available.
|
|
56
|
+
*/
|
|
57
|
+
function applyMessageCachePoint(messages) {
|
|
58
|
+
for (let i = messages.length - 1; i >= 0; i--) {
|
|
59
|
+
const content = messages[i]?.content;
|
|
60
|
+
if (content && content.length > 0) {
|
|
61
|
+
content.push(CACHE_POINT);
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
9
65
|
}
|
|
10
66
|
function toBedrockRole(role) {
|
|
11
67
|
return role === 'assistant' ? 'assistant' : 'user';
|
|
@@ -91,7 +147,7 @@ function extractToolNamesFromHistory(messages) {
|
|
|
91
147
|
}
|
|
92
148
|
return Array.from(names);
|
|
93
149
|
}
|
|
94
|
-
export function toBedrockToolConfig(params) {
|
|
150
|
+
export function toBedrockToolConfig(params, cachingEnabled = false) {
|
|
95
151
|
// 'none' means the model must not call a tool. This used to map to the
|
|
96
152
|
// wire's 'auto', which means it MAY — the opposite, and silent. No wire
|
|
97
153
|
// format lets a model call a tool it was never given, so send none.
|
|
@@ -114,6 +170,16 @@ export function toBedrockToolConfig(params) {
|
|
|
114
170
|
},
|
|
115
171
|
},
|
|
116
172
|
}));
|
|
173
|
+
// After the schemas, so the tool block — the largest fixed prefix on
|
|
174
|
+
// a tool-using run, and the one that changes least — is cached.
|
|
175
|
+
//
|
|
176
|
+
// The reconstruction path below deliberately does not get one. Those
|
|
177
|
+
// are placeholder specs minted to keep the wire happy when history
|
|
178
|
+
// references a tool the caller no longer passes; their descriptions
|
|
179
|
+
// are the literal string `(completed)`, so caching them would pin a
|
|
180
|
+
// prefix that is not the caller's tool set.
|
|
181
|
+
if (cachingEnabled)
|
|
182
|
+
tools.push(CACHE_POINT);
|
|
117
183
|
const toolChoice = formatToolChoice(params.toolChoice);
|
|
118
184
|
return { tools, toolChoice };
|
|
119
185
|
}
|
|
@@ -143,6 +209,22 @@ function formatToolChoice(tc) {
|
|
|
143
209
|
}
|
|
144
210
|
return { auto: {} };
|
|
145
211
|
}
|
|
212
|
+
/**
|
|
213
|
+
* The failure Bedrock reported as a stream EVENT rather than as a throw.
|
|
214
|
+
*
|
|
215
|
+
* Several post-handshake failures arrive as members of the output union, after
|
|
216
|
+
* a 200. Ignoring them makes a throttled or failed stream look like a clean
|
|
217
|
+
* EOF — which is why this is read on the request path, and why the health probe
|
|
218
|
+
* reads it through the same function rather than through a second copy that
|
|
219
|
+
* could drift from this one.
|
|
220
|
+
*/
|
|
221
|
+
export function streamFailureIn(event) {
|
|
222
|
+
return (('internalServerException' in event ? event.internalServerException : undefined) ??
|
|
223
|
+
('modelStreamErrorException' in event ? event.modelStreamErrorException : undefined) ??
|
|
224
|
+
('validationException' in event ? event.validationException : undefined) ??
|
|
225
|
+
('throttlingException' in event ? event.throttlingException : undefined) ??
|
|
226
|
+
('serviceUnavailableException' in event ? event.serviceUnavailableException : undefined));
|
|
227
|
+
}
|
|
146
228
|
export function parseBedrockUsage(raw) {
|
|
147
229
|
if (!raw) {
|
|
148
230
|
return {
|
|
@@ -219,9 +301,25 @@ export class BedrockProvider {
|
|
|
219
301
|
// reason and the fix, rather than as an opaque validation error from
|
|
220
302
|
// a service that was asked for something this wire does not carry.
|
|
221
303
|
assertModelReachable(params.model);
|
|
222
|
-
|
|
304
|
+
// The runtime asks for caching on every iteration by setting
|
|
305
|
+
// `cacheControl`. Honouring it costs three cache points — tools tail,
|
|
306
|
+
// static-system tail, last message — and the prompt is assembled
|
|
307
|
+
// tools → system → messages, so each later point also covers every
|
|
308
|
+
// section before it.
|
|
309
|
+
//
|
|
310
|
+
// Gated on the model family for the reason `isAnthropicServedModel`
|
|
311
|
+
// already exists: Converse is a multi-vendor wire, and prompt caching
|
|
312
|
+
// is a property of the models on it rather than of the wire. The gate
|
|
313
|
+
// fails toward today's behaviour — a model outside it sends exactly
|
|
314
|
+
// the bytes it sends now, uncached — because the alternative failure
|
|
315
|
+
// is a rejected request, which costs a caller a working integration
|
|
316
|
+
// rather than a discount they never had.
|
|
317
|
+
const cachingEnabled = params.cacheControl !== undefined && isAnthropicServedModel(params.model);
|
|
318
|
+
const system = extractSystemBlocks(params.messages, cachingEnabled);
|
|
223
319
|
const messages = toBedrockMessages(params.messages);
|
|
224
|
-
|
|
320
|
+
if (cachingEnabled)
|
|
321
|
+
applyMessageCachePoint(messages);
|
|
322
|
+
const toolConfig = toBedrockToolConfig(params, cachingEnabled);
|
|
225
323
|
const inferenceConfig = {};
|
|
226
324
|
if (params.maxTokens !== undefined)
|
|
227
325
|
inferenceConfig.maxTokens = params.maxTokens;
|
|
@@ -275,11 +373,7 @@ export class BedrockProvider {
|
|
|
275
373
|
// Bedrock reports several post-handshake failures as UNION
|
|
276
374
|
// EVENTS, not thrown exceptions. Ignoring these members makes a
|
|
277
375
|
// throttled or failed stream look like a clean EOF.
|
|
278
|
-
const streamFailure = (
|
|
279
|
-
('modelStreamErrorException' in event ? event.modelStreamErrorException : undefined) ??
|
|
280
|
-
('validationException' in event ? event.validationException : undefined) ??
|
|
281
|
-
('throttlingException' in event ? event.throttlingException : undefined) ??
|
|
282
|
-
('serviceUnavailableException' in event ? event.serviceUnavailableException : undefined);
|
|
376
|
+
const streamFailure = streamFailureIn(event);
|
|
283
377
|
if (streamFailure) {
|
|
284
378
|
throw providerVendorError({
|
|
285
379
|
providerId: 'bedrock',
|
|
@@ -376,10 +470,40 @@ export class BedrockProvider {
|
|
|
376
470
|
throw providerVendorError({ providerId: 'bedrock', error: err });
|
|
377
471
|
}
|
|
378
472
|
}
|
|
473
|
+
/**
|
|
474
|
+
* The menu this driver offers.
|
|
475
|
+
*
|
|
476
|
+
* Every Claude id here is the `bedrock-runtime` Model ID from the vendor's
|
|
477
|
+
* own model card, and that is a correction rather than a preference: the
|
|
478
|
+
* two entries this list used to carry — `anthropic.claude-sonnet-4-20250514`
|
|
479
|
+
* and `anthropic.claude-haiku-4-20250514` — are ids `assertModelReachable`
|
|
480
|
+
* refuses, so an operator picking either off the menu got a throw before any
|
|
481
|
+
* request was built. A catalogue its own request path rejects is worse than
|
|
482
|
+
* a short one.
|
|
483
|
+
*
|
|
484
|
+
* The card for Claude Haiku 4.5 is what settles that the predicate is right
|
|
485
|
+
* rather than too strict. It lists the SAME model under two ids on two
|
|
486
|
+
* endpoints: `anthropic.claude-haiku-4-5-20251001-v1:0` on
|
|
487
|
+
* `bedrock-runtime`, and the unversioned `anthropic.claude-haiku-4-5` on
|
|
488
|
+
* `bedrock-mantle`, at a different URL. The bare form is a real id for the
|
|
489
|
+
* endpoint this driver does not speak — which is exactly the claim
|
|
490
|
+
* `model-reachability.ts` makes, stated by the vendor in one table.
|
|
491
|
+
*
|
|
492
|
+
* "Claude Haiku 4" was never a model. The Haiku line goes 3.5 to 4.5, and
|
|
493
|
+
* the id that shipped here carried Sonnet 4's launch date.
|
|
494
|
+
*
|
|
495
|
+
* `inputPrice`/`outputPrice` are per million tokens and are DISPLAY data:
|
|
496
|
+
* `resolveModelPricing` in `@namzu/sdk` has no `bedrock` vendor, so no run
|
|
497
|
+
* is costed from them. The Haiku 4.5 rates are the reviewed ones from that
|
|
498
|
+
* package's own `rates.source.json`. AWS publishes Bedrock's on-demand rates
|
|
499
|
+
* on a page that renders them client-side, so they could not be read here,
|
|
500
|
+
* and if Bedrock diverges from the vendor's list price this row is wrong in
|
|
501
|
+
* that direction only.
|
|
502
|
+
*/
|
|
379
503
|
async listModels() {
|
|
380
504
|
return [
|
|
381
505
|
{
|
|
382
|
-
id: 'anthropic.claude-sonnet-4-20250514',
|
|
506
|
+
id: 'anthropic.claude-sonnet-4-20250514-v1:0',
|
|
383
507
|
name: 'Claude Sonnet 4 (Bedrock)',
|
|
384
508
|
contextWindow: 200_000,
|
|
385
509
|
maxOutputTokens: 64_000,
|
|
@@ -389,12 +513,12 @@ export class BedrockProvider {
|
|
|
389
513
|
supportsStreaming: true,
|
|
390
514
|
},
|
|
391
515
|
{
|
|
392
|
-
id: 'anthropic.claude-haiku-4-
|
|
393
|
-
name: 'Claude Haiku 4 (Bedrock)',
|
|
516
|
+
id: 'anthropic.claude-haiku-4-5-20251001-v1:0',
|
|
517
|
+
name: 'Claude Haiku 4.5 (Bedrock)',
|
|
394
518
|
contextWindow: 200_000,
|
|
395
519
|
maxOutputTokens: 64_000,
|
|
396
|
-
inputPrice: 0
|
|
397
|
-
outputPrice:
|
|
520
|
+
inputPrice: 1.0,
|
|
521
|
+
outputPrice: 5.0,
|
|
398
522
|
supportsToolUse: true,
|
|
399
523
|
supportsStreaming: true,
|
|
400
524
|
},
|
|
@@ -410,20 +534,85 @@ export class BedrockProvider {
|
|
|
410
534
|
},
|
|
411
535
|
];
|
|
412
536
|
}
|
|
413
|
-
|
|
537
|
+
/**
|
|
538
|
+
* Can this driver serve `model` right now?
|
|
539
|
+
*
|
|
540
|
+
* One bit, and deliberately still one bit. Widening the return type would
|
|
541
|
+
* break every caller that writes `if (await provider.healthCheck())`
|
|
542
|
+
* SILENTLY — the code keeps compiling and starts always passing, because a
|
|
543
|
+
* result object is truthy. {@link doctorCheck} is the same probe with its
|
|
544
|
+
* reasoning intact, and is what to call when the answer matters.
|
|
545
|
+
*
|
|
546
|
+
* `model` is required in practice though the type says optional: this
|
|
547
|
+
* driver's config holds no model, so with nothing passed there is nothing to
|
|
548
|
+
* probe, and the answer is `false` for the stated reason `no-model` rather
|
|
549
|
+
* than for a guessed one. It used to probe a hardcoded id instead, which is
|
|
550
|
+
* how it came to send an id its own reachability rule rejects and report the
|
|
551
|
+
* refusal as an outage.
|
|
552
|
+
*/
|
|
553
|
+
async healthCheck(model) {
|
|
554
|
+
return (await this.doctorCheck(model)).status === 'pass';
|
|
555
|
+
}
|
|
556
|
+
/**
|
|
557
|
+
* The health probe, with the reason it reached its verdict.
|
|
558
|
+
*
|
|
559
|
+
* Probes with `ConverseStream` rather than `Converse` because that is the
|
|
560
|
+
* command {@link chatStream} sends. They are separate IAM actions —
|
|
561
|
+
* `bedrock:InvokeModelWithResponseStream` and `bedrock:InvokeModel` — so a
|
|
562
|
+
* probe on the other one can pass under a policy every real call fails
|
|
563
|
+
* under, which is a green check about a request nobody makes.
|
|
564
|
+
*
|
|
565
|
+
* It costs one inference of one token. Nothing cheaper on the runtime client
|
|
566
|
+
* establishes credentials, region and model reachability together, and the
|
|
567
|
+
* alternatives establish them for a permission the request path does not
|
|
568
|
+
* use.
|
|
569
|
+
*/
|
|
570
|
+
async doctorCheck(model) {
|
|
571
|
+
if (model === undefined || model.trim() === '') {
|
|
572
|
+
return report('no-model', 'No model id was given and this driver holds none in its config, so nothing was probed. This is not a report that Bedrock is unhealthy.');
|
|
573
|
+
}
|
|
574
|
+
const startedAt = Date.now();
|
|
575
|
+
const elapsed = () => Date.now() - startedAt;
|
|
576
|
+
// The same rule the request path applies, applied here. Skipping it is
|
|
577
|
+
// how the previous check came to send an id this driver classifies as
|
|
578
|
+
// uninvokable and then read the service's refusal as an outage.
|
|
579
|
+
try {
|
|
580
|
+
assertModelReachable(model);
|
|
581
|
+
}
|
|
582
|
+
catch (err) {
|
|
583
|
+
return report('unreachable-model', err instanceof Error ? err.message : String(err), {
|
|
584
|
+
model,
|
|
585
|
+
durationMs: elapsed(),
|
|
586
|
+
});
|
|
587
|
+
}
|
|
414
588
|
try {
|
|
415
|
-
const command = new
|
|
416
|
-
modelId:
|
|
589
|
+
const command = new ConverseStreamCommand({
|
|
590
|
+
modelId: model,
|
|
417
591
|
messages: [{ role: 'user', content: [{ text: 'hi' }] }],
|
|
418
592
|
inferenceConfig: { maxTokens: 1 },
|
|
419
593
|
});
|
|
420
|
-
const response = await this.client.send(command, {
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
594
|
+
const response = await this.client.send(command, { requestTimeout: 5000 });
|
|
595
|
+
// No branch on the status code: this SDK throws for a non-2xx, so a
|
|
596
|
+
// handshake that returns at all returned success. A branch production
|
|
597
|
+
// cannot enter is one only a fixture unlike production could test.
|
|
598
|
+
if (!response.stream) {
|
|
599
|
+
return report('service', 'bedrock accepted the request and returned no stream body', {
|
|
600
|
+
model,
|
|
601
|
+
durationMs: elapsed(),
|
|
602
|
+
});
|
|
603
|
+
}
|
|
604
|
+
// The handshake is a 200 even when the model then refuses, because
|
|
605
|
+
// Bedrock reports those failures as members of the output union.
|
|
606
|
+
// Reading only the status would call that a pass.
|
|
607
|
+
for await (const event of response.stream) {
|
|
608
|
+
const failure = streamFailureIn(event);
|
|
609
|
+
if (failure)
|
|
610
|
+
return reportForError(failure, model, elapsed());
|
|
611
|
+
}
|
|
612
|
+
return report('ok', `bedrock served ${model}`, { model, durationMs: elapsed() });
|
|
424
613
|
}
|
|
425
|
-
catch {
|
|
426
|
-
return
|
|
614
|
+
catch (err) {
|
|
615
|
+
return reportForError(err, model, elapsed());
|
|
427
616
|
}
|
|
428
617
|
}
|
|
429
618
|
}
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sour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C,IAAI,CAAC,OAAO,EAAE,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC,CAAA;YAE1E,oEAAoE;YACpE,sEAAsE;YACtE,mEAAmE;YACnE,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;gBACtB,OAAO,MAAM,CAAC,SAAS,EAAE,0DAA0D,EAAE;oBACpF,KAAK;oBACL,UAAU,EAAE,OAAO,EAAE;iBACrB,CAAC,CAAA;YACH,CAAC;YAED,mEAAmE;YACnE,iEAAiE;YACjE,kDAAkD;YAClD,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,QAAQ,CAAC,MAA6C,EAAE,CAAC;gBAClF,MAAM,OAAO,GAAG,eAAe,CAAC,KAAK,CAAC,CAAA;gBACtC,IAAI,OAAO;oBAAE,OAAO,cAAc,CAAC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAA;YAC9D,CAAC;YAED,OAAO,MAAM,CAAC,IAAI,EAAE,kBAAkB,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE,CAAC,CAAA;QACjF,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACd,OAAO,cAAc,CAAC,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAA;QAC7C,CAAC;IACF,CAAC;CACD"}
|
package/dist/health.d.ts
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a health probe against this wire concluded, and why.
|
|
3
|
+
*
|
|
4
|
+
* `healthCheck` used to answer with one bit produced by `catch { return false }`.
|
|
5
|
+
* The three failures a caller actually needs apart — the credential is wrong,
|
|
6
|
+
* the service is down, that model is not invokable here — all arrived as
|
|
7
|
+
* `false`, and so did success, because the id it probed was one the driver's
|
|
8
|
+
* own `assertModelReachable` classifies as unreachable. A check that cannot
|
|
9
|
+
* pass is the same defect class as a check that cannot fail: neither carries
|
|
10
|
+
* information, and this one carried none in a shape that looked like an outage.
|
|
11
|
+
*
|
|
12
|
+
* So the reason is a value rather than a sentence. `status` is the
|
|
13
|
+
* `DoctorCheckResult` field `runDoctor()` reads; `reason` is what a caller
|
|
14
|
+
* switches on.
|
|
15
|
+
*/
|
|
16
|
+
import type { DoctorCheckResult } from '@namzu/sdk';
|
|
17
|
+
/**
|
|
18
|
+
* Why the probe reached the verdict it did.
|
|
19
|
+
*
|
|
20
|
+
* Named for what an operator would do next, which is why `credentials` and
|
|
21
|
+
* `unreachable-model` are separate from `refused`: the first is a key to
|
|
22
|
+
* rotate, the second an id to change, the third a request the service looked
|
|
23
|
+
* at and would not take.
|
|
24
|
+
*/
|
|
25
|
+
export type BedrockHealthReason =
|
|
26
|
+
/** The model answered. */
|
|
27
|
+
'ok'
|
|
28
|
+
/** Nothing was probed: no model id was given and this driver holds none. */
|
|
29
|
+
| 'no-model'
|
|
30
|
+
/** The driver's own reachability rule refuses this id; nothing was sent. */
|
|
31
|
+
| 'unreachable-model'
|
|
32
|
+
/** No AWS credentials could be resolved on this machine. Never left it. */
|
|
33
|
+
| 'no-credentials'
|
|
34
|
+
/** AWS answered and rejected the credential or its permissions. */
|
|
35
|
+
| 'credentials'
|
|
36
|
+
/** The id is well-formed but this region serves no such model. */
|
|
37
|
+
| 'unknown-model'
|
|
38
|
+
/** The service looked at the request and refused it. */
|
|
39
|
+
| 'refused'
|
|
40
|
+
/** Reached, authenticated, and rate limited. The probe did not complete. */
|
|
41
|
+
| 'throttled'
|
|
42
|
+
/** The service answered and could not serve the request. */
|
|
43
|
+
| 'service'
|
|
44
|
+
/** Nothing was learned: the request did not get an answer. */
|
|
45
|
+
| 'unreachable-service';
|
|
46
|
+
/**
|
|
47
|
+
* A `DoctorCheckResult` with the reason kept.
|
|
48
|
+
*
|
|
49
|
+
* Extends rather than replaces so it satisfies `LLMProvider.doctorCheck`
|
|
50
|
+
* unchanged: `runDoctor()` reads `status` and never sees the extra field, and a
|
|
51
|
+
* caller holding the concrete driver reads `reason` without a cast.
|
|
52
|
+
*/
|
|
53
|
+
export interface BedrockHealthReport extends DoctorCheckResult {
|
|
54
|
+
readonly reason: BedrockHealthReason;
|
|
55
|
+
/** The id that was probed. Absent only when nothing was probed. */
|
|
56
|
+
readonly model?: string;
|
|
57
|
+
}
|
|
58
|
+
/** The reason an AWS failure implies; "nothing was learned" when unrecognised. */
|
|
59
|
+
export declare function reasonForError(err: unknown): BedrockHealthReason;
|
|
60
|
+
/**
|
|
61
|
+
* Build the report for a failure.
|
|
62
|
+
*
|
|
63
|
+
* The vendor error's message is taken from `providerVendorError` rather than
|
|
64
|
+
* from `err.message`, and that is not stylistic. AWS builds an exception
|
|
65
|
+
* message from the response body, so a credential the service echoed back is
|
|
66
|
+
* already inside `err.message` before this code sees it; `providerVendorError`
|
|
67
|
+
* is the one place in this estate that strips it. The class name is read off
|
|
68
|
+
* the raw error first — a name is not a body — and then the raw error is
|
|
69
|
+
* dropped.
|
|
70
|
+
*/
|
|
71
|
+
export declare function reportForError(err: unknown, model: string, durationMs: number): BedrockHealthReport;
|
|
72
|
+
/** The report for a reason that needs no vendor error to describe it. */
|
|
73
|
+
export declare function report(reason: BedrockHealthReason, message: string, extra?: {
|
|
74
|
+
readonly model?: string;
|
|
75
|
+
readonly durationMs?: number;
|
|
76
|
+
}): BedrockHealthReport;
|
|
77
|
+
//# sourceMappingURL=health.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"health.d.ts","sourceRoot":"","sources":["../src/health.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAGnD;;;;;;;GAOG;AACH,MAAM,MAAM,mBAAmB;AAC9B,0BAA0B;AACxB,IAAI;AACN,4EAA4E;GAC1E,UAAU;AACZ,4EAA4E;GAC1E,mBAAmB;AACrB,2EAA2E;GACzE,gBAAgB;AAClB,mEAAmE;GACjE,aAAa;AACf,kEAAkE;GAChE,eAAe;AACjB,wDAAwD;GACtD,SAAS;AACX,4EAA4E;GAC1E,WAAW;AACb,4DAA4D;GAC1D,SAAS;AACX,8DAA8D;GAC5D,qBAAqB,CAAA;AAExB;;;;;;GAMG;AACH,MAAM,WAAW,mBAAoB,SAAQ,iBAAiB;IAC7D,QAAQ,CAAC,MAAM,EAAE,mBAAmB,CAAA;IACpC,mEAAmE;IACnE,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CACvB;AAuED,kFAAkF;AAClF,wBAAgB,cAAc,CAAC,GAAG,EAAE,OAAO,GAAG,mBAAmB,CAiBhE;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAC7B,GAAG,EAAE,OAAO,EACZ,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,MAAM,GAChB,mBAAmB,CAWrB;AAED,yEAAyE;AACzE,wBAAgB,MAAM,CACrB,MAAM,EAAE,mBAAmB,EAC3B,OAAO,EAAE,MAAM,EACf,KAAK,GAAE;IAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAO,GACnE,mBAAmB,CASrB"}
|