@ssweens/pi-vertex 1.1.13 → 1.4.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 CHANGED
@@ -2,6 +2,131 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [1.4.0] - 2026-11-20
6
+
7
+ ### Added
8
+ - Gemini 4 Neon (`gemini-4-neon`): 1M combined context, 65,536 foreground output cap, text/image input, tools, and LOW through XHIGH thinking. Global prices are $3/$15 per 1M input/output tokens, with $0.15 cached input. Non-global prices are 10% higher.
9
+ - DeepSeek V4.1 Flash 1017 (`deepseek-v4.1-flash-1017`): 1M context, text/image input, tools, and the original Flash's reasoning levels. $0.30/$1.20 per 1M input/output tokens; cached input is $0.006.
10
+ - Grok 4.20 Non-Reasoning (`grok-4.20-non-reasoning`): text/image input and tools without thinking, using the existing Grok Chat Completions route.
11
+ - Six OpenAI Private Preview models: `gpt-6.2-astra`, `gpt-6.2-sol`, `gpt-6-astra`, `gpt-6.1-sol`, `gpt-6.1-terra`, and `gpt-6-luna`. All use Vertex's OpenAI publisher Responses endpoint, with 1,050,000 combined context and 128,000 max output tokens. Costs are estimates from OpenAI's public Standard API rates; Vertex billing uses the customer's Marketplace private offer.
12
+ - Catalog and GPT Responses regression coverage for routing, reasoning effort, payload hooks, stateless encrypted tool replay, and Muse compatibility.
13
+
14
+ ### Changed
15
+ - GPT Responses requests omit unsupported reasoning summaries and request encrypted reasoning at every thinking level. Terra and Luna can disable reasoning with `none`; Astra and Sol use the provider default at `off`.
16
+ - Gemini streaming honors `costRegional` when supplied, including Neon's non-global rates.
17
+ - The registry now contains 58 models.
18
+
19
+ ## [1.3.0] - 2026-11-15
20
+
21
+ ### Added
22
+ - **Gemini 4 Hydrogen** (`gemini-4-hydrogen`): GA on 2026-11-12. Google calls it a short-term release and retires it with 45 days' notice. It has a 1M token limit that covers input and output together, and 65,536 max output per response. Pricing is $1.50/$7.50 per 1M tokens, with $0.075 per 1M cached input tokens. Thinking levels are `low`, `medium`, `high` (the default), and `xhigh`. Hydrogen is the only Gemini model that accepts `xhigh`.
23
+ - **Gemini 4 Carbon** (`gemini-4-carbon`): GA on 2026-11-10. This Frontier Model is available only to verified enterprise customers. It has a 1M context and 65,536 max output. Thinking levels are `low`, `medium` (the default), and `high`. It shares Argon's introductory pricing: $2.00/$10.00, with $0.10 cached, through 2026-11-30, then $4.00/$20.00.
24
+ - **Claude Fable 5.2** (`claude-fable-5-2`): GA on 2026-11-09. 1M context, 128K max output. $8.00/$40.00 global; regional endpoints cost 10% more. It needs the Advanced AI Safety Addendum, like Fable 5.1. Fast mode (`speed: "fast"`, billed at 2x) is not used.
25
+ - **Claude Haiku 5.5** (`claude-haiku-5-5`): GA on 2026-10-07. 1M context, 128K max output. $0.10/$0.50 global below 100K input tokens. At 100K input tokens or more, every token in the request bills at 5x; cost tracking uses the lower tier.
26
+ - **Grok 4.7** (`grok-4.7`): GA on 2026-09-30. 524K context, global endpoint. $2.00/$6.00 per 1M tokens, $0.50 cached, the same as Grok 4.6.
27
+ - **DeepSeek V4.1 Flash** (`deepseek-v4.1-flash`): 1M context, text and image input, tools, global endpoint only. $0.30/$1.20 per 1M tokens, $0.03 cached. This is now the only DeepSeek model on Vertex.
28
+ - **Meta Muse** (`muse-wonder-1.0`, `muse-spark-1.3`, `muse-ember-1.0`): Preview, global endpoint only. 1,048,576-token context shared by input and output. Text and image input, tools, and reasoning. Wonder costs $4.00/$20.00, Spark $1.25/$4.25, and Ember $0.10/$0.50; Ember costs 3x above 200K input tokens.
29
+ - **A Responses API path for MaaS models.** Muse models run only on Meta's stateless OpenAI-compatible Responses API (`publishers/meta/v1/responses`), not on Chat Completions. Models marked `maasApi: "responses"` now stream through pi-ai's OpenAI Responses client with `store: false`. Reasoning is replayed as encrypted content, so multi-turn tool use keeps its reasoning state. The keepalive filter and first-byte timeout cover these URLs too.
30
+ - **Per-model thinking levels.** Model definitions can carry a `thinkingLevelMap`, which pi-vertex passes to Pi, so the thinking selector shows only the levels each API accepts:
31
+ - Gemini 4 hides `minimal`, because the API answers it with HTTP 400.
32
+ - Gemini 4 Hydrogen adds `xhigh`.
33
+ - Muse offers `minimal` through `xhigh`, and Muse Ember also offers `max`.
34
+ - DeepSeek V4.1 Flash offers `minimal` through `high`, plus `max`.
35
+
36
+ ### Changed
37
+ - Gemini thinking: `xhigh` is sent as the `XHIGH` thinking level only to models that declare it (Hydrogen). Other Gemini models still cap `xhigh` and `max` at `HIGH`. Every Gemini 4 model now floors `minimal` to `low`; before, only Argon did.
38
+ - DeepSeek V4.1 Flash on Vertex thinks only when `reasoning_effort` is present, so pi-vertex now sends the selected effort. At thinking level `off` it sends nothing, and the model answers without thinking.
39
+ - GLM 5.2 cached input price corrected from $0.26 to $0.14 per 1M tokens, the current list price.
40
+
41
+ ### Removed
42
+ - Open models that Google shut down on Vertex on 2026-10-21. Each returns HTTP 404 on the global endpoint:
43
+ - DeepSeek: `deepseek-v3.2`, `deepseek-v3.1`, `deepseek-r1`, `deepseek-ocr`
44
+ - Qwen: `qwen3-235b`, `qwen3-next-instruct`, `qwen3-next-thinking`, `qwen3-coder`
45
+ - Zhipu: `glm-5`, `glm-4.7`
46
+ - Others: `gpt-oss-20b`, `kimi-k2-thinking`, `minimax-m2`, `llama-3.3-70b`
47
+ - `grok-4.1-fast-reasoning`: shut down on 2026-08-20.
48
+ - `claude-3-5-sonnet-v2`: shut down on Vertex on 2026-02-19. It returns HTTP 404 on both global and us-east5.
49
+
50
+ ## [1.2.7] - 2026-10-13
51
+
52
+ ### Fixed
53
+ - **No model received tools or the system prompt under Pi 0.99.** The 0.99 agent loop stops passing `context.systemPrompt`/`context.tools` to `streamSimple` — both are folded into system messages in the transcript (`toolsAdded`/`toolsRemoved` deltas replayed in order). The streaming paths still read the legacy shorthand fields, which are always empty, so every Vertex model (Gemini, Claude, MaaS) ran as a bare text completion: no function declarations, no Pi system prompt. Visible with any agentic prompt; the model reports it has "zero tools attached". `streamVertex` now resolves the prompt and current tool set from the transcript (via pi-ai's `getCurrentSystemMessage`/`getCurrentTools`) before dispatching; explicitly passed fields still win.
54
+
55
+ ## [1.2.6] - 2026-10-13
56
+
57
+ ### Added
58
+ - **Gemini 4 Argon** (`gemini-4-argon`) — GA on 2026-10-13, Google's new flagship reasoning model. 1M context, 65,536 max output (1M with long decode; the default synchronous limit is used), reasoning via low/medium/high thinking levels, tools, global Vertex endpoint. Introductory pricing is $2.00/$10.00 per 1M input/output tokens with $0.10/1M cached input tokens through 2026-11-30, rising to $4.00/$20.00 after.
59
+
60
+ ### Changed
61
+ - Thinking configuration now treats Gemini 4 like Gemini 3: thinking levels instead of Gemini 2.5 budgets, `thinkingConfig` omitted when no reasoning effort is given so Argon uses its native default, and `minimal` effort floors to `low` (Argon does not support MINIMAL).
62
+ - Cross-provider tool call replay to Gemini 4 models now uses the `skip_thought_signature_validator` escape hatch, matching Gemini 3's functionCall signature requirement.
63
+
64
+ ## [1.2.5] - 2026-09-29
65
+
66
+ ### Added
67
+ - **Claude Opus 5.5** (`claude-opus-5-5`) — GA on Vertex 2026-09-22. 1M context, 128K max output, thinking, tools. $4.00/$20.00 global, 10% regional premium. Cache reads $0.20/1M (60% below Opus 5).
68
+ - **Claude Sonnet 5.5** (`claude-sonnet-5-5`) — GA on Vertex 2026-09-28. 1M context, 128K max output, thinking, tools. Same token prices as Sonnet 5 ($2.00/$10.00 global).
69
+ - **Claude Fable 5.1** (`claude-fable-5-1`) — GA on Vertex 2026-09-01. 1M context, 128K max output, thinking, tools. Same input/output prices as Fable 5 ($10.00/$50.00 global); cache reads $0.25/1M (75% below Fable 5's $1.00). Vertex also requires the Advanced AI Safety Addendum.
70
+
71
+ API ids match Google Cloud Model Garden (`claude-opus-5-5`, `claude-sonnet-5-5`, `claude-fable-5-1`). No date suffix. Same MaaS streaming path as the rest of the Claude 5 series.
72
+
73
+ ## [1.2.4] - 2026-09-23
74
+
75
+ ### Fixed
76
+ - **The startup notice no longer crashes Pi on a narrow terminal.** The `[pi-vertex] Initializing with project: …` widget ignored the render width, and Pi exits on any line wider than the terminal. With a typical project id that line is about 68 columns, so resizing below that, or reloading in a narrow pane, killed the app (`Rendered line … exceeds terminal width (68 > 54)`). The widget now clips to the width it is given.
77
+
78
+ ## [1.2.3] - 2026-09-22
79
+
80
+ ### Fixed
81
+ - **Streams that are accepted and never start no longer cost five minutes each.** Some Vertex deployments answer a streaming request with `200 text/event-stream` and then send nothing at all. Measured on `zai-org/glm-5.2-maas` (global): 9 of 19 requests, with and without tools, while `zai-org/glm-4.7-maas` and `deepseek-ai/deepseek-v3.2-maas` on the same endpoint and credentials stalled 0 of 22. undici only abandons a silent body after its 300 s timeout, so each dead request burned five minutes before a retry could start — a one-line answer through a delegated agent took ten minutes and two `terminated` errors.
82
+
83
+ The fetch wrapper that strips keepalive lines now also bounds the wait for the **first** byte, default 90 s, configurable with `PI_VERTEX_FIRST_BYTE_TIMEOUT_MS` (`0` disables). A stream that has begun is untouched: genuinely slow ones keep the socket alive with the keepalive lines this wrapper strips further down, and mid-stream gaps remain undici's business. The error names the endpoint and says retrying or another offering is the fix.
84
+
85
+ This is a client-side bound on someone else's outage, not a repair of it. `glm-5.2` on the global MaaS endpoint is unreliable for interactive use; it has no regional endpoint (`us-central1` answers HTTP 400).
86
+
87
+ ### Added
88
+ - `npm test` with a first-byte-timeout check covering a dead stream, a slow-starting stream, and keepalive stripping.
89
+
90
+ ## [1.2.2] - 2026-09-03
91
+ ### Added
92
+ - **GLM 5.2** (`glm-5.2`) — 1M context, 64,000 max output, thinking, tools, and global Vertex endpoint. Pricing is $1.40/$4.40 per 1M input/output tokens with $0.26/1M cached input tokens.
93
+ - **Grok 4.6** (`grok-4.6`) — Preview model with 524K context, image input, reasoning, tools, and global Vertex endpoint. Pricing is $2.00/$6.00 per 1M input/output tokens with $0.50/1M cached input tokens.
94
+
95
+ ## [1.2.1] - 2026-09-03
96
+ ### Added
97
+ - **Gemini 3.8 Flash** (`gemini-3.8-flash`) — GA on 2026-09-02. 1M context, 65,536 max output, reasoning via low/medium/high thinking levels, tools, and global Vertex endpoint. Introductory pricing is $0.75/$3.75 per 1M input/output tokens with $0.075/1M cached input tokens through 2026-12-31.
98
+
99
+ ### Fixed
100
+ - Gemini 3.8 Flash `minimal` reasoning requests now floor to the supported `low` thinking level.
101
+
102
+ ## [1.2.0] - 2026-08-14
103
+ ### Added
104
+ - **Gemini 3.7 Flash** (`gemini-3.7-flash`) — GA on 2026-08-13. Google's current workhorse Flash model for coding and agents. 1M context, 65,536 max output, reasoning via thinking levels, tools. $0.75/$3.75 per 1M tokens, $0.075/1M cache read — cheaper *and* newer than 3.5/3.6 Flash.
105
+ - **Gemini 3.6 Flash** (`gemini-3.6-flash`) — GA on 2026-07-21. Improved token efficiency and agentic planning over 3.5 Flash at a lower output price. 1M context, 65,536 max output. $1.50/$7.50 per 1M tokens, $0.15/1M cache read.
106
+ - **Gemini 3.5 Flash Lite** (`gemini-3.5-flash-lite`) — GA on 2026-07-21. The current high-volume/low-cost route. 1M context, 65,536 max output. $0.30/$2.50 per 1M tokens, $0.03/1M cache read.
107
+ - **Claude Opus 5** (`claude-opus-5`) — Anthropic's Claude 5 flagship on Vertex Model Garden. 1M context, 128K max output. $5.00/$25.00 global, 10% regional premium.
108
+ - **Claude Sonnet 5** (`claude-sonnet-5`) — 1M context, 128K max output. $2.00/$10.00 global, 10% regional premium — a price cut versus Sonnet 4.6's $3.00/$15.00.
109
+
110
+ ### Changed
111
+ - **Gemini 3.1 Flash Lite promoted to GA** — API id moved from `gemini-3.1-flash-lite-preview` to `gemini-3.1-flash-lite`. Its `maxTokens` also corrected from `65535` to `65536`.
112
+ - `ModelInputType` now documents that it intentionally mirrors pi-ai's `Model["input"]` (`("text" | "image")[]`) and must not be widened.
113
+
114
+ ### Removed
115
+ - **Gemini 2.0 Flash / Flash Lite** (`gemini-2.0-flash`, `gemini-2.0-flash-lite`) — Google shut these endpoints down on Vertex on 2026-06-01. They were still being advertised in pi's model selector and would fail at request time. Migrate to `gemini-2.5-flash` / `gemini-2.5-flash-lite`, or better, a 3.x Flash model since the 2.5 line retires on 2026-10-16.
116
+
117
+ ### Fixed
118
+ - **Package no longer type-checks clean → now it does.** Two pre-existing `tsc --noEmit` errors were blocking a clean build:
119
+ - `models/claude.ts` declared `input: ["text", "image", "file"]` on `claude-fable-5`, but `"file"` is not a member of `ModelInputType` (nor of pi-ai's `Model["input"]`, which is the hard downstream constraint). The modality was never actually deliverable, so it has been dropped rather than the type widened.
120
+ - `streaming/gemini.ts` pushed `output.stopReason` into a `done` event, whose `reason` only accepts `"stop" | "length" | "toolUse"`. Safety blocks and unmapped finish reasons now emit an `error` event instead, matching the catch block's behavior.
121
+
122
+ ### Notes
123
+ - `gemini-3.1-pro` remains a Preview offering on Vertex; its API id stays `gemini-3.1-pro-preview`.
124
+ - Claude 5 models require provider data sharing enabled on the publisher model config or Vertex returns HTTP 403.
125
+
126
+ ## [1.1.14] - 2026-07-17
127
+ ### Fixed
128
+ - **Provider registration failing with `"baseUrl" is required when defining custom models"`** — `toPiModel()` set `baseUrl: ""` on every per-model entry passed to `registerProvider`. Since `??` only falls through on `null`/`undefined`, that empty string beat the provider-level `baseUrl` fallback in pi-coding-agent's resolution (`definition.baseUrl ?? providerConfig.baseUrl`), so every model resolved to an empty URL and the extension failed to load. Per-model entries now correctly omit `baseUrl` (and `provider`, which isn't part of the per-model shape either), letting them inherit the provider's `baseUrl`.
129
+
5
130
  ## [1.1.13] - 2026-06-09
6
131
  ### Added
7
132
  - **Claude Fable 5** (`claude-fable-5`) — Anthropic's first public Mythos-class model, positioned above Opus 4.8. 1M context, 128K max output, text/image/file input, reasoning (adaptive thinking always on), tools. $10/$50 per 1M tokens (global), $1/1M cache read, 10% regional premium. Available on Vertex AI Model Garden.
package/README.md CHANGED
@@ -11,22 +11,22 @@ export GOOGLE_CLOUD_PROJECT=your-project-id
11
11
  export GOOGLE_APPLICATION_CREDENTIALS=/path/to/key.json
12
12
  ```
13
13
 
14
- Set your GCP project and credentials. Vertex AI models (Gemini, Claude, Llama, DeepSeek, Qwen, Mistral, and others) appear in pi's model selector, billed through your GCP project.
14
+ Set your GCP project and credentials. Vertex AI models (Gemini, Claude, OpenAI GPT, Grok, Meta Muse and Llama, DeepSeek, Mistral, and others) appear in pi's model selector, billed through your GCP project.
15
15
 
16
16
  ## Features
17
17
 
18
- - **45 models** across 4 categories:
19
- - **Gemini** (9): 3.1 Pro, 3.1 Flash-Lite, 3 Flash, 2.5 Pro, 2.5 Flash, 2.5 Flash-Lite, 2.0 Flash, 2.0 Flash-Lite
20
- - **Claude** (11): Opus 4.8, Opus 4.7, Opus 4.6, Sonnet 4.6, Opus/Sonnet/Haiku 4.5, Opus 4.1, Opus 4, Sonnet 4, 3.5 Sonnet v2
21
- - **Llama** (3): 4 Maverick, 4 Scout, 3.3 70B
22
- - **Other MaaS** (22): Grok 4.3, Grok 4.20, Grok 4.1 Fast, Gemma, Mistral, DeepSeek, Qwen, OpenAI GPT-OSS, Kimi, MiniMax, GLM
18
+ - **58 models** across 4 categories:
19
+ - **Gemini** (15): 4 Neon, 4 Hydrogen, 4 Carbon, 4 Argon, 3.8 Flash, 3.7 Flash, 3.6 Flash, 3.5 Flash, 3.5 Flash-Lite, 3.1 Pro, 3.1 Flash-Lite, 3 Flash, 2.5 Pro, 2.5 Flash, 2.5 Flash-Lite
20
+ - **Claude** (18): Fable 5.2, Opus 5.5, Sonnet 5.5, Haiku 5.5, Fable 5.1, Opus 5, Sonnet 5, Fable 5, Opus 4.8, Opus 4.7, Opus 4.6, Sonnet 4.6, Opus/Sonnet/Haiku 4.5, Opus 4.1, Opus 4, Sonnet 4
21
+ - **Meta** (5): Muse Wonder 1.0, Muse Spark 1.3, Muse Ember 1.0, Llama 4 Maverick, Llama 4 Scout
22
+ - **Other MaaS** (20): OpenAI GPT-6 (6), Grok (5, including 4.20 Non-Reasoning), DeepSeek V4.1 Flash and Flash 1017, Mistral (4), OpenAI GPT-OSS 120B, Gemma 4, GLM 5.2
23
23
 
24
24
  - **Unified streaming**: Single provider, multiple model families
25
25
  - **Full tool calling support**: All models with multi-turn tool use and proper tool result handling
26
- - **Thinking/reasoning**: Gemini 3 thinking levels, Gemini 2.5 thinking budgets, thought signature preservation
26
+ - **Thinking/reasoning**: Gemini 3/4 thinking levels (including XHIGH on Gemini 4 Neon and Hydrogen), Gemini 2.5 thinking budgets, per-model reasoning effort for Claude, OpenAI GPT, Muse, and DeepSeek, thought signature preservation
27
27
  - **Automatic auth**: Uses Google Application Default Credentials
28
28
  - **Region awareness**: Global endpoints where supported, regional where required
29
- - **Pricing tracking**: Built-in cost per token for all models (including thinking tokens and regional endpoint premiums)
29
+ - **Pricing tracking**: Token cost tracking includes thinking tokens and supported regional premiums. GPT-6 rates are public-API estimates, not Vertex private-offer prices.
30
30
 
31
31
  ## Installation
32
32
 
@@ -86,14 +86,23 @@ pi --provider vertex --model gemini-2.5-pro --version
86
86
 
87
87
  ```bash
88
88
  # Use any supported model
89
- pi --provider vertex --model claude-opus-4-8
90
- pi --provider vertex --model grok-4.3
91
- pi --provider vertex --model gemini-2.5-pro
89
+ pi --provider vertex --model claude-opus-5-5
90
+ pi --provider vertex --model claude-sonnet-5-5
91
+ pi --provider vertex --model claude-fable-5-2
92
+ pi --provider vertex --model claude-haiku-5-5
93
+ pi --provider vertex --model grok-4.7
94
+ pi --provider vertex --model glm-5.2
95
+ pi --provider vertex --model gemini-4-neon
96
+ pi --provider vertex --model gemini-4-hydrogen
97
+ pi --provider vertex --model gemini-4-argon
98
+ pi --provider vertex --model gemini-3.8-flash
99
+ pi --provider vertex --model muse-wonder-1.0
92
100
  pi --provider vertex --model llama-4-maverick
93
- pi --provider vertex --model deepseek-v3.2
101
+ pi --provider vertex --model deepseek-v4.1-flash-1017
102
+ pi --provider vertex --model gpt-6.2-sol
94
103
 
95
104
  # With options
96
- pi --provider vertex --model claude-sonnet-4-6 --reasoning high
105
+ pi --provider vertex --model gemini-4-neon --thinking xhigh
97
106
  ```
98
107
 
99
108
  ### Shell alias (recommended)
@@ -120,15 +129,33 @@ alias pil="GOOGLE_CLOUD_PROJECT=your-project pi --provider vertex --model llama-
120
129
 
121
130
  | Model | Context | Max Tokens | Input | Reasoning | Price (in/out) |
122
131
  |-------|---------|------------|-------|-----------|----------------|
132
+ | gemini-4-neon | 1M | 65,536 | text, image | ✅ | $3.00/$15.00 |
133
+ | gemini-4-hydrogen | 1M | 65,536 | text, image | ✅ | $1.50/$7.50 |
134
+ | gemini-4-carbon | 1M | 65,536 | text, image | ✅ | $2.00/$10.00 |
135
+ | gemini-4-argon | 1M | 65,536 | text, image | ✅ | $2.00/$10.00 |
136
+ | gemini-3.8-flash | 1M | 65,536 | text, image | ✅ | $0.75/$3.75 |
137
+ | gemini-3.7-flash | 1M | 65,536 | text, image | ✅ | $0.75/$3.75 |
138
+ | gemini-3.6-flash | 1M | 65,536 | text, image | ✅ | $1.50/$7.50 |
139
+ | gemini-3.5-flash | 1M | 65,536 | text, image | ✅ | $1.50/$9.00 |
140
+ | gemini-3.5-flash-lite | 1M | 65,536 | text, image | ✅ | $0.30/$2.50 |
123
141
  | gemini-3.1-pro | 1M | 65,536 | text, image | ✅ | $2.00/$12.00 |
124
- | gemini-3.1-flash-lite | 1M | 65,535 | text, image | ✅ | $0.25/$1.50 |
125
- | gemini-3-pro | 1M | 65,536 | text, image | ✅ | $2.00/$12.00 |
142
+ | gemini-3.1-flash-lite | 1M | 65,536 | text, image | ✅ | $0.25/$1.50 |
126
143
  | gemini-3-flash | 1M | 65,536 | text, image | ✅ | $0.50/$3.00 |
127
144
  | gemini-2.5-pro | 1M | 65,536 | text, image | ✅ | $1.25/$10.00 |
128
145
  | gemini-2.5-flash | 1M | 65,536 | text, image | ✅ | $0.30/$2.50 |
129
146
  | gemini-2.5-flash-lite | 1M | 65,536 | text, image | ✅ | $0.10/$0.40 |
130
- | gemini-2.0-flash | 1M | 8,192 | text, image | ❌ | $0.15/$0.60 |
131
- | gemini-2.0-flash-lite | 1M | 8,192 | text, image | ❌ | $0.075/$0.30 |
147
+
148
+ `gemini-4-argon` and `gemini-4-carbon` use introductory pricing of $2.00/$10.00 per 1M tokens (cached input $0.10) through 2026-11-30, rising to $4.00/$20.00 after. Argon supports "long decode" up to 1M output tokens; this extension uses the default 65,536 synchronous limit. `gemini-4-carbon` is a Frontier Model available only to verified enterprise customers.
149
+
150
+ [`gemini-4-neon`](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/gemini/4-neon) is a Frontier Model with a unified 1M input/output limit. This extension uses the 65,536-token foreground segment limit, not long decode. Global input/output prices are $3.00/$15.00 per 1M tokens, with $0.15 cached input; non-global prices are $3.30/$16.50, with $0.165 cached input. Cost tracking uses the endpoint's rates.
151
+
152
+ `gemini-4-hydrogen` is a short-term release: Google retires it with 45 days' notice. Its 1M token limit covers input and output together. Neon and Hydrogen accept the `xhigh` thinking level.
153
+
154
+ Gemini 4 models reject the MINIMAL thinking level, so pi does not offer `minimal` for them.
155
+
156
+ `gemini-3.1-pro` is still a Preview offering on Vertex (API id `gemini-3.1-pro-preview`); everything else in this table is GA.
157
+
158
+ **Retired:** `gemini-2.0-flash` and `gemini-2.0-flash-lite` were shut down on Vertex on 2026-06-01 and have been removed. `gemini-2.5-*` retires on 2026-10-16 — migrate to a 3.x Flash model before then.
132
159
 
133
160
  ### Claude Models
134
161
 
@@ -136,6 +163,14 @@ Prices shown are for the **global** endpoint. Non-global regions (us-east5, euro
136
163
 
137
164
  | Model | Context | Max Tokens | Input | Reasoning | Price global (in/out) | Price regional (in/out) |
138
165
  |-------|---------|------------|-------|-----------|----------------------|------------------------|
166
+ | claude-fable-5-2 | 1M | 128,000 | text, image | ✅ | $8.00/$40.00 | $8.80/$44.00 |
167
+ | claude-opus-5-5 | 1M | 128,000 | text, image | ✅ | $4.00/$20.00 | $4.40/$22.00 |
168
+ | claude-sonnet-5-5 | 1M | 128,000 | text, image | ✅ | $2.00/$10.00 | $2.20/$11.00 |
169
+ | claude-haiku-5-5 | 1M | 128,000 | text, image | ✅ | $0.10/$0.50 | $0.11/$0.55 |
170
+ | claude-fable-5-1 | 1M | 128,000 | text, image | ✅ | $10.00/$50.00 | $11.00/$55.00 |
171
+ | claude-opus-5 | 1M | 128,000 | text, image | ✅ | $5.00/$25.00 | $5.50/$27.50 |
172
+ | claude-sonnet-5 | 1M | 128,000 | text, image | ✅ | $2.00/$10.00 | $2.20/$11.00 |
173
+ | claude-fable-5 | 1M | 128,000 | text, image | ✅ | $10.00/$50.00 | $11.00/$55.00 |
139
174
  | claude-opus-4-8 | 1M | 128,000 | text, image | ✅ | $5.00/$25.00 | $5.50/$27.50 |
140
175
  | claude-opus-4-7 | 1M | 128,000 | text, image | ✅ | $5.00/$25.00 | $5.50/$27.50 |
141
176
  | claude-opus-4-6 | 1M | 128,000 | text, image | ✅ | $5.00/$25.00 | $5.50/$27.50 |
@@ -146,15 +181,22 @@ Prices shown are for the **global** endpoint. Non-global regions (us-east5, euro
146
181
  | claude-opus-4-1 | 200K | 32,000 | text, image | ✅ | $15.00/$75.00 | (uniform) |
147
182
  | claude-opus-4 | 200K | 32,000 | text, image | ✅ | $15.00/$75.00 | (uniform) |
148
183
  | claude-sonnet-4 | 200K | 64,000 | text, image | ✅ | $3.00/$15.00 | (uniform) |
149
- | claude-3-5-sonnet-v2 | 200K | 8,192 | text, image | ❌ | $3.00/$15.00 | (uniform) |
150
184
 
151
- ### Llama Models
185
+ Claude 5, 5.5, and Fable models require provider data sharing on your project's publisher model config. Without it Vertex returns HTTP 403 asking you to set `PublisherModelConfig.data_sharing_enabled_provider`. Fable 5.1 and 5.2 also require the Advanced AI Safety Addendum in Model Garden. Every Claude model must be enabled on its Model Garden card first; until then Vertex returns HTTP 404.
186
+
187
+ `claude-haiku-5-5` prices apply below 100K input tokens. At 100K input tokens or more, every token in the request bills at 5x. Claude 3.5 Sonnet v2 was shut down on Vertex on 2026-02-19 and has been removed.
188
+
189
+ ### Meta Models
152
190
 
153
191
  | Model | Context | Max Tokens | Input | Reasoning | Price (in/out) | Region |
154
192
  |-------|---------|------------|-------|-----------|----------------|--------|
193
+ | muse-wonder-1.0 | 1M | 128,000 | text, image | ✅ | $4.00/$20.00 | global |
194
+ | muse-spark-1.3 | 1M | 128,000 | text, image | ✅ | $1.25/$4.25 | global |
195
+ | muse-ember-1.0 | 1M | 128,000 | text, image | ✅ | $0.10/$0.50 | global |
155
196
  | llama-4-maverick | 524K | 32,000 | text | ✅ | $0.35/$1.15 | global |
156
197
  | llama-4-scout | 1,310K | 32,000 | text | ✅ | $0.25/$0.70 | global |
157
- | llama-3.3-70b | 128K | 8,192 | text | ❌ | $0.72/$0.72 | global |
198
+
199
+ The Muse models are in Preview. They run only on the global endpoint and only through Meta's stateless Responses API (`publishers/meta/v1/responses`), which pi-vertex calls for them automatically. Their 1,048,576-token context covers input and output together; 128,000 is the default output cap. Reasoning effort is `minimal` to `xhigh`; `muse-ember-1.0` also accepts `max`. At thinking level `off`, pi-vertex sends no effort and the model uses its default. Above 200K input tokens, `muse-ember-1.0` bills every token at 3x.
158
200
 
159
201
  ### Other MaaS Models
160
202
 
@@ -164,25 +206,33 @@ Prices shown are for the **global** endpoint. Non-global regions (us-east5, euro
164
206
  | mistral-small-3.1 | 128K | mistralai | $0.10/$0.30 | global |
165
207
  | mistral-ocr | 30 pages | mistralai | $0.0005/page | global |
166
208
  | codestral-2 | 128K | mistralai | $0.30/$0.90 | global |
167
- | deepseek-v3.2 | 163K | deepseek-ai | $0.56/$1.68 | global |
168
- | deepseek-v3.1 | 163K | deepseek-ai | $0.60/$1.70 | global |
169
- | deepseek-r1 | 163K | deepseek-ai | $1.35/$5.40 | global |
170
- | deepseek-ocr | Varies | deepseek-ai | $0.0003/page | global |
171
- | qwen3-235b | 262K | qwen | $0.22/$0.88 | global |
172
- | qwen3-next-instruct | 262K | qwen | $0.15/$1.20 | global |
173
- | qwen3-next-thinking | 262K | qwen | $0.15/$1.20 | global |
174
- | qwen3-coder | 262K | qwen | $0.22/$1.80 | global |
209
+ | deepseek-v4.1-flash | 1M | deepseek-ai | $0.30/$1.20 | global |
210
+ | deepseek-v4.1-flash-1017 | 1M | deepseek-ai | $0.30/$1.20 | global |
211
+ | gpt-6.2-astra | 1,050K | openai | $8.00/$40.00 (estimate) | global |
212
+ | gpt-6.2-sol | 1,050K | openai | $2.00/$10.00 (estimate) | global |
213
+ | gpt-6-astra | 1,050K | openai | $10.00/$50.00 (estimate) | global |
214
+ | gpt-6.1-sol | 1,050K | openai | $2.00/$10.00 (estimate) | global |
215
+ | gpt-6.1-terra | 1,050K | openai | $1.00/$5.00 (estimate) | global |
216
+ | gpt-6-luna | 1,050K | openai | $0.10/$0.50 (estimate) | global |
175
217
  | gpt-oss-120b | 131K | openai | $0.09/$0.36 | global |
176
- | gpt-oss-20b | 131K | openai | $0.07/$0.25 | global |
177
- | kimi-k2-thinking | 262K | moonshotai | $0.60/$2.50 | global |
178
- | minimax-m2 | 196K | minimaxai | $0.30/$1.20 | global |
179
- | glm-5 | 200K | zai-org | $1.00/$3.20 | global |
180
- | glm-4.7 | 200K | zai-org | $0.60/$2.20 | global |
218
+ | glm-5.2 | 1M | zai-org | $1.40/$4.40 | global |
219
+ | grok-4.7 | 524K | xai | $2.00/$6.00 | global |
220
+ | grok-4.6 | 524K | xai | $2.00/$6.00 | global |
181
221
  | grok-4.3 | 1M | xai | $1.25/$2.50 | global |
182
222
  | grok-4.20-reasoning | 1M | xai | $1.25/$2.50 | global |
183
- | grok-4.1-fast-reasoning | 2M | xai | $0.20/$0.50 | global |
223
+ | grok-4.20-non-reasoning | 1M | xai | $1.25/$2.50 | global |
184
224
  | gemma-4-26b-a4b-it | 262K | google | $0.15/$0.60 | global |
185
225
 
226
+ `deepseek-v4.1-flash` and `deepseek-v4.1-flash-1017` accept text and image input. They think only when a reasoning effort is set (`minimal` to `high`, or `max`); at thinking level `off` they answer without thinking. Flash 1017 cached input costs $0.006 per 1M tokens, compared with $0.03 for the original Flash.
227
+
228
+ [OpenAI GPT-6 models](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/partner-models/openai) require Private Preview access, a Marketplace private offer, and Model Garden enablement with the Advanced AI Safety Addendum. They use the publisher Responses API, not Chat Completions. They accept text and images, support tools, and have a 1,050,000-token combined context (922,000 max input, 128,000 max output). Use `GOOGLE_CLOUD_LOCATION=global`.
229
+
230
+ GPT-6 reasoning levels are `low`, `medium`, `high`, `xhigh`, and `max`. At `off`, Astra and Sol use the model default; Terra and Luna send `none` to disable reasoning. Requests omit reasoning summaries and preserve encrypted reasoning for tool replay. `store: false` makes requests stateless; it does **not** enable Zero Data Retention, which requires separate project approval.
231
+
232
+ **GPT-6 cost estimates:** Google does not list these models on its public partner-pricing page. Displayed costs use [OpenAI's public Standard API model rates](https://developers.openai.com/api/docs/models), at up to 272K input tokens. Your Vertex private-offer prices can differ. Long-context surcharges and explicit cache-write charges are not tracked.
233
+
234
+ **Retired:** Google shut down these open model endpoints on 2026-10-21, and they have been removed: `deepseek-v3.2`, `deepseek-v3.1`, `deepseek-r1`, `deepseek-ocr`, `qwen3-235b`, `qwen3-next-instruct`, `qwen3-next-thinking`, `qwen3-coder`, `gpt-oss-20b`, `kimi-k2-thinking`, `minimax-m2`, `glm-5`, `glm-4.7`, and `llama-3.3-70b`. `grok-4.1-fast-reasoning` was shut down on 2026-08-20 and has also been removed.
235
+
186
236
  ## Regional Endpoints
187
237
 
188
238
  Models use different endpoints based on availability:
@@ -227,8 +277,8 @@ export GOOGLE_CLOUD_LOCATION=us-central1
227
277
  - `@google/genai`: Google GenAI SDK for Gemini models
228
278
  - `@anthropic-ai/vertex-sdk`: Official Anthropic-on-Vertex SDK for Claude models (native streaming)
229
279
  - `google-auth-library`: ADC authentication for all models
230
- - `@mariozechner/pi-ai`: Peer dependency
231
- - `@mariozechner/pi-coding-agent`: Peer dependency
280
+ - `@earendil-works/pi-ai`: Peer dependency
281
+ - `@earendil-works/pi-coding-agent`: Peer dependency
232
282
 
233
283
  ## Acknowledgments
234
284
 
package/TEST_COVERAGE.md CHANGED
@@ -1,14 +1,48 @@
1
1
  # Test Coverage
2
2
 
3
3
  ## Current Status
4
- - Automated tests: not yet implemented in this package.
5
- - Lint/type checks: `npm run check` (currently a no-op placeholder).
4
+ - Automated tests: `npm test` runs two files. `tests/first-byte-timeout-check.mjs` covers a dead stream, a slow-starting stream, and keepalive stripping on Chat Completions, plus dead streams on Meta and OpenAI publisher Responses URLs. `tests/model-catalog-check.mjs` checks new model metadata, unique IDs, supported thinking levels, GPT Responses routing and payload hooks, encrypted tool replay, and unchanged Muse requests. Catalog/request tests use synthetic SSE and stubbed authentication; they make no network requests.
5
+ - Lint/type checks: `npm run check` remains a no-op. `bunx --package typescript@5.9.3 tsc --noEmit` passes for v1.4.0.
6
6
 
7
7
  ## Manual Verification
8
+
9
+ ### v1.4.0 additions (2026-11-20)
10
+ - The registry loads 58 models with unique IDs. Pi 0.99.1's `-ne -e ./index.ts --list-models` shows all nine added IDs.
11
+ - Live two-turn tool round trips through `streamVertex` passed on the global endpoint. Each model called `lookup_probe`, received its result, and returned the marker:
12
+ - `gemini-4-neon`: `xhigh` and unsupported `minimal` (floored to LOW).
13
+ - `deepseek-v4.1-flash-1017`: off and `max`.
14
+ - `grok-4.20-non-reasoning`: off.
15
+ - Regression: `muse-ember-1.0` at `minimal`.
16
+ - Neon on the `us` endpoint returned `NEON_US_OK`. Its reported usage cost matched the regional $3.30/$16.50 rates exactly.
17
+ - Pi end-to-end, with explicit `-e ./index.ts`, `--no-session`, and no tools: Neon at `xhigh` returned `NEON_PI_OK`; DeepSeek 1017 at `max` returned `DEEPSEEK_PI_OK`; Grok Non-Reasoning returned `GROK_PI_OK`.
18
+ - Direct API probes confirmed DeepSeek 1017 accepts `minimal` and `max`, and rejects `xhigh` and `none` with HTTP 400.
19
+
20
+ ### Earlier releases
8
21
  - Claude 4.6 streaming verified via Anthropic Vertex SDK.
9
22
  - Mid-session model switching (tool call replay) verified interactively in pi.
10
23
  - Registry sanity checks verified locally for `claude-opus-4-8` and `grok-4.3` after model additions.
24
+ - v1.2.2 catalog checks run against `models/index.ts`: 52 models load, no duplicate ids, the retired `gemini-2.0-*` ids no longer resolve, and `gemini-3.8-flash`, `glm-5.2`, and `grok-4.6` resolve with their expected API ids, context windows, output caps, and pricing.
25
+ - v1.2.5 catalog checks: 55 models load, no duplicate ids, and `claude-opus-5-5`, `claude-sonnet-5-5`, `claude-fable-5-1` resolve with Vertex API ids (no date suffix), 1M context, 128K max output, and published global/regional prices.
26
+ - v1.2.1 streaming source check confirms Gemini 3.8 uses the Gemini 3 `thinkingLevel` path and floors unsupported `minimal` effort to `low`.
27
+ - `bun build index.ts --outdir /tmp/pi-vertex-build-maas --target node` completes successfully.
28
+ - v1.3.0 catalog checks: 49 models load with no duplicate ids. The id diff against v1.2.7 is exactly 8 added and 16 removed. Of the surviving entries, only GLM 5.2's cacheRead changed. `getSupportedThinkingLevels` returns these sets:
29
+ - Hydrogen: off/low/medium/high/xhigh
30
+ - Carbon and Argon: off/low/medium/high
31
+ - Muse Wonder and Spark: off/minimal..xhigh
32
+ - Muse Ember: those levels plus max
33
+ - DeepSeek V4.1 Flash: off/minimal..high/max
34
+ - v1.3.0 live checks, run 2026-11-15 on the global endpoint through `streamVertex`. Each was a two-turn tool round trip: the model calls `get_weather`, gets the tool result, and answers.
35
+ - Passed: `gemini-4-hydrogen` (default, `minimal`→LOW, `xhigh`→XHIGH), `gemini-4-carbon` (`medium`, `minimal`→LOW), `gemini-4-argon` (`xhigh`→HIGH), `muse-wonder-1.0` (`xhigh`, `medium`), `muse-spark-1.3` (default), `muse-ember-1.0` (`max`, `minimal` with `sessionId`), `deepseek-v4.1-flash` (off, `high`, `max`), `glm-5.2`.
36
+ - Regression checks also passed: `grok-4.6`, `grok-4.3`, `claude-sonnet-5-5`, `gpt-oss-120b`, `gemini-3.8-flash`.
37
+ - The request bodies were captured with a fetch spy. They confirmed the thinking level or effort sent for each case, `store: false` and encrypted reasoning replay on Muse, and that `reasoning_effort` is omitted for DeepSeek at off.
38
+ - v1.3.0 Pi end-to-end: `pi -ne -e ./index.ts -p` answered on `vertex/muse-wonder-1.0:xhigh`, `muse-ember-1.0:max`, `gemini-4-hydrogen:xhigh`, `gemini-4-carbon:xhigh` (clamped to high), and `deepseek-v4.1-flash:high`. `--list-models` shows all 8 new ids.
39
+ - Direct API probes confirmed the reasoning effort values each model accepts. Muse Wonder and Spark accept minimal..xhigh, and Muse Ember adds max; all three reject `none`. DeepSeek V4.1 Flash accepts minimal/low/medium/high/max and rejects `xhigh` and `none`. All 16 removed ids return HTTP 404.
11
40
 
12
41
  ## Gaps / Next Steps
42
+ - **No OpenAI GPT-6 live request succeeded.** Global publisher Responses probes returned HTTP 429 for `gpt-6.2-astra` and `gpt-6.2-sol`, and HTTP 404 (not found or no project access) for `gpt-6-astra`, `gpt-6.1-sol`, `gpt-6.1-terra`, and `gpt-6-luna`. Routing, payload compatibility, and encrypted replay are verified with synthetic responses, not live inference. Limits come from Google's model pages; displayed cost estimates come from OpenAI's public API model pages, not a Vertex private offer.
43
+ - **No live request has succeeded against `claude-fable-5-2`, `claude-haiku-5-5`, or `grok-4.7`.** All three return HTTP 404 ("not found or your project does not have access") because they are not enabled in the test project's Model Garden. Their API ids, limits, and prices come from the Google Cloud model pages and the pricing page.
44
+ - No live request has been made against `gemini-3.7-flash`, `gemini-3.6-flash`, `gemini-3.5-flash-lite`, `claude-opus-5-5`, `claude-fable-5-1`, `claude-opus-5`, or `claude-sonnet-5`.
45
+ - Promotion of `gemini-3.1-flash-lite` off its `-preview` API id is likewise unverified against a live endpoint.
13
46
  - Add automated integration tests for Anthropic Vertex streaming and tool replay.
14
47
  - Add unit tests for message normalization and replay sequencing.
48
+ - Extend the catalog regression test to check retired model IDs.
package/auth.ts CHANGED
@@ -5,7 +5,6 @@
5
5
  * Resolution order for each value: config file → env var → default
6
6
  */
7
7
 
8
- import { GoogleAuth } from "google-auth-library";
9
8
  import { existsSync } from "fs";
10
9
  import { join } from "path";
11
10
  import { homedir } from "os";
@@ -84,6 +83,7 @@ export function getAuthConfig(preferredRegion?: string): AuthConfig {
84
83
  */
85
84
  export async function getAccessToken(): Promise<string> {
86
85
  const config = loadConfig();
86
+ const { GoogleAuth } = await import("google-auth-library");
87
87
  const auth = new GoogleAuth({
88
88
  scopes: ["https://www.googleapis.com/auth/cloud-platform"],
89
89
  ...(config.googleApplicationCredentials ? { keyFile: config.googleApplicationCredentials } : {}),
package/config.ts CHANGED
@@ -13,7 +13,7 @@
13
13
  * }
14
14
  */
15
15
 
16
- import { getAgentDir } from "@mariozechner/pi-coding-agent";
16
+ import { getAgentDir } from "@earendil-works/pi-coding-agent";
17
17
  import { readFileSync, existsSync } from "node:fs";
18
18
  import { join } from "node:path";
19
19
 
package/index.ts CHANGED
@@ -21,14 +21,18 @@
21
21
  * GOOGLE_APPLICATION_CREDENTIALS (optional, for service account auth)
22
22
  *
23
23
  * Usage:
24
+ * pi --provider vertex --model claude-opus-5-5
24
25
  * pi --provider vertex --model claude-opus-4-8
26
+ * pi --provider vertex --model grok-4.6
25
27
  * pi --provider vertex --model grok-4.3
28
+ * pi --provider vertex --model glm-5.2
29
+ * pi --provider vertex --model gemini-3.8-flash
26
30
  * pi --provider vertex --model gemini-2.5-pro
27
31
  * pi --provider vertex --model llama-4-maverick
28
32
  */
29
33
 
30
- import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
31
- import type { Model, Api } from "@mariozechner/pi-ai";
34
+ import type { ExtensionAPI, ProviderModelConfig } from "@earendil-works/pi-coding-agent";
35
+ import type { Model, Api } from "@earendil-works/pi-ai";
32
36
  import { ALL_MODELS, getModelById } from "./models/index.js";
33
37
  import { hasAdcCredentials, resolveProjectId } from "./auth.js";
34
38
  import { loadConfig, getConfigPath } from "./config.js";
@@ -36,16 +40,19 @@ import { streamVertex } from "./streaming/index.js";
36
40
  import type { VertexModelConfig } from "./types.js";
37
41
 
38
42
  /**
39
- * Convert Vertex model config to Pi model format
43
+ * Convert Vertex model config to Pi's per-model provider config.
44
+ * No `baseUrl`/`provider` here: those live on the provider config passed to
45
+ * registerProvider, and per-model entries must omit baseUrl so pi-coding-agent's
46
+ * `definition.baseUrl ?? providerConfig.baseUrl` fallback can apply (an explicit
47
+ * "" defeats that nullish-coalescing fallback and fails provider registration).
40
48
  */
41
- function toPiModel(config: VertexModelConfig): Model<Api> {
49
+ function toPiModel(config: VertexModelConfig): ProviderModelConfig {
42
50
  return {
43
51
  id: config.id,
44
52
  name: config.name,
45
53
  api: "vertex-unified",
46
- provider: "vertex",
47
- baseUrl: "", // Will be set dynamically
48
54
  reasoning: config.reasoning,
55
+ thinkingLevelMap: config.thinkingLevelMap,
49
56
  input: config.input,
50
57
  cost: config.cost,
51
58
  contextWindow: config.contextWindow,
@@ -118,7 +125,9 @@ export default function (pi: ExtensionAPI) {
118
125
  ];
119
126
  pi.on("session_start", async (_event, ctx) => {
120
127
  ctx.ui.setWidget("pi-vertex-startup", (_tui, theme) => ({
121
- render: () => [...vertexStartupLines.map(l => theme.fg("muted", l)), ""],
128
+ // A line wider than the terminal is a fatal render error in Pi. These lines are ASCII
129
+ // (GCP project ids are [a-z0-9-]), so length is their width.
130
+ render: (width: number) => [...vertexStartupLines.map(l => theme.fg("muted", l.length > width ? `${l.slice(0, Math.max(0, width - 1))}…` : l)), ""],
122
131
  invalidate: () => {},
123
132
  }));
124
133
  });