pi-model-manager 0.4.0 → 0.4.3

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/README.en.md CHANGED
@@ -4,7 +4,7 @@ English · [简体中文](./README.md)
4
4
 
5
5
  [![Pi](https://img.shields.io/badge/Pi-%3E%3D0.85.1-6f42c1)](https://github.com/earendil-works/pi)
6
6
  [![License](https://img.shields.io/badge/license-AGPL--3.0-blue.svg)](./LICENSE)
7
- [![Version](https://img.shields.io/badge/version-0.3.7-2f81f7.svg)](https://github.com/Qihuanxishini/pi-model-manager)
7
+ [![npm](https://img.shields.io/npm/v/pi-model-manager?color=2f81f7)](https://www.npmjs.com/package/pi-model-manager)
8
8
 
9
9
  A TUI model and provider manager for [Pi](https://github.com/earendil-works/pi). It keeps Pi's native `models.json` as the single source of truth for model configuration while adding provider/model editing, client-header identities, proxy routing, and protocol compatibility controls.
10
10
 
@@ -89,11 +89,11 @@ Ctrl+S 保存并启用模型;不切换当前会话模型
89
89
  模型 ID gpt-5.6-sol
90
90
  重新拉取 上游模型列表
91
91
  显示名称 默认 = 模型 ID
92
- ❯ 视觉支持 ← 开启 →
93
- Thinking ← 开启 →
94
- Fast mode ← 关闭 →
95
- 上下文窗口 ← 1050000 →
96
- 最大输出 ← 128000 →
92
+ ❯ 视觉支持 ◀ 开启 ▶
93
+ Thinking ◀ 开启 ▶
94
+ Fast mode ◀ 标准 ▶
95
+ 上下文窗口 ◀ 1050000 ▶
96
+ 最大输出 ◀ 128000 ▶
97
97
  请求头 跟随接入(Auto→Codex)
98
98
 
99
99
  ↑↓ 选择 ←→ 切换选项 Enter 编辑 Ctrl+S 保存并启用 Esc 返回
@@ -113,7 +113,7 @@ Ctrl+S 保存并启用模型;不切换当前会话模型
113
113
  gpt-5.4-mini
114
114
  gpt-5.5
115
115
  gpt-5.6-luna
116
- ❯ gpt-5.6-sol ← 当前
116
+ ❯ gpt-5.6-sol ● 当前
117
117
  gpt-5.6-terra
118
118
  gpt-image-2
119
119
 
@@ -132,7 +132,7 @@ Ctrl+S 保存并启用模型;不切换当前会话模型
132
132
  - Fetch model IDs from compatible upstream APIs or enter them manually.
133
133
  - Configure context window, maximum output, vision support, and reasoning support.
134
134
  - Choose Anthropic Adaptive Thinking or Legacy Thinking.
135
- - Enable `service_tier=priority` (Fast mode) per OpenAI Responses model.
135
+ - Select Standard, Fast (`priority`), or Ultrafast (`ultrafast`) service tiers per OpenAI Responses model.
136
136
  - Route each provider directly or through its own HTTP(S) proxy.
137
137
  - Use recommended, disabled, Claude Code, Codex, or custom client-header profiles.
138
138
  - Reference API keys as literals, `$ENV_VAR` / `${ENV_VAR}`, or Pi `!command` values.
@@ -226,9 +226,23 @@ Model capabilities include:
226
226
  - Vision support (text only, or text + image input)
227
227
  - Reasoning support
228
228
  - Anthropic Adaptive/Legacy Thinking
229
- - OpenAI Responses Fast mode
229
+ - OpenAI Responses Standard / Fast / Ultrafast service tiers
230
230
  - Context window and maximum output tokens
231
231
 
232
+ ### Responses service tiers
233
+
234
+ For `openai-responses`, the model editor shows **Fast mode**. Cycle through the three tiers with `←` / `→`, or press `Enter` for the full descriptions. The model list also shows the selected tier. The Chinese UI uses 标准 / Fast / Ultrafast.
235
+
236
+ | Tier | Request behavior |
237
+ | --- | --- |
238
+ | Standard | Default; does not inject `service_tier`, leaving the upstream default policy unchanged |
239
+ | Fast | Injects `service_tier: "priority"` |
240
+ | Ultrafast | Injects `service_tier: "ultrafast"` |
241
+
242
+ An explicit `service_tier` already present in the request takes precedence and is not overwritten. Standard does not force `service_tier: "default"`; switching back to Standard does not remove a value explicitly set by the caller. Existing Fast settings remain `priority`.
243
+
244
+ Fast and Ultrafast require support from the upstream service, account, and model, and may incur additional charges. The extension only injects request parameters; it does not detect the tier ultimately served or billed. Refer to the upstream response and billing records.
245
+
232
246
  ## Client-header profiles
233
247
 
234
248
  | Profile | Behavior |
@@ -255,7 +269,7 @@ Explicit native headers override built-in templates; selecting a custom profile
255
269
  | Path | Purpose |
256
270
  | --- | --- |
257
271
  | `~/.pi/agent/models.json` | Native Pi provider and model definitions; the single source of truth for model configuration |
258
- | `~/.pi/agent/extensions/pi-model-manager/state.json` | Private metadata such as header choices, custom profiles, proxy switches, Fast mode, and Anthropic custom endpoint markers |
272
+ | `~/.pi/agent/extensions/pi-model-manager/state.json` | Private metadata such as header choices, custom profiles, proxy switches, Responses service tiers, and Anthropic custom endpoint markers |
259
273
 
260
274
  The extension generates client headers, proxy routes, and dynamic registrations only for explicitly managed providers. Ownership requires both a managed ID in `state.json` and a `piModelManager.managed` marker on the Provider node in `models.json`; this prevents a deleted Provider ID from silently taking ownership of an unrelated native Provider that later reuses the same ID. Native providers without this ownership evidence remain unmanaged: saving unrelated settings does not rewrite their existing headers or unknown native fields. Built-in Pi providers cannot be edited or deleted through this extension.
261
275
 
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  [![Pi](https://img.shields.io/badge/Pi-%3E%3D0.85.1-6f42c1)](https://github.com/earendil-works/pi)
6
6
  [![License](https://img.shields.io/badge/license-AGPL--3.0-blue.svg)](./LICENSE)
7
- [![Version](https://img.shields.io/badge/version-0.3.7-2f81f7.svg)](https://github.com/Qihuanxishini/pi-model-manager)
7
+ [![npm](https://img.shields.io/npm/v/pi-model-manager?color=2f81f7)](https://www.npmjs.com/package/pi-model-manager)
8
8
 
9
9
  一个面向 [Pi](https://github.com/earendil-works/pi) 的 TUI 模型与接入管理扩展。它以 Pi 原生 `models.json` 为模型配置的唯一权威来源,并提供接入/模型编辑、请求头身份、代理路由和协议兼容配置。
10
10
 
@@ -89,11 +89,11 @@ Ctrl+S 保存并启用模型;不切换当前会话模型
89
89
  模型 ID gpt-5.6-sol
90
90
  重新拉取 上游模型列表
91
91
  显示名称 默认 = 模型 ID
92
- ❯ 视觉支持 ← 开启 →
93
- Thinking ← 开启 →
94
- Fast mode ← 关闭 →
95
- 上下文窗口 ← 1050000 →
96
- 最大输出 ← 128000 →
92
+ ❯ 视觉支持 ◀ 开启 ▶
93
+ Thinking ◀ 开启 ▶
94
+ Fast mode ◀ 标准 ▶
95
+ 上下文窗口 ◀ 1050000 ▶
96
+ 最大输出 ◀ 128000 ▶
97
97
  请求头 跟随接入(Auto→Codex)
98
98
 
99
99
  ↑↓ 选择 ←→ 切换选项 Enter 编辑 Ctrl+S 保存并启用 Esc 返回
@@ -113,7 +113,7 @@ Ctrl+S 保存并启用模型;不切换当前会话模型
113
113
  gpt-5.4-mini
114
114
  gpt-5.5
115
115
  gpt-5.6-luna
116
- ❯ gpt-5.6-sol ← 当前
116
+ ❯ gpt-5.6-sol ● 当前
117
117
  gpt-5.6-terra
118
118
  gpt-image-2
119
119
 
@@ -132,7 +132,7 @@ Ctrl+S 保存并启用模型;不切换当前会话模型
132
132
  - 从兼容上游拉取模型 ID,也可手动填写模型。
133
133
  - 配置上下文窗口、最大输出、视觉支持和 Thinking。
134
134
  - 支持 Anthropic Adaptive Thinking 与 Legacy Thinking。
135
- - 可为 OpenAI Responses 模型启用 `service_tier=priority`(Fast mode)。
135
+ - 为 OpenAI Responses 模型选择标准、Fast(`priority`)或 Ultrafast(`ultrafast`)速度档位。
136
136
  - 为每个接入单独配置直连或 HTTP(S) 代理。
137
137
  - 提供自动推荐、禁用、Claude Code、Codex 和自定义请求头模式。
138
138
  - API key 支持字面值、`$ENV_VAR` / `${ENV_VAR}` 和 Pi 的 `!command` 引用。
@@ -230,9 +230,23 @@ Anthropic 标准端点在写入 `models.json` 时转换为 Pi 原生 SDK 所需
230
230
  - 视觉支持(仅文本或文本 + 图片输入)
231
231
  - Thinking 开关
232
232
  - Anthropic Adaptive/Legacy Thinking 协议
233
- - OpenAI Responses Fast mode
233
+ - OpenAI Responses 标准 / Fast / Ultrafast 速度档位
234
234
  - Context window 与最大输出 token
235
235
 
236
+ #### Responses 速度档位
237
+
238
+ 当 API 协议为 `openai-responses` 时,模型编辑器会显示 **Fast mode**。用 `←` / `→` 循环切换三档,或按 `Enter` 查看完整说明;模型列表也会显示所选档位。英文界面对应 Standard / Fast / Ultrafast。
239
+
240
+ | 档位 | 请求行为 |
241
+ | --- | --- |
242
+ | 标准 | 默认选项;不主动注入 `service_tier`,沿用上游默认策略 |
243
+ | Fast | 注入 `service_tier: "priority"` |
244
+ | Ultrafast | 注入 `service_tier: "ultrafast"` |
245
+
246
+ 请求中已有显式 `service_tier` 时,扩展不会覆盖。标准档不等于强制发送 `service_tier: "default"`;切换回标准也不会删除调用方显式设置的值。已有 Fast 配置继续保留为 `priority`。
247
+
248
+ Fast 和 Ultrafast 需要上游、账号及模型支持,可能产生额外费用。扩展只负责请求参数注入,不检测上游最终执行或计费的档位;请以上游响应及账单为准。
249
+
236
250
  ## 请求头模式
237
251
 
238
252
  | 模式 | 行为 |
@@ -259,7 +273,7 @@ Anthropic 标准端点在写入 `models.json` 时转换为 Pi 原生 SDK 所需
259
273
  | 路径 | 用途 |
260
274
  | --- | --- |
261
275
  | `~/.pi/agent/models.json` | Pi 原生接入与模型定义;模型配置的唯一权威来源 |
262
- | `~/.pi/agent/extensions/pi-model-manager/state.json` | 请求头选择、自定义请求头、代理开关、Fast mode 和 Anthropic 自定义端点标记等私有元数据 |
276
+ | `~/.pi/agent/extensions/pi-model-manager/state.json` | 请求头选择、自定义请求头、代理开关、Responses 速度档位和 Anthropic 自定义端点标记等私有元数据 |
263
277
 
264
278
  扩展只会为明确受管理的 Provider 生成请求头、代理路由和动态注册配置。所有权由 `state.json` 的受管理 ID 与 `models.json` Provider 节点中的 `piModelManager.managed` 标记共同确认,防止已删除的 Provider ID 在日后被同名原生配置复用时遭到插件接管。没有这些所有权信息的原生 Provider 保持未管理,其已有 Header 和未知原生字段不会因保存其它配置而被改写;Pi 内置 Provider 不在本扩展中提供编辑或删除入口。
265
279
 
package/i18n.ts CHANGED
@@ -38,7 +38,7 @@ const ENGLISH_MESSAGES = {
38
38
  "搜索": "Search",
39
39
  "无匹配项:{query}": "No matches: {query}",
40
40
  "暂无条目": "No entries",
41
- "← 当前": "← current",
41
+ "● 当前": "● current",
42
42
  "移动": "Move",
43
43
  "选择": "Select",
44
44
  "返回": "Back",
@@ -129,7 +129,7 @@ const ENGLISH_MESSAGES = {
129
129
  "最大输出": "Max output",
130
130
  "开启 · 新版协议": "On · current protocol",
131
131
  "关闭 · Legacy": "Off · Legacy",
132
- "开启 · priority": "On · priority",
132
+ "标准": "Standard",
133
133
  "正在拉取模型列表,总计最多 10 秒…": "Fetching the model list (10 seconds maximum)…",
134
134
  "拉取失败:{error}": "Fetch failed: {error}",
135
135
  "手动输入模型 ID(当前:{current})": "Enter a model ID manually (current: {current})",
@@ -145,8 +145,9 @@ const ENGLISH_MESSAGES = {
145
145
  "开启 — 启用模型推理参数": "On — enable reasoning parameters",
146
146
  "开启:新版模型,发送 thinking.type=adaptive 和 output_config.effort": "On: current models; send thinking.type=adaptive and output_config.effort",
147
147
  "关闭:旧版接口,发送 thinking.type=enabled 和 budget_tokens": "Off: legacy API; send thinking.type=enabled and budget_tokens",
148
- "关闭 — 不发送 service_tier(默认)": "Off — do not send service_tier (default)",
149
- "开启 — service_tier=priority,可能消耗 Fast / priority 额度": "On — service_tier=priority; may consume Fast/priority quota",
148
+ "标准 — 不发送 service_tier": "Standard — do not send service_tier",
149
+ "Fast — service_tier=priority,可能产生额外费用": "Fast — service_tier=priority; extra charges may apply",
150
+ "Ultrafast — service_tier=ultrafast,需上游支持且可能产生额外费用": "Ultrafast — service_tier=ultrafast; requires upstream support and may cost extra",
150
151
  "接入 {providerId} · API {api}": "Provider {providerId} · API {api}",
151
152
  "Ctrl+S 保存并启用模型;不切换当前会话模型": "Ctrl+S saves and enables the model without switching the current session model",
152
153
 
@@ -156,7 +157,7 @@ const ENGLISH_MESSAGES = {
156
157
  "<直接输入搜索>": "<type to search>",
157
158
  "匹配 {matched} / {total} · {page}": "Matches {matched} / {total} · {page}",
158
159
  "没有匹配模型;Backspace 删除搜索词,Esc 返回后可手动输入。": "No matching models. Use Backspace to edit the search, or Esc to enter an ID manually.",
159
- " ← 当前": " ← current",
160
+ " ● 当前": " ● current",
160
161
  "↑↓ 选择 · ←→/PgUp/PgDn 翻页 · 输入搜索 · Backspace 删除 · Enter 确认 · Esc 取消": "↑↓ select · ←→/PgUp/PgDn page · type to search · Backspace delete · Enter confirm · Esc cancel",
161
162
 
162
163
  "OpenAI Responses · 标准 instructions/input wire": "OpenAI Responses · standard instructions/input wire",
@@ -24,13 +24,15 @@ export function injectOpenAIServiceTier(
24
24
  if (!model || model.api !== "openai-responses") return undefined;
25
25
  if (!isPayloadRecord(payload)) return undefined;
26
26
  if (payload.model !== model.id) return undefined;
27
+ // [喵喵喵]: 调用方的显式档位保持优先;默认档只是不注入,不强制改写上游策略。
27
28
  if ("service_tier" in payload) return undefined;
28
29
 
29
30
  const storedModel = state.providers[model.provider]?.models.find((candidate) => candidate.id === model.id);
30
- if (storedModel?.openAIServiceTier !== "priority") return undefined;
31
+ const tier = storedModel?.openAIServiceTier;
32
+ if (tier !== "priority" && tier !== "ultrafast") return undefined;
31
33
 
32
34
  return {
33
35
  ...payload,
34
- service_tier: "priority",
36
+ service_tier: tier,
35
37
  };
36
38
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-model-manager",
3
- "version": "0.4.0",
3
+ "version": "0.4.3",
4
4
  "description": "A TUI model and provider manager for Pi with native models.json persistence, request-header profiles, proxy routing, and protocol compatibility.",
5
5
  "type": "module",
6
6
  "main": "./index.ts",
package/state-document.ts CHANGED
@@ -424,8 +424,8 @@ export function buildModelFromDraft(
424
424
 
425
425
  if (thinkingLevelMap) next.thinkingLevelMap = thinkingLevelMap;
426
426
 
427
- if (effectiveApi === "openai-responses" && draft.openAIServiceTier === "priority") {
428
- next.openAIServiceTier = "priority";
427
+ if (effectiveApi === "openai-responses" && (draft.openAIServiceTier === "priority" || draft.openAIServiceTier === "ultrafast")) {
428
+ next.openAIServiceTier = draft.openAIServiceTier;
429
429
  }
430
430
 
431
431
  // [喵喵喵]: 仅在启用推理时维护 Adaptive 思考协议;关闭推理时彻底清理兼容标记,避免误剥离协议头
@@ -37,7 +37,7 @@ const BUILT_IN_CLIENT_HEADER_PROFILE_IDS = new Set<BuiltInClientHeaderProfileId>
37
37
  const RESERVED_REQUEST_HEADER_PROFILE_IDS = new Set(["claude-code", "codex-cli", "claude-code-live", "codex-cli-live"]);
38
38
  const INPUT_KINDS = new Set<ModelInputKind>(["text", "image"]);
39
39
  const THINKING_LEVELS = new Set(Object.freeze(["off", "minimal", "low", "medium", "high", "xhigh", "max"]));
40
- const OPENAI_SERVICE_TIERS = new Set<OpenAIServiceTier>(["priority"]);
40
+ const OPENAI_SERVICE_TIERS = new Set<OpenAIServiceTier>(["priority", "ultrafast"]);
41
41
 
42
42
  interface ProviderMetadata {
43
43
  clientHeaderProfile?: ClientHeaderProfileId;
@@ -15,6 +15,7 @@ import { showOptionPicker, showPersistentFormMenu, padLabel, markAdjustableValue
15
15
  import {
16
16
  describeVisionInput,
17
17
  formatApiShort,
18
+ formatOpenAIServiceTier,
18
19
  getVisionInputChoices,
19
20
  supportsVisionInput,
20
21
  } from "./ui-helpers.ts";
@@ -45,10 +46,6 @@ function describeAnthropicThinkingProtocol(protocol: AnthropicThinkingProtocol):
45
46
  return protocol === "adaptive" ? t("开启 · 新版协议") : t("关闭 · Legacy");
46
47
  }
47
48
 
48
- function describeOpenAIServiceTier(draft: ModelDraft): string {
49
- return draft.openAIServiceTier === "priority" ? t("开启 · priority") : t("关闭");
50
- }
51
-
52
49
  function getIntegerFieldLabel(field: "contextWindow" | "maxTokens"): string {
53
50
  return field === "contextWindow" ? t("上下文窗口") : t("最大输出");
54
51
  }
@@ -111,7 +108,7 @@ export function parsePositiveIntegerWithUnit(rawInput: string): number | undefin
111
108
  return Math.round(num);
112
109
  }
113
110
 
114
- // 开关字段在两个方向上取反;数值字段按 direction 在预设间步进。
111
+ // 开关字段在两个方向上取反;档位字段按 direction 在选项间步进。
115
112
  function applyHorizontalToggle(draft: ModelDraft, fieldId: string, direction: HorizontalDirection): boolean {
116
113
  if (fieldId === "visionInput") {
117
114
  draft.inputKinds = supportsVisionInput(draft.inputKinds) ? ["text"] : ["text", "image"];
@@ -126,7 +123,10 @@ function applyHorizontalToggle(draft: ModelDraft, fieldId: string, direction: Ho
126
123
  return true;
127
124
  }
128
125
  if (fieldId === "openAIServiceTier") {
129
- draft.openAIServiceTier = draft.openAIServiceTier === "priority" ? undefined : "priority";
126
+ const tiers: readonly ModelDraft["openAIServiceTier"][] = [undefined, "priority", "ultrafast"];
127
+ const currentIndex = tiers.indexOf(draft.openAIServiceTier);
128
+ const step = direction === "left" ? -1 : 1;
129
+ draft.openAIServiceTier = tiers[(currentIndex + step + tiers.length) % tiers.length];
130
130
  return true;
131
131
  }
132
132
  if (fieldId === "contextWindow") {
@@ -157,7 +157,7 @@ function buildRows(draft: ModelDraft): FieldRow[] {
157
157
  });
158
158
  }
159
159
  if (shouldShowOpenAIServiceTier(draft)) {
160
- rows.push({ id: "openAIServiceTier", label: "Fast mode", value: describeOpenAIServiceTier(draft), adjustable: true });
160
+ rows.push({ id: "openAIServiceTier", label: "Fast mode", value: formatOpenAIServiceTier(draft.openAIServiceTier), adjustable: true });
161
161
  }
162
162
  rows.push(
163
163
  { id: "contextWindow", label: t("上下文窗口"), value: String(draft.contextWindow), adjustable: true },
@@ -312,10 +312,11 @@ async function editField(
312
312
  ctx,
313
313
  "Fast mode",
314
314
  [
315
- { id: "disabled", tier: undefined, label: t("关闭 — 不发送 service_tier(默认)") },
316
- { id: "priority", tier: "priority", label: t("开启 — service_tier=priority,可能消耗 Fast / priority 额度") },
315
+ { id: "default", tier: undefined, label: t("标准 — 不发送 service_tier") },
316
+ { id: "priority", tier: "priority", label: t("Fast — service_tier=priority,可能产生额外费用") },
317
+ { id: "ultrafast", tier: "ultrafast", label: t("Ultrafast — service_tier=ultrafast,需上游支持且可能产生额外费用") },
317
318
  ] as const satisfies readonly { id: string; tier: ModelDraft["openAIServiceTier"]; label: string }[],
318
- draft.openAIServiceTier === "priority" ? "priority" : "disabled",
319
+ draft.openAIServiceTier ?? "default",
319
320
  );
320
321
  if (choice) draft.openAIServiceTier = choice.tier;
321
322
  return;
@@ -253,7 +253,7 @@ export async function pickModelIdFromList(
253
253
  const absoluteIndex = pageStart + rowIndex;
254
254
  const modelId = visibleModelIds[rowIndex]!;
255
255
  const selected = absoluteIndex === selectedIndex;
256
- const currentSuffix = modelId === normalizedCurrentModelId ? theme.fg("dim", t(" ← 当前")) : "";
256
+ const currentSuffix = modelId === normalizedCurrentModelId ? theme.fg("dim", t(" ● 当前")) : "";
257
257
  const prefix = selected ? "❯ " : " ";
258
258
  const rowText = truncateToWidth(`${prefix}${modelId}${currentSuffix}`, width);
259
259
  // [喵喵喵]: 与列表菜单用同一种选中表现(背景色),避免两套选择器手感不一致。
@@ -81,7 +81,7 @@ export function padLabel(label: string, columns: number): string {
81
81
 
82
82
  // [喵喵喵]: 可左右键切换的行值两侧加滑块标记,让能力直接可见
83
83
  export function markAdjustableValue(value: string): string {
84
- return `← ${value} →`;
84
+ return `◀ ${value} ▶`;
85
85
  }
86
86
 
87
87
  function getSearchText(row: MenuRow): string {
@@ -541,7 +541,7 @@ export async function showOptionPicker<TChoice extends { id: string; label: stri
541
541
  "",
542
542
  choices.map((choice) => ({
543
543
  id: choice.id,
544
- label: choice.id === currentId ? `${choice.label} ${t("← 当前")}` : choice.label,
544
+ label: choice.id === currentId ? `${choice.label} ${t("● 当前")}` : choice.label,
545
545
  })),
546
546
  cursor,
547
547
  {
package/tui/ui-helpers.ts CHANGED
@@ -17,6 +17,7 @@ import type {
17
17
  ApiKind,
18
18
  ClientHeaderProfileId,
19
19
  ModelInputKind,
20
+ OpenAIServiceTier,
20
21
  StoredModel,
21
22
  StoredProvider,
22
23
  StoredRequestHeaderProfile,
@@ -241,6 +242,12 @@ function formatModelThinkingCell(model: StoredModel): string {
241
242
  return model.reasoning ? t("开") : t("关");
242
243
  }
243
244
 
245
+ export function formatOpenAIServiceTier(tier: OpenAIServiceTier | undefined): string {
246
+ if (tier === "priority") return "Fast";
247
+ if (tier === "ultrafast") return "Ultrafast";
248
+ return t("标准");
249
+ }
250
+
244
251
  interface ModelListCells {
245
252
  modelId: string;
246
253
  name: string;
@@ -289,8 +296,8 @@ function getModelListColumns(
289
296
  const thinking: FixedColumn = { text: cells.thinking, width: 8, color: cells.thinking === t("开") ? "accent" : cells.thinking === t("关") ? "dim" : undefined };
290
297
  const context: FixedColumn = { text: cells.context, width: 7, align: "right" };
291
298
  const output: FixedColumn = { text: cells.output, width: 7, align: "right" };
292
- // [喵喵喵]: priority 会消耗 Fast 额度,用 warning 提醒而不是当普通开关。
293
- const fast: FixedColumn = { text: cells.fast, width: 8, color: cells.fast === "priority" ? "warning" : cells.fast === "off" ? "dim" : undefined };
299
+ // [喵喵喵]: priority / ultrafast 都可能额外计费,用 warning 提醒而不是当普通开关。
300
+ const fast: FixedColumn = { text: cells.fast, width: 8, color: cells.fast === "Fast" || cells.fast === "Ultrafast" ? "warning" : cells.fast === t("标准") ? "dim" : undefined };
294
301
 
295
302
  const fullWidth = provider.api === "openai-responses" ? 98 : 88;
296
303
  if (availableWidth >= fullWidth) {
@@ -329,7 +336,7 @@ function getModelListCells(model?: StoredModel): ModelListCells {
329
336
  thinking: formatModelThinkingCell(model),
330
337
  context: formatContextWindow(model.contextWindow),
331
338
  output: formatContextWindow(model.maxTokens),
332
- fast: model.openAIServiceTier === "priority" ? "priority" : "off",
339
+ fast: formatOpenAIServiceTier(model.openAIServiceTier),
333
340
  }
334
341
  : {
335
342
  modelId: t("模型 ID"),
package/types.ts CHANGED
@@ -17,7 +17,7 @@ export type OpenAIResponsesStreamCompletionMode = "standard" | "terminal-event";
17
17
  export type BuiltInClientHeaderProfileId = "claude-code" | "codex-cli";
18
18
  export type ClientHeaderProfileId = "recommended" | "disabled" | BuiltInClientHeaderProfileId | "custom";
19
19
  export type CompatSettings = Record<string, unknown>;
20
- export type OpenAIServiceTier = "priority";
20
+ export type OpenAIServiceTier = "priority" | "ultrafast";
21
21
 
22
22
  export const DEFAULT_PROVIDER_HTTP_PROXY_URL = "http://127.0.0.1:7890";
23
23