@ssweens/pi-vertex 1.1.12 → 1.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/models/claude.ts CHANGED
@@ -11,6 +11,218 @@
11
11
  import type { VertexModelConfig } from "../types.js";
12
12
 
13
13
  export const CLAUDE_MODELS: VertexModelConfig[] = [
14
+ // Claude 5.5 series
15
+ // Note: Claude 5 / 5.5 / Fable models on Vertex require provider data sharing
16
+ // to be enabled on the publisher model config, otherwise requests fail with HTTP 403.
17
+ // Fable 5.1 and 5.2 also require the Advanced AI Safety Addendum in Model Garden.
18
+ {
19
+ id: "claude-opus-5-5",
20
+ name: "Claude Opus 5.5",
21
+ apiId: "claude-opus-5-5",
22
+ publisher: "anthropic",
23
+ endpointType: "maas",
24
+ contextWindow: 1000000,
25
+ maxTokens: 128000,
26
+ input: ["text", "image"],
27
+ reasoning: true,
28
+ tools: true,
29
+ cost: {
30
+ input: 4.00,
31
+ output: 20.00,
32
+ cacheRead: 0.20,
33
+ cacheWrite: 5.00,
34
+ },
35
+ costRegional: {
36
+ input: 4.40,
37
+ output: 22.00,
38
+ cacheRead: 0.22,
39
+ cacheWrite: 5.50,
40
+ },
41
+ region: "global",
42
+ },
43
+ {
44
+ id: "claude-sonnet-5-5",
45
+ name: "Claude Sonnet 5.5",
46
+ apiId: "claude-sonnet-5-5",
47
+ publisher: "anthropic",
48
+ endpointType: "maas",
49
+ contextWindow: 1000000,
50
+ maxTokens: 128000,
51
+ input: ["text", "image"],
52
+ reasoning: true,
53
+ tools: true,
54
+ cost: {
55
+ input: 2.00,
56
+ output: 10.00,
57
+ cacheRead: 0.20,
58
+ cacheWrite: 2.50,
59
+ },
60
+ costRegional: {
61
+ input: 2.20,
62
+ output: 11.00,
63
+ cacheRead: 0.22,
64
+ cacheWrite: 2.75,
65
+ },
66
+ region: "global",
67
+ },
68
+ // GA 2026-10-07. Prices are the <=100K-input tier: at >=100K input tokens
69
+ // every token bills at 5x ($0.50/$2.50 global), which this table does not model.
70
+ {
71
+ id: "claude-haiku-5-5",
72
+ name: "Claude Haiku 5.5",
73
+ apiId: "claude-haiku-5-5",
74
+ publisher: "anthropic",
75
+ endpointType: "maas",
76
+ contextWindow: 1000000,
77
+ maxTokens: 128000,
78
+ input: ["text", "image"],
79
+ reasoning: true,
80
+ tools: true,
81
+ cost: {
82
+ input: 0.10,
83
+ output: 0.50,
84
+ cacheRead: 0.01,
85
+ cacheWrite: 0.125,
86
+ },
87
+ costRegional: {
88
+ input: 0.11,
89
+ output: 0.55,
90
+ cacheRead: 0.011,
91
+ cacheWrite: 0.1375,
92
+ },
93
+ region: "global",
94
+ },
95
+
96
+ // Claude 5 series
97
+ {
98
+ id: "claude-opus-5",
99
+ name: "Claude Opus 5",
100
+ apiId: "claude-opus-5",
101
+ publisher: "anthropic",
102
+ endpointType: "maas",
103
+ contextWindow: 1000000,
104
+ maxTokens: 128000,
105
+ input: ["text", "image"],
106
+ reasoning: true,
107
+ tools: true,
108
+ cost: {
109
+ input: 5.00,
110
+ output: 25.00,
111
+ cacheRead: 0.50,
112
+ cacheWrite: 6.25,
113
+ },
114
+ costRegional: {
115
+ input: 5.50,
116
+ output: 27.50,
117
+ cacheRead: 0.55,
118
+ cacheWrite: 6.875,
119
+ },
120
+ region: "global",
121
+ },
122
+ {
123
+ id: "claude-sonnet-5",
124
+ name: "Claude Sonnet 5",
125
+ apiId: "claude-sonnet-5",
126
+ publisher: "anthropic",
127
+ endpointType: "maas",
128
+ contextWindow: 1000000,
129
+ maxTokens: 128000,
130
+ input: ["text", "image"],
131
+ reasoning: true,
132
+ tools: true,
133
+ cost: {
134
+ input: 2.00,
135
+ output: 10.00,
136
+ cacheRead: 0.20,
137
+ cacheWrite: 2.50,
138
+ },
139
+ costRegional: {
140
+ input: 2.20,
141
+ output: 11.00,
142
+ cacheRead: 0.22,
143
+ cacheWrite: 2.75,
144
+ },
145
+ region: "global",
146
+ },
147
+
148
+ // Claude Fable (Mythos-class)
149
+ // Fable 5.2: GA 2026-11-09. Fast mode (`speed: "fast"`, 2x price) is not used here.
150
+ {
151
+ id: "claude-fable-5-2",
152
+ name: "Claude Fable 5.2",
153
+ apiId: "claude-fable-5-2",
154
+ publisher: "anthropic",
155
+ endpointType: "maas",
156
+ contextWindow: 1000000,
157
+ maxTokens: 128000,
158
+ input: ["text", "image"],
159
+ reasoning: true,
160
+ tools: true,
161
+ cost: {
162
+ input: 8.00,
163
+ output: 40.00,
164
+ cacheRead: 0.20,
165
+ cacheWrite: 10.00,
166
+ },
167
+ costRegional: {
168
+ input: 8.80,
169
+ output: 44.00,
170
+ cacheRead: 0.22,
171
+ cacheWrite: 11.00,
172
+ },
173
+ region: "global",
174
+ },
175
+ {
176
+ id: "claude-fable-5-1",
177
+ name: "Claude Fable 5.1",
178
+ apiId: "claude-fable-5-1",
179
+ publisher: "anthropic",
180
+ endpointType: "maas",
181
+ contextWindow: 1000000,
182
+ maxTokens: 128000,
183
+ input: ["text", "image"],
184
+ reasoning: true,
185
+ tools: true,
186
+ cost: {
187
+ input: 10.00,
188
+ output: 50.00,
189
+ cacheRead: 0.25,
190
+ cacheWrite: 12.50,
191
+ },
192
+ costRegional: {
193
+ input: 11.00,
194
+ output: 55.00,
195
+ cacheRead: 0.275,
196
+ cacheWrite: 13.75,
197
+ },
198
+ region: "global",
199
+ },
200
+ {
201
+ id: "claude-fable-5",
202
+ name: "Claude Fable 5",
203
+ apiId: "claude-fable-5",
204
+ publisher: "anthropic",
205
+ endpointType: "maas",
206
+ contextWindow: 1000000,
207
+ maxTokens: 128000,
208
+ input: ["text", "image"],
209
+ reasoning: true,
210
+ tools: true,
211
+ cost: {
212
+ input: 10.00,
213
+ output: 50.00,
214
+ cacheRead: 1.00,
215
+ cacheWrite: 12.50,
216
+ },
217
+ costRegional: {
218
+ input: 11.00,
219
+ output: 55.00,
220
+ cacheRead: 1.10,
221
+ cacheWrite: 13.75,
222
+ },
223
+ region: "global",
224
+ },
225
+
14
226
  // Claude 4.8 series
15
227
  {
16
228
  id: "claude-opus-4-8",
@@ -255,24 +467,5 @@ export const CLAUDE_MODELS: VertexModelConfig[] = [
255
467
  region: "global",
256
468
  },
257
469
 
258
- // Claude 3.5 series
259
- {
260
- id: "claude-3-5-sonnet-v2",
261
- name: "Claude 3.5 Sonnet v2",
262
- apiId: "claude-3-5-sonnet-v2@20241022",
263
- publisher: "anthropic",
264
- endpointType: "maas",
265
- contextWindow: 200000,
266
- maxTokens: 8192,
267
- input: ["text", "image"],
268
- reasoning: false,
269
- tools: true,
270
- cost: {
271
- input: 3.00,
272
- output: 15.00,
273
- cacheRead: 0.30,
274
- cacheWrite: 3.75,
275
- },
276
- region: "global",
277
- },
470
+ // Claude 3.5 Sonnet v2 was shut down on Vertex on 2026-02-19.
278
471
  ];
package/models/gemini.ts CHANGED
@@ -3,11 +3,157 @@
3
3
  * Source: https://docs.cloud.google.com/vertex-ai/generative-ai/docs/models
4
4
  * Pricing: https://cloud.google.com/vertex-ai/generative-ai/pricing
5
5
  * All prices per 1M tokens (standard tier, <= 200K input tokens)
6
+ * Verified against the Vertex AI model catalog on 2026-10-13; Gemini 4 entries
7
+ * re-verified against the Gemini Enterprise Agent Platform catalog on 2026-11-15.
6
8
  */
7
9
 
10
+ import type { ThinkingLevelMap } from "@earendil-works/pi-ai";
8
11
  import type { VertexModelConfig } from "../types.js";
9
12
 
13
+ // Gemini 4 rejects MINIMAL (HTTP 400): hide it in Pi; streaming/gemini.ts also floors it to LOW.
14
+ const GEMINI_4_THINKING: ThinkingLevelMap = { minimal: null };
15
+
10
16
  export const GEMINI_MODELS: VertexModelConfig[] = [
17
+ // --- Gemini 4 ---
18
+ // Unified 1M input+output limit. "Long decode" extends output to 1M tokens;
19
+ // 65536 is the per-segment streaming limit, consistent with the rest of the catalog.
20
+ // Implicit caching only; durable caching is on by default.
21
+
22
+ // GA 2026-11-12, short-term release (45-day retirement notice). Thinking levels
23
+ // LOW/MEDIUM/HIGH (default)/XHIGH — the only Gemini model that accepts XHIGH.
24
+ // Cache writes ($1.875/1M) bill from 2027-01-12; Gemini streams report no
25
+ // cache-write tokens, so cacheWrite stays 0.
26
+ {
27
+ id: "gemini-4-hydrogen",
28
+ name: "Gemini 4 Hydrogen",
29
+ apiId: "gemini-4-hydrogen",
30
+ publisher: "google",
31
+ endpointType: "gemini",
32
+ contextWindow: 1048576,
33
+ maxTokens: 65536,
34
+ input: ["text", "image"],
35
+ reasoning: true,
36
+ tools: true,
37
+ cost: {
38
+ input: 1.50,
39
+ output: 7.50,
40
+ cacheRead: 0.075,
41
+ cacheWrite: 0,
42
+ },
43
+ region: "global",
44
+ thinkingLevelMap: { ...GEMINI_4_THINKING, xhigh: "xhigh" },
45
+ },
46
+
47
+ // GA 2026-11-10, Google Frontier Model (verified enterprise customers in select
48
+ // regions). Thinking levels LOW/MEDIUM (default)/HIGH. Introductory pricing
49
+ // through 2026-11-30; rises to $4.00/$20.00 ($0.20 cached) after.
50
+ {
51
+ id: "gemini-4-carbon",
52
+ name: "Gemini 4 Carbon",
53
+ apiId: "gemini-4-carbon",
54
+ publisher: "google",
55
+ endpointType: "gemini",
56
+ contextWindow: 1048576,
57
+ maxTokens: 65536,
58
+ input: ["text", "image"],
59
+ reasoning: true,
60
+ tools: true,
61
+ cost: {
62
+ input: 2.00,
63
+ output: 10.00,
64
+ cacheRead: 0.10,
65
+ cacheWrite: 0,
66
+ },
67
+ region: "global",
68
+ thinkingLevelMap: GEMINI_4_THINKING,
69
+ },
70
+
71
+ // GA 2026-10-13. Thinking levels LOW/MEDIUM (default)/HIGH. Introductory
72
+ // pricing through 2026-11-30; rises to $4.00/$20.00 ($0.20 cached) after.
73
+ {
74
+ id: "gemini-4-argon",
75
+ name: "Gemini 4 Argon",
76
+ apiId: "gemini-4-argon",
77
+ publisher: "google",
78
+ endpointType: "gemini",
79
+ contextWindow: 1048576,
80
+ maxTokens: 65536,
81
+ input: ["text", "image"],
82
+ reasoning: true,
83
+ tools: true,
84
+ cost: {
85
+ input: 2.00,
86
+ output: 10.00,
87
+ cacheRead: 0.10,
88
+ cacheWrite: 0,
89
+ },
90
+ region: "global",
91
+ thinkingLevelMap: GEMINI_4_THINKING,
92
+ },
93
+
94
+ // --- Gemini 3.8 (GA, 2026-09-02) ---
95
+ {
96
+ id: "gemini-3.8-flash",
97
+ name: "Gemini 3.8 Flash",
98
+ apiId: "gemini-3.8-flash",
99
+ publisher: "google",
100
+ endpointType: "gemini",
101
+ contextWindow: 1048576,
102
+ maxTokens: 65536,
103
+ input: ["text", "image"],
104
+ reasoning: true,
105
+ tools: true,
106
+ cost: {
107
+ input: 0.75,
108
+ output: 3.75,
109
+ cacheRead: 0.075,
110
+ cacheWrite: 0,
111
+ },
112
+ region: "global",
113
+ },
114
+
115
+ // --- Gemini 3.7 (GA, 2026-08-13) ---
116
+ {
117
+ id: "gemini-3.7-flash",
118
+ name: "Gemini 3.7 Flash",
119
+ apiId: "gemini-3.7-flash",
120
+ publisher: "google",
121
+ endpointType: "gemini",
122
+ contextWindow: 1048576,
123
+ maxTokens: 65536,
124
+ input: ["text", "image"],
125
+ reasoning: true,
126
+ tools: true,
127
+ cost: {
128
+ input: 0.75,
129
+ output: 3.75,
130
+ cacheRead: 0.075,
131
+ cacheWrite: 0,
132
+ },
133
+ region: "global",
134
+ },
135
+
136
+ // --- Gemini 3.6 (GA, 2026-07-21) ---
137
+ {
138
+ id: "gemini-3.6-flash",
139
+ name: "Gemini 3.6 Flash",
140
+ apiId: "gemini-3.6-flash",
141
+ publisher: "google",
142
+ endpointType: "gemini",
143
+ contextWindow: 1048576,
144
+ maxTokens: 65536,
145
+ input: ["text", "image"],
146
+ reasoning: true,
147
+ tools: true,
148
+ cost: {
149
+ input: 1.50,
150
+ output: 7.50,
151
+ cacheRead: 0.15,
152
+ cacheWrite: 0,
153
+ },
154
+ region: "global",
155
+ },
156
+
11
157
  // --- Gemini 3.5 (GA) ---
12
158
  {
13
159
  id: "gemini-3.5-flash",
@@ -28,8 +174,27 @@ export const GEMINI_MODELS: VertexModelConfig[] = [
28
174
  },
29
175
  region: "global",
30
176
  },
177
+ {
178
+ id: "gemini-3.5-flash-lite",
179
+ name: "Gemini 3.5 Flash Lite",
180
+ apiId: "gemini-3.5-flash-lite",
181
+ publisher: "google",
182
+ endpointType: "gemini",
183
+ contextWindow: 1048576,
184
+ maxTokens: 65536,
185
+ input: ["text", "image"],
186
+ reasoning: true,
187
+ tools: true,
188
+ cost: {
189
+ input: 0.30,
190
+ output: 2.50,
191
+ cacheRead: 0.03,
192
+ cacheWrite: 0,
193
+ },
194
+ region: "global",
195
+ },
31
196
 
32
- // --- Gemini 3.1 (Preview) ---
197
+ // --- Gemini 3.1 (Pro still Preview; Flash Lite now GA) ---
33
198
  {
34
199
  id: "gemini-3.1-pro",
35
200
  name: "Gemini 3.1 Pro",
@@ -52,11 +217,11 @@ export const GEMINI_MODELS: VertexModelConfig[] = [
52
217
  {
53
218
  id: "gemini-3.1-flash-lite",
54
219
  name: "Gemini 3.1 Flash Lite",
55
- apiId: "gemini-3.1-flash-lite-preview",
220
+ apiId: "gemini-3.1-flash-lite",
56
221
  publisher: "google",
57
222
  endpointType: "gemini",
58
223
  contextWindow: 1048576,
59
- maxTokens: 65535,
224
+ maxTokens: 65536,
60
225
  input: ["text", "image"],
61
226
  reasoning: true,
62
227
  tools: true,
@@ -149,43 +314,7 @@ export const GEMINI_MODELS: VertexModelConfig[] = [
149
314
  region: "global",
150
315
  },
151
316
 
152
- // --- Gemini 2.0 (GA) ---
153
- {
154
- id: "gemini-2.0-flash",
155
- name: "Gemini 2.0 Flash",
156
- apiId: "gemini-2.0-flash",
157
- publisher: "google",
158
- endpointType: "gemini",
159
- contextWindow: 1048576,
160
- maxTokens: 8192,
161
- input: ["text", "image"],
162
- reasoning: false,
163
- tools: true,
164
- cost: {
165
- input: 0.15,
166
- output: 0.60,
167
- cacheRead: 0,
168
- cacheWrite: 0,
169
- },
170
- region: "global",
171
- },
172
- {
173
- id: "gemini-2.0-flash-lite",
174
- name: "Gemini 2.0 Flash Lite",
175
- apiId: "gemini-2.0-flash-lite",
176
- publisher: "google",
177
- endpointType: "gemini",
178
- contextWindow: 1048576,
179
- maxTokens: 8192,
180
- input: ["text", "image"],
181
- reasoning: false,
182
- tools: true,
183
- cost: {
184
- input: 0.075,
185
- output: 0.30,
186
- cacheRead: 0,
187
- cacheWrite: 0,
188
- },
189
- region: "global",
190
- },
317
+ // Gemini 2.0 Flash / Flash Lite were shut down on Vertex AI on 2026-06-01.
318
+ // Migration path is gemini-2.5-flash / gemini-2.5-flash-lite, which are
319
+ // themselves retired on 2026-10-16.
191
320
  ];