@jaypie/llm 1.3.16 → 1.3.17

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.
@@ -16,6 +16,8 @@ export declare const EFFORT: {
16
16
  };
17
17
  export type LlmEffort = (typeof EFFORT)[keyof typeof EFFORT];
18
18
  export declare const MODEL: {
19
+ NOVA_LITE: string;
20
+ NOVA_PRO: string;
19
21
  FABLE: string;
20
22
  OPUS: string;
21
23
  SONNET: string;
@@ -24,6 +26,7 @@ export declare const MODEL: {
24
26
  FIREWORKS: {
25
27
  DEEPSEEK: string;
26
28
  GLM: string;
29
+ GPT_OSS: string;
27
30
  KIMI: string;
28
31
  MINIMAX: string;
29
32
  QWEN: string;
@@ -55,10 +58,11 @@ export interface LlmModelCost {
55
58
  */
56
59
  cachedInputRead?: number;
57
60
  /**
58
- * Cache-write tokens. A scalar when the rate does not vary by TTL; keyed by
59
- * the same `"5m"` / `"1h"` literals as `LlmCache` when it does, so a cost
60
- * calculation reads the TTL straight off `OperateRequest.cache`. Omitted
61
- * means cache writes bill at the `input` rate.
61
+ * Cache-write tokens. A scalar when the rate does not vary by TTL (`0` where
62
+ * the provider publishes a free write); keyed by the same `"5m"` / `"1h"`
63
+ * literals as `LlmCache` when it does, so a cost calculation reads the TTL
64
+ * straight off `OperateRequest.cache`. Omitted means cache writes bill at the
65
+ * `input` rate.
62
66
  */
63
67
  cachedInputWrite?: number | {
64
68
  "1h": number;
@@ -85,34 +89,39 @@ export interface LlmModelCost {
85
89
  * - **Standard rate only.** Introductory, batch, flex, priority, fast-mode, and
86
90
  * data-residency rates are excluded. Sonnet 5 is listed at its standard
87
91
  * $3/$15, not the introductory rate.
88
- * - **Cache writes are Anthropic-only.** Fireworks writes bill at the input
89
- * rate. OpenAI and xAI discount reads automatically and publish no write
90
- * premium. Google charges nothing to write an implicit cache; explicit
91
- * caching bills storage per hour, a unit this table does not carry (and one
92
- * `@jaypie/llm` does not wire).
92
+ * - **Cache writes are Anthropic-only.** Bedrock publishes a literal $0 write
93
+ * for Amazon's own models, recorded here as `cachedInputWrite: 0`. Fireworks
94
+ * writes bill at the input rate. OpenAI and xAI discount reads automatically
95
+ * and publish no write premium. Google charges nothing to write an implicit
96
+ * cache; explicit caching bills storage per hour, a unit this table does not
97
+ * carry (and one `@jaypie/llm` does not wire).
93
98
  * - **Short-context tier.** Long-prompt surcharges are not modeled: Gemini 3.1
94
99
  * Pro doubles above 200K, Grok doubles at 200K, GPT-5.5 is 2x in / 1.5x out
95
100
  * above 272K.
96
101
  * - **Text rates.** Gemini prices audio input higher than text/image/video.
97
- * - **Proxies are deliberately absent.** Bedrock (`PROVIDER.BEDROCK.*`) and
98
- * OpenRouter (`MODEL.OPENROUTER.*`) resell many vendors and price per backend
99
- * route, so no single rate is correct for a proxy id. Price those against the
100
- * backend model, or against the proxy's own published rate.
102
+ * - **Proxy routes are deliberately absent.** `MODEL.OPENROUTER.*`, and any
103
+ * uncatalogued Bedrock id reselling a third-party model, are another vendor's
104
+ * model behind a gateway, priced per route and per region, so no single rate
105
+ * here would be correct. Price those against the backend model, or against
106
+ * the gateway's own published rate. Amazon's own Nova models are first-class,
107
+ * not proxies, and are priced below at the standard US on-demand rate (`us.`
108
+ * geo profile for Nova 2 Lite; the `global.` profile is cheaper and is not
109
+ * modeled).
101
110
  *
102
111
  * Unlisted ids return `undefined` — callers must handle a miss.
103
112
  */
104
113
  export declare const COST: Record<string, LlmModelCost>;
105
114
  export declare const PROVIDER: {
106
115
  readonly BEDROCK: {
107
- readonly DEFAULT: "amazon.nova-pro-v1:0";
108
- /** @deprecated Size tiers are retired in 2.0. Use PROVIDER.BEDROCK.DEFAULT. */
116
+ readonly DEFAULT: string;
117
+ /** @deprecated Size tiers are retired in 2.0. Use PROVIDER.BEDROCK.DEFAULT, or pick a specific model from MODEL.NOVA_*. */
109
118
  readonly MODEL: {
110
- readonly DEFAULT: "amazon.nova-lite-v1:0";
111
- readonly LARGE: "amazon.nova-pro-v1:0";
112
- readonly SMALL: "amazon.nova-lite-v1:0";
113
- readonly TINY: "amazon.nova-micro-v1:0";
119
+ readonly DEFAULT: string;
120
+ readonly LARGE: string;
121
+ readonly SMALL: string;
122
+ readonly TINY: string;
114
123
  };
115
- readonly MODEL_MATCH_WORDS: readonly ["amazon.nova", "amazon.titan", "anthropic.claude", "cohere.command", "meta.llama", "mistral.mistral", "ai21."];
124
+ readonly MODEL_MATCH_WORDS: readonly ["ai21.", "amazon.nova", "amazon.titan", "anthropic.claude", "cohere.command", "deepseek.", "google.gemma", "meta.llama", "mistral.mistral", "moonshotai.", "openai.gpt-oss", "qwen."];
116
125
  readonly NAME: "bedrock";
117
126
  readonly REGION: "AWS_REGION";
118
127
  };
@@ -31,6 +31,11 @@ const EFFORT = {
31
31
  HIGHEST: "highest",
32
32
  };
33
33
  const MODEL = {
34
+ // Amazon (Nova; the only first-class models served over Bedrock. Bedrock also
35
+ // resells other vendors, but those routes are not catalogued — reach them by
36
+ // passing the literal id, which determineModelProvider resolves to bedrock.)
37
+ NOVA_LITE: "us.amazon.nova-2-lite-v1:0",
38
+ NOVA_PRO: "amazon.nova-pro-v1:0",
34
39
  // Anthropic
35
40
  FABLE: "claude-fable-5",
36
41
  OPUS: "claude-opus-4-8",
@@ -41,6 +46,7 @@ const MODEL = {
41
46
  FIREWORKS: {
42
47
  DEEPSEEK: "accounts/fireworks/models/deepseek-v4-pro",
43
48
  GLM: "accounts/fireworks/models/glm-5p2",
49
+ GPT_OSS: "accounts/fireworks/models/gpt-oss-120b",
44
50
  KIMI: "accounts/fireworks/models/kimi-k2p7-code",
45
51
  MINIMAX: "accounts/fireworks/models/minimax-m2p7",
46
52
  QWEN: "accounts/fireworks/models/qwen3p7-plus",
@@ -79,23 +85,51 @@ const MODEL = {
79
85
  * - **Standard rate only.** Introductory, batch, flex, priority, fast-mode, and
80
86
  * data-residency rates are excluded. Sonnet 5 is listed at its standard
81
87
  * $3/$15, not the introductory rate.
82
- * - **Cache writes are Anthropic-only.** Fireworks writes bill at the input
83
- * rate. OpenAI and xAI discount reads automatically and publish no write
84
- * premium. Google charges nothing to write an implicit cache; explicit
85
- * caching bills storage per hour, a unit this table does not carry (and one
86
- * `@jaypie/llm` does not wire).
88
+ * - **Cache writes are Anthropic-only.** Bedrock publishes a literal $0 write
89
+ * for Amazon's own models, recorded here as `cachedInputWrite: 0`. Fireworks
90
+ * writes bill at the input rate. OpenAI and xAI discount reads automatically
91
+ * and publish no write premium. Google charges nothing to write an implicit
92
+ * cache; explicit caching bills storage per hour, a unit this table does not
93
+ * carry (and one `@jaypie/llm` does not wire).
87
94
  * - **Short-context tier.** Long-prompt surcharges are not modeled: Gemini 3.1
88
95
  * Pro doubles above 200K, Grok doubles at 200K, GPT-5.5 is 2x in / 1.5x out
89
96
  * above 272K.
90
97
  * - **Text rates.** Gemini prices audio input higher than text/image/video.
91
- * - **Proxies are deliberately absent.** Bedrock (`PROVIDER.BEDROCK.*`) and
92
- * OpenRouter (`MODEL.OPENROUTER.*`) resell many vendors and price per backend
93
- * route, so no single rate is correct for a proxy id. Price those against the
94
- * backend model, or against the proxy's own published rate.
98
+ * - **Proxy routes are deliberately absent.** `MODEL.OPENROUTER.*`, and any
99
+ * uncatalogued Bedrock id reselling a third-party model, are another vendor's
100
+ * model behind a gateway, priced per route and per region, so no single rate
101
+ * here would be correct. Price those against the backend model, or against
102
+ * the gateway's own published rate. Amazon's own Nova models are first-class,
103
+ * not proxies, and are priced below at the standard US on-demand rate (`us.`
104
+ * geo profile for Nova 2 Lite; the `global.` profile is cheaper and is not
105
+ * modeled).
95
106
  *
96
107
  * Unlisted ids return `undefined` — callers must handle a miss.
97
108
  */
98
109
  const COST = {
110
+ // Amazon — AWS Price List API, AmazonBedrock/us-east-1 (published 2026-07-20;
111
+ // us-west-2 identical). https://aws.amazon.com/bedrock/pricing/ renders its
112
+ // tables in JavaScript, so the Price List offer file is the citable source.
113
+ // Nova 2 Lite is quoted at the `us.` geo rate this catalog's id bills against;
114
+ // the `global.` profile is $0.30/$2.50 and is not modeled.
115
+ "amazon.nova-lite-v1:0": {
116
+ cachedInputRead: 0.015,
117
+ cachedInputWrite: 0,
118
+ input: 0.06,
119
+ output: 0.24,
120
+ },
121
+ "amazon.nova-pro-v1:0": {
122
+ cachedInputRead: 0.2,
123
+ cachedInputWrite: 0,
124
+ input: 0.8,
125
+ output: 3.2,
126
+ },
127
+ "us.amazon.nova-2-lite-v1:0": {
128
+ cachedInputRead: 0.0825,
129
+ cachedInputWrite: 0,
130
+ input: 0.33,
131
+ output: 2.75,
132
+ },
99
133
  // Anthropic — https://platform.claude.com/docs/en/about-claude/pricing
100
134
  "claude-3-5-haiku-20241022": {
101
135
  cachedInputRead: 0.08,
@@ -186,6 +220,11 @@ const COST = {
186
220
  input: 1.4,
187
221
  output: 4.4,
188
222
  },
223
+ "accounts/fireworks/models/gpt-oss-120b": {
224
+ cachedInputRead: 0.015,
225
+ input: 0.15,
226
+ output: 0.6,
227
+ },
189
228
  "accounts/fireworks/models/kimi-k2p7-code": {
190
229
  cachedInputRead: 0.19,
191
230
  input: 0.95,
@@ -196,6 +235,14 @@ const COST = {
196
235
  input: 0.3,
197
236
  output: 1.2,
198
237
  },
238
+ // Retired from MODEL.* on 2026-07-21: its structured output is
239
+ // nondeterministic (clean JSON, prose, or an empty array from the same
240
+ // request). Priced here so historic usage stays replayable.
241
+ "accounts/fireworks/models/nemotron-3-ultra-nvfp4": {
242
+ cachedInputRead: 0.12,
243
+ input: 0.6,
244
+ output: 2.4,
245
+ },
199
246
  "accounts/fireworks/models/qwen3p7-plus": {
200
247
  cachedInputRead: 0.08,
201
248
  input: 0.4,
@@ -259,24 +306,28 @@ const GOOGLE_PROVIDER = {
259
306
  const PROVIDER = {
260
307
  // https://docs.aws.amazon.com/bedrock/latest/userguide/models-supported.html
261
308
  BEDROCK: {
262
- // Bedrock has no MODEL.* catalog entry yet; keep the literal default id.
263
309
  // nova-pro is the Amazon-native model that reliably does tools+structured.
264
- DEFAULT: "amazon.nova-pro-v1:0",
265
- /** @deprecated Size tiers are retired in 2.0. Use PROVIDER.BEDROCK.DEFAULT. */
310
+ DEFAULT: MODEL.NOVA_PRO,
311
+ /** @deprecated Size tiers are retired in 2.0. Use PROVIDER.BEDROCK.DEFAULT, or pick a specific model from MODEL.NOVA_*. */
266
312
  MODEL: {
267
- DEFAULT: "amazon.nova-lite-v1:0",
268
- LARGE: "amazon.nova-pro-v1:0",
269
- SMALL: "amazon.nova-lite-v1:0",
270
- TINY: "amazon.nova-micro-v1:0",
313
+ DEFAULT: MODEL.NOVA_LITE,
314
+ LARGE: MODEL.NOVA_PRO,
315
+ SMALL: MODEL.NOVA_LITE,
316
+ TINY: MODEL.NOVA_LITE,
271
317
  },
272
318
  MODEL_MATCH_WORDS: [
319
+ "ai21.",
273
320
  "amazon.nova",
274
321
  "amazon.titan",
275
322
  "anthropic.claude",
276
323
  "cohere.command",
324
+ "deepseek.",
325
+ "google.gemma",
277
326
  "meta.llama",
278
327
  "mistral.mistral",
279
- "ai21.",
328
+ "moonshotai.",
329
+ "openai.gpt-oss",
330
+ "qwen.",
280
331
  ],
281
332
  NAME: "bedrock",
282
333
  REGION: "AWS_REGION",