@oh-my-pi/pi-catalog 17.2.3 → 17.2.4

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,9 +2,18 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [17.2.4] - 2026-08-01
6
+
7
+ ### Added
8
+
9
+ - Added `AnthropicCompat.streamIdleTimeoutMs` and propagated it through `buildAnthropicCompat` so direct Anthropic provider streams can configure their inter-event idle watchdog.
10
+ - Fixed Ollama Cloud DeepSeek V4 Pro/Flash models (including dated tag variants such as `deepseek-v4-flash:0731`) reporting an incorrect max-output-tokens figure by pinning it to the deployment's enforced 65536-token output ceiling ([#7266](https://github.com/can1357/oh-my-pi/issues/7266)).
11
+
5
12
  ### Fixed
6
13
 
7
14
  - Fixed `gen:models` Codex discovery to union models across every stored OAuth account and fail closed on partial resolution, matching runtime discovery ([#6265](https://github.com/can1357/oh-my-pi/issues/6265)); restored the bundled `gpt-5.4`, `gpt-5.6-sol`, and `gpt-5.3-codex-spark` entries a single-account regen had dropped.
15
+ - Fixed `google-antigravity` models always reporting $0 cost: Antigravity discovery carries no pricing, so the generator now back-fills each model with its Google list price (Gemini ids from the `google` provider, including `-preview` id aliases; Claude ids from `google-vertex`, falling back to `anthropic`).
16
+ - Fixed OpenRouter `deepseek/deepseek-v4-flash-0731` exposing only `high` thinking effort by consuming the live `reasoning.supported_efforts` and `default_effort` metadata and bundling its `low`/`high`/`max` ladder. ([#7307](https://github.com/can1357/oh-my-pi/issues/7307))
8
17
 
9
18
  ## [17.2.3] - 2026-08-01
10
19
 
@@ -5,5 +5,18 @@ export interface OllamaCloudModelManagerConfig {
5
5
  baseUrl?: string;
6
6
  fetch?: FetchImpl;
7
7
  }
8
+ /**
9
+ * Output-token ceiling that Ollama Cloud enforces for the DeepSeek V4 Pro/Flash
10
+ * deployments: `/api/chat` rejects `num_predict` above it with HTTP 400
11
+ * (`max_tokens (...) exceeds model's maximum output tokens (65536)`) even though
12
+ * the model pages advertise a 1M context / 384K output. Ollama's `/api/show`
13
+ * never reports this cap, so the catalog pins it for the affected models
14
+ * (ollama/ollama#16890, #7266). The wire layer clamps `num_predict` to the same
15
+ * value (`OLLAMA_CLOUD_NUM_PREDICT_CAP` in `packages/ai/src/providers/ollama.ts`,
16
+ * #3392/#3394).
17
+ */
18
+ export declare const OLLAMA_CLOUD_MAX_OUTPUT_TOKENS = 65536;
19
+ /** Whether an Ollama Cloud model id (tagged or not) enforces the 65536 output cap. */
20
+ export declare function isOllamaCloudOutputCapped(id: string): boolean;
8
21
  export declare function normalizeOllamaCloudBaseUrl(baseUrl?: string): string;
9
22
  export declare function ollamaCloudModelManagerOptions(config?: OllamaCloudModelManagerConfig): ModelManagerOptions<"ollama-chat">;
@@ -362,6 +362,15 @@ export interface OpenAICompat {
362
362
  * that proxy gateways (Vertex AI, AWS Bedrock-style fronts, etc.) reject.
363
363
  */
364
364
  export interface AnthropicCompat {
365
+ /**
366
+ * Stream-watchdog idle-timeout fallback in ms for slow reasoning hosts.
367
+ * Set to 0 to disable the inter-event idle watchdog entirely, matching
368
+ * `OpenAICompat.streamIdleTimeoutMs`.
369
+ *
370
+ * When unset, direct Anthropic streams use `PI_STREAM_IDLE_TIMEOUT_MS`,
371
+ * then the legacy `PI_OPENAI_STREAM_IDLE_TIMEOUT_MS` alias, then 300s.
372
+ */
373
+ streamIdleTimeoutMs?: number;
365
374
  /**
366
375
  * Drop the top-level `strict: true` field on tool definitions. Vertex AI's
367
376
  * Anthropic-compatible endpoint rejects unknown tool fields with
@@ -605,7 +614,13 @@ export interface ResolvedOpenAIResponsesCompat extends ResolvedOpenAISharedCompa
605
614
  */
606
615
  export type ResolvedOpenRouterCompat = ResolvedOpenAICompat & ResolvedOpenAIResponsesCompat;
607
616
  /** Fully-resolved anthropic-messages compat view (same contract as `ResolvedOpenAICompat`). */
608
- export type ResolvedAnthropicCompat = Required<AnthropicCompat> & {
617
+ export type ResolvedAnthropicCompat = Required<Omit<AnthropicCompat, "streamIdleTimeoutMs">> & {
618
+ /**
619
+ * Stream-watchdog idle-timeout fallback in ms for slow reasoning hosts; 0 disables the idle watchdog.
620
+ * Undefined defers to `PI_STREAM_IDLE_TIMEOUT_MS`, then the legacy
621
+ * `PI_OPENAI_STREAM_IDLE_TIMEOUT_MS` alias, then 300s.
622
+ */
623
+ streamIdleTimeoutMs?: number;
609
624
  /**
610
625
  * The configured endpoint is the official first-party Anthropic API
611
626
  * (https + exact `api.anthropic.com` host; a missing baseUrl counts as
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@oh-my-pi/pi-catalog",
4
- "version": "17.2.3",
4
+ "version": "17.2.4",
5
5
  "description": "Model catalog for omp: bundled model database, provider discovery descriptors, model identity, classification, and equivalence",
6
6
  "homepage": "https://omp.sh",
7
7
  "author": "Can Boluk",
@@ -35,12 +35,12 @@
35
35
  },
36
36
  "dependencies": {
37
37
  "@bufbuild/protobuf": "^2.12.1",
38
- "@oh-my-pi/pi-utils": "17.2.3",
38
+ "@oh-my-pi/pi-utils": "17.2.4",
39
39
  "arktype": "2.2.3",
40
40
  "zod": "^4"
41
41
  },
42
42
  "devDependencies": {
43
- "@oh-my-pi/pi-ai": "17.2.3",
43
+ "@oh-my-pi/pi-ai": "17.2.4",
44
44
  "@types/bun": "^1.3.14"
45
45
  },
46
46
  "engines": {
@@ -172,6 +172,7 @@ export function buildAnthropicCompat(spec: ModelSpec<"anthropic-messages">): Res
172
172
  // id or baseUrl marker.
173
173
  replayUnsignedThinking: !signingEndpoint && (Boolean(spec.reasoning) || modelMatchesHost(spec, "deepseekFamily")),
174
174
  escapeBuiltinToolNames: modelMatchesHost(spec, "umans"),
175
+ streamIdleTimeoutMs: spec.compat?.streamIdleTimeoutMs,
175
176
  };
176
177
  applyCompatOverrides(compat, spec.compat);
177
178
  return compat;
@@ -62,8 +62,8 @@ const GEMINI_3_FLASH_EFFORTS: readonly Effort[] = [Effort.Minimal, Effort.Low, E
62
62
  const GPT_5_2_PLUS_EFFORTS: readonly Effort[] = [Effort.Low, Effort.Medium, Effort.High, Effort.XHigh];
63
63
  const GPT_5_1_CODEX_MINI_EFFORTS: readonly Effort[] = [Effort.Medium, Effort.High];
64
64
  const LOW_MEDIUM_HIGH_REASONING_EFFORTS: readonly Effort[] = [Effort.Low, Effort.Medium, Effort.High];
65
- /** Kimi K3's wire-exact mandatory reasoning scale. */
66
- const KIMI_K3_REASONING_EFFORTS: readonly Effort[] = [Effort.Low, Effort.High, Effort.Max];
65
+ /** Wire-exact `low`/`high`/`max` scale used by Kimi K3 and OpenRouter DeepSeek V4 Flash 0731. */
66
+ const LOW_HIGH_MAX_REASONING_EFFORTS: readonly Effort[] = [Effort.Low, Effort.High, Effort.Max];
67
67
  /** Wire-exact two-tier scale (`high`/`max`): GLM-5.2 on Z.ai/Umans/Ollama Cloud/Baseten, Sakana Fugu, DeepSeek. */
68
68
  const HIGH_MAX_REASONING_EFFORTS: readonly Effort[] = [Effort.High, Effort.Max];
69
69
  /** OpenRouter's DeepSeek route accepts only `high`. */
@@ -339,7 +339,7 @@ function getModelDefinedEfforts<TApi extends Api>(
339
339
  }
340
340
  }
341
341
  if (isKimiK3ModelId(spec.id)) {
342
- return KIMI_K3_REASONING_EFFORTS;
342
+ return LOW_HIGH_MAX_REASONING_EFFORTS;
343
343
  }
344
344
  if (isSakanaFuguReasoningModel(spec)) {
345
345
  return HIGH_MAX_REASONING_EFFORTS;
@@ -366,9 +366,14 @@ function getModelDefinedEfforts<TApi extends Api>(
366
366
  return OLLAMA_REASONING_EFFORTS;
367
367
  }
368
368
  if (isOpenAICompatReasoningApi(spec.api) && isDeepseekReasoningModel(spec)) {
369
- // DeepSeek's reasoning_effort accepts only high/max; OpenRouter's
370
- // DeepSeek route tops out at high.
371
- return isOpenRouterThinkingFormat(compat) ? HIGH_ONLY_REASONING_EFFORTS : HIGH_MAX_REASONING_EFFORTS;
369
+ // OpenRouter generally exposes only high for DeepSeek, but V4 Flash 0731
370
+ // advertises and accepts the wire-exact low/high/max ladder.
371
+ if (isOpenRouterThinkingFormat(compat)) {
372
+ return bareModelId(spec.id) === "deepseek-v4-flash-0731"
373
+ ? LOW_HIGH_MAX_REASONING_EFFORTS
374
+ : HIGH_ONLY_REASONING_EFFORTS;
375
+ }
376
+ return HIGH_MAX_REASONING_EFFORTS;
372
377
  }
373
378
  if (spec.provider === "baseten" && isOpenAIGptOssModelId(spec.id)) {
374
379
  // Baseten's gpt-oss router mirrors its GLM route: high/max only.
package/src/models.json CHANGED
@@ -11768,8 +11768,7 @@
11768
11768
  ],
11769
11769
  "supportsDisplay": true
11770
11770
  },
11771
- "supportsComputerUse": false,
11772
- "supportsComputerUseConfig": false
11771
+ "supportsComputerUse": false
11773
11772
  },
11774
11773
  "claude-opus-4-0": {
11775
11774
  "id": "claude-opus-4-0",
@@ -13314,9 +13313,9 @@
13314
13313
  "text"
13315
13314
  ],
13316
13315
  "cost": {
13317
- "input": 0,
13318
- "output": 0,
13319
- "cacheRead": 0,
13316
+ "input": 0.13,
13317
+ "output": 0.26,
13318
+ "cacheRead": 0.028,
13320
13319
  "cacheWrite": 0
13321
13320
  },
13322
13321
  "contextWindow": 1048576,
@@ -20750,7 +20749,7 @@
20750
20749
  },
20751
20750
  "deepseek-v4-flash-0731": {
20752
20751
  "id": "deepseek-v4-flash-0731",
20753
- "name": "DeepSeek-V4-Flash-0731",
20752
+ "name": "DeepSeek V4 Flash 0731",
20754
20753
  "api": "openai-completions",
20755
20754
  "provider": "fireworks",
20756
20755
  "baseUrl": "https://api.fireworks.ai/inference/v1",
@@ -20759,13 +20758,13 @@
20759
20758
  "text"
20760
20759
  ],
20761
20760
  "cost": {
20762
- "input": 0,
20763
- "output": 0,
20764
- "cacheRead": 0,
20761
+ "input": 0.175,
20762
+ "output": 0.35,
20763
+ "cacheRead": 0.035,
20765
20764
  "cacheWrite": 0
20766
20765
  },
20767
20766
  "contextWindow": 1048576,
20768
- "maxTokens": 1048576,
20767
+ "maxTokens": 32768,
20769
20768
  "thinking": {
20770
20769
  "mode": "effort",
20771
20770
  "efforts": [
@@ -20773,8 +20772,7 @@
20773
20772
  "max"
20774
20773
  ]
20775
20774
  },
20776
- "supportsComputerUse": false,
20777
- "supportsComputerUseConfig": false
20775
+ "supportsComputerUse": false
20778
20776
  },
20779
20777
  "deepseek-v4-pro": {
20780
20778
  "id": "deepseek-v4-pro",
@@ -24554,10 +24552,10 @@
24554
24552
  "image"
24555
24553
  ],
24556
24554
  "cost": {
24557
- "input": 0,
24558
- "output": 0,
24559
- "cacheRead": 0,
24560
- "cacheWrite": 0
24555
+ "input": 5,
24556
+ "output": 25,
24557
+ "cacheRead": 0.5,
24558
+ "cacheWrite": 6.25
24561
24559
  },
24562
24560
  "contextWindow": 200000,
24563
24561
  "maxTokens": 64000,
@@ -24591,10 +24589,10 @@
24591
24589
  "image"
24592
24590
  ],
24593
24591
  "cost": {
24594
- "input": 0,
24595
- "output": 0,
24596
- "cacheRead": 0,
24597
- "cacheWrite": 0
24592
+ "input": 5,
24593
+ "output": 25,
24594
+ "cacheRead": 0.5,
24595
+ "cacheWrite": 6.25
24598
24596
  },
24599
24597
  "contextWindow": 250000,
24600
24598
  "maxTokens": 64000,
@@ -24621,10 +24619,10 @@
24621
24619
  "image"
24622
24620
  ],
24623
24621
  "cost": {
24624
- "input": 0,
24625
- "output": 0,
24626
- "cacheRead": 0,
24627
- "cacheWrite": 0
24622
+ "input": 3,
24623
+ "output": 15,
24624
+ "cacheRead": 0.3,
24625
+ "cacheWrite": 3.75
24628
24626
  },
24629
24627
  "contextWindow": 1000000,
24630
24628
  "maxTokens": 64000,
@@ -24658,10 +24656,10 @@
24658
24656
  "image"
24659
24657
  ],
24660
24658
  "cost": {
24661
- "input": 0,
24662
- "output": 0,
24663
- "cacheRead": 0,
24664
- "cacheWrite": 0
24659
+ "input": 3,
24660
+ "output": 15,
24661
+ "cacheRead": 0.3,
24662
+ "cacheWrite": 3.75
24665
24663
  },
24666
24664
  "contextWindow": 250000,
24667
24665
  "maxTokens": 64000,
@@ -24687,9 +24685,9 @@
24687
24685
  "image"
24688
24686
  ],
24689
24687
  "cost": {
24690
- "input": 0,
24691
- "output": 0,
24692
- "cacheRead": 0,
24688
+ "input": 0.3,
24689
+ "output": 2.5,
24690
+ "cacheRead": 0.03,
24693
24691
  "cacheWrite": 0
24694
24692
  },
24695
24693
  "contextWindow": 1048576,
@@ -24723,9 +24721,9 @@
24723
24721
  "image"
24724
24722
  ],
24725
24723
  "cost": {
24726
- "input": 0,
24727
- "output": 0,
24728
- "cacheRead": 0,
24724
+ "input": 0.1,
24725
+ "output": 0.4,
24726
+ "cacheRead": 0.01,
24729
24727
  "cacheWrite": 0
24730
24728
  },
24731
24729
  "contextWindow": 1048576,
@@ -24752,9 +24750,9 @@
24752
24750
  "image"
24753
24751
  ],
24754
24752
  "cost": {
24755
- "input": 0,
24756
- "output": 0,
24757
- "cacheRead": 0,
24753
+ "input": 1.25,
24754
+ "output": 10,
24755
+ "cacheRead": 0.125,
24758
24756
  "cacheWrite": 0
24759
24757
  },
24760
24758
  "contextWindow": 1048576,
@@ -24782,9 +24780,9 @@
24782
24780
  "image"
24783
24781
  ],
24784
24782
  "cost": {
24785
- "input": 0,
24786
- "output": 0,
24787
- "cacheRead": 0,
24783
+ "input": 0.5,
24784
+ "output": 3,
24785
+ "cacheRead": 0.05,
24788
24786
  "cacheWrite": 0
24789
24787
  },
24790
24788
  "contextWindow": 1048576,
@@ -24826,9 +24824,9 @@
24826
24824
  "image"
24827
24825
  ],
24828
24826
  "cost": {
24829
- "input": 0,
24830
- "output": 0,
24831
- "cacheRead": 0,
24827
+ "input": 2,
24828
+ "output": 12,
24829
+ "cacheRead": 0.2,
24832
24830
  "cacheWrite": 0
24833
24831
  },
24834
24832
  "contextWindow": 1048576,
@@ -24879,9 +24877,9 @@
24879
24877
  "image"
24880
24878
  ],
24881
24879
  "cost": {
24882
- "input": 0,
24883
- "output": 0,
24884
- "cacheRead": 0,
24880
+ "input": 0.25,
24881
+ "output": 1.5,
24882
+ "cacheRead": 0.025,
24885
24883
  "cacheWrite": 0
24886
24884
  },
24887
24885
  "contextWindow": 1048576,
@@ -24909,9 +24907,9 @@
24909
24907
  "image"
24910
24908
  ],
24911
24909
  "cost": {
24912
- "input": 0,
24913
- "output": 0,
24914
- "cacheRead": 0,
24910
+ "input": 2,
24911
+ "output": 12,
24912
+ "cacheRead": 0.2,
24915
24913
  "cacheWrite": 0
24916
24914
  },
24917
24915
  "contextWindow": 1048576,
@@ -24947,9 +24945,9 @@
24947
24945
  "image"
24948
24946
  ],
24949
24947
  "cost": {
24950
- "input": 0,
24951
- "output": 0,
24952
- "cacheRead": 0,
24948
+ "input": 1.5,
24949
+ "output": 9,
24950
+ "cacheRead": 0.15,
24953
24951
  "cacheWrite": 0
24954
24952
  },
24955
24953
  "contextWindow": 1048576,
@@ -24991,9 +24989,9 @@
24991
24989
  "image"
24992
24990
  ],
24993
24991
  "cost": {
24994
- "input": 0,
24995
- "output": 0,
24996
- "cacheRead": 0,
24992
+ "input": 1.5,
24993
+ "output": 7.5,
24994
+ "cacheRead": 0.15,
24997
24995
  "cacheWrite": 0
24998
24996
  },
24999
24997
  "contextWindow": 1048576,
@@ -27972,6 +27970,26 @@
27972
27970
  ]
27973
27971
  }
27974
27972
  },
27973
+ "~deepseek/deepseek-v4-flash-latest": {
27974
+ "id": "~deepseek/deepseek-v4-flash-latest",
27975
+ "name": "DeepSeek V4 Flash Latest",
27976
+ "api": "openai-completions",
27977
+ "provider": "kilo",
27978
+ "baseUrl": "https://api.kilo.ai/api/gateway",
27979
+ "reasoning": false,
27980
+ "input": [
27981
+ "text"
27982
+ ],
27983
+ "cost": {
27984
+ "input": 0,
27985
+ "output": 0,
27986
+ "cacheRead": 0,
27987
+ "cacheWrite": 0
27988
+ },
27989
+ "contextWindow": 1048576,
27990
+ "maxTokens": 1048576,
27991
+ "supportsComputerUse": false
27992
+ },
27975
27993
  "~google/gemini-flash-latest": {
27976
27994
  "id": "~google/gemini-flash-latest",
27977
27995
  "name": "Gemini Flash Latest",
@@ -40004,8 +40022,8 @@
40004
40022
  "cost": {
40005
40023
  "input": 0.3,
40006
40024
  "output": 1.2,
40007
- "cacheRead": 0,
40008
- "cacheWrite": 0
40025
+ "cacheRead": 0.03,
40026
+ "cacheWrite": 0.375
40009
40027
  },
40010
40028
  "contextWindow": 204800,
40011
40029
  "maxTokens": 131072,
@@ -40270,8 +40288,8 @@
40270
40288
  "cost": {
40271
40289
  "input": 0.3,
40272
40290
  "output": 1.2,
40273
- "cacheRead": 0,
40274
- "cacheWrite": 0
40291
+ "cacheRead": 0.03,
40292
+ "cacheWrite": 0.375
40275
40293
  },
40276
40294
  "contextWindow": 204800,
40277
40295
  "maxTokens": 131072,
@@ -45440,7 +45458,7 @@
45440
45458
  "api": "openai-completions",
45441
45459
  "provider": "nanogpt",
45442
45460
  "baseUrl": "https://nano-gpt.com/api/v1",
45443
- "reasoning": false,
45461
+ "reasoning": true,
45444
45462
  "input": [
45445
45463
  "text"
45446
45464
  ],
@@ -45453,7 +45471,14 @@
45453
45471
  "contextWindow": 1048576,
45454
45472
  "maxTokens": 384000,
45455
45473
  "supportsComputerUse": false,
45456
- "supportsComputerUseConfig": false
45474
+ "supportsComputerUseConfig": false,
45475
+ "thinking": {
45476
+ "mode": "effort",
45477
+ "efforts": [
45478
+ "high",
45479
+ "max"
45480
+ ]
45481
+ }
45457
45482
  },
45458
45483
  "deepseek/deepseek-v4-flash:thinking": {
45459
45484
  "id": "deepseek/deepseek-v4-flash:thinking",
@@ -68099,7 +68124,7 @@
68099
68124
  "cacheWrite": 0
68100
68125
  },
68101
68126
  "contextWindow": 1048576,
68102
- "maxTokens": 1048576,
68127
+ "maxTokens": 65536,
68103
68128
  "omitMaxOutputTokens": true,
68104
68129
  "thinking": {
68105
68130
  "mode": "effort",
@@ -68139,7 +68164,7 @@
68139
68164
  "cacheWrite": 0
68140
68165
  },
68141
68166
  "contextWindow": 1048576,
68142
- "maxTokens": 8192,
68167
+ "maxTokens": 65536,
68143
68168
  "omitMaxOutputTokens": true,
68144
68169
  "supportsComputerUse": false
68145
68170
  },
@@ -68160,7 +68185,7 @@
68160
68185
  "cacheWrite": 0
68161
68186
  },
68162
68187
  "contextWindow": 1048576,
68163
- "maxTokens": 1048576,
68188
+ "maxTokens": 65536,
68164
68189
  "omitMaxOutputTokens": true,
68165
68190
  "thinking": {
68166
68191
  "mode": "effort",
@@ -74174,6 +74199,33 @@
74174
74199
  "supportsComputerUse": false,
74175
74200
  "supportsComputerUseConfig": false
74176
74201
  },
74202
+ "~deepseek/deepseek-v4-flash-latest": {
74203
+ "id": "~deepseek/deepseek-v4-flash-latest",
74204
+ "name": "DeepSeek V4 Flash Latest",
74205
+ "api": "openrouter",
74206
+ "provider": "openrouter",
74207
+ "baseUrl": "https://openrouter.ai/api/v1",
74208
+ "reasoning": true,
74209
+ "input": [
74210
+ "text"
74211
+ ],
74212
+ "cost": {
74213
+ "input": 0.09,
74214
+ "output": 0.18,
74215
+ "cacheRead": 0.018,
74216
+ "cacheWrite": 0
74217
+ },
74218
+ "contextWindow": 1048576,
74219
+ "maxTokens": 65536,
74220
+ "thinking": {
74221
+ "mode": "effort",
74222
+ "efforts": [
74223
+ "high"
74224
+ ]
74225
+ },
74226
+ "supportsComputerUse": false,
74227
+ "supportsComputerUseConfig": false
74228
+ },
74177
74229
  "~google/gemini-flash-latest": {
74178
74230
  "id": "~google/gemini-flash-latest",
74179
74231
  "name": "Gemini Flash Latest",
@@ -76370,17 +76422,19 @@
76370
76422
  "text"
76371
76423
  ],
76372
76424
  "cost": {
76373
- "input": 0.14,
76374
- "output": 0.28,
76375
- "cacheRead": 0.0028,
76425
+ "input": 0.09,
76426
+ "output": 0.18,
76427
+ "cacheRead": 0.018,
76376
76428
  "cacheWrite": 0
76377
76429
  },
76378
76430
  "contextWindow": 1048576,
76379
- "maxTokens": 384000,
76431
+ "maxTokens": 65536,
76380
76432
  "thinking": {
76381
76433
  "mode": "effort",
76382
76434
  "efforts": [
76383
- "high"
76435
+ "low",
76436
+ "high",
76437
+ "max"
76384
76438
  ]
76385
76439
  },
76386
76440
  "supportsComputerUse": false,
@@ -81508,7 +81562,7 @@
81508
81562
  ],
81509
81563
  "cost": {
81510
81564
  "input": 0.03,
81511
- "output": 0.14,
81565
+ "output": 0.13,
81512
81566
  "cacheRead": 0.03,
81513
81567
  "cacheWrite": 0
81514
81568
  },
@@ -85391,9 +85445,9 @@
85391
85445
  "text"
85392
85446
  ],
85393
85447
  "cost": {
85394
- "input": 0.76006,
85395
- "output": 2.38876,
85396
- "cacheRead": 0.141154,
85448
+ "input": 0.42,
85449
+ "output": 1.32,
85450
+ "cacheRead": 0.078,
85397
85451
  "cacheWrite": 0
85398
85452
  },
85399
85453
  "contextWindow": 1048576,
@@ -85615,8 +85669,6 @@
85615
85669
  },
85616
85670
  "contextWindow": 524288,
85617
85671
  "maxTokens": 65536,
85618
- "supportsComputerUse": false,
85619
- "supportsComputerUseConfig": false,
85620
85672
  "thinking": {
85621
85673
  "mode": "effort",
85622
85674
  "efforts": [
@@ -85629,7 +85681,8 @@
85629
85681
  "max": "max"
85630
85682
  },
85631
85683
  "requiresEffort": true
85632
- }
85684
+ },
85685
+ "supportsComputerUse": false
85633
85686
  },
85634
85687
  "hf:nvidia/NVIDIA-Nemotron-3-Super-120B-A12B-NVFP4": {
85635
85688
  "id": "hf:nvidia/NVIDIA-Nemotron-3-Super-120B-A12B-NVFP4",
@@ -85659,8 +85712,7 @@
85659
85712
  "xhigh"
85660
85713
  ]
85661
85714
  },
85662
- "supportsComputerUse": false,
85663
- "supportsComputerUseConfig": false
85715
+ "supportsComputerUse": false
85664
85716
  },
85665
85717
  "hf:openai/gpt-oss-120b": {
85666
85718
  "id": "hf:openai/gpt-oss-120b",
@@ -85688,8 +85740,7 @@
85688
85740
  "high"
85689
85741
  ]
85690
85742
  },
85691
- "supportsComputerUse": false,
85692
- "supportsComputerUseConfig": false
85743
+ "supportsComputerUse": false
85693
85744
  },
85694
85745
  "hf:Qwen/Qwen3.6-27B": {
85695
85746
  "id": "hf:Qwen/Qwen3.6-27B",
@@ -85719,8 +85770,7 @@
85719
85770
  "high"
85720
85771
  ]
85721
85772
  },
85722
- "supportsComputerUse": false,
85723
- "supportsComputerUseConfig": false
85773
+ "supportsComputerUse": false
85724
85774
  },
85725
85775
  "hf:zai-org/GLM-4.7-Flash": {
85726
85776
  "id": "hf:zai-org/GLM-4.7-Flash",
@@ -85750,8 +85800,7 @@
85750
85800
  "xhigh"
85751
85801
  ]
85752
85802
  },
85753
- "supportsComputerUse": false,
85754
- "supportsComputerUseConfig": false
85803
+ "supportsComputerUse": false
85755
85804
  },
85756
85805
  "hf:zai-org/GLM-5.2": {
85757
85806
  "id": "hf:zai-org/GLM-5.2",
@@ -85781,8 +85830,7 @@
85781
85830
  "xhigh"
85782
85831
  ]
85783
85832
  },
85784
- "supportsComputerUse": false,
85785
- "supportsComputerUseConfig": false
85833
+ "supportsComputerUse": false
85786
85834
  },
85787
85835
  "syn:large:text": {
85788
85836
  "id": "syn:large:text",
@@ -86536,7 +86584,7 @@
86536
86584
  "cost": {
86537
86585
  "input": 0.6,
86538
86586
  "output": 3.6,
86539
- "cacheRead": 0,
86587
+ "cacheRead": 0.35,
86540
86588
  "cacheWrite": 0
86541
86589
  },
86542
86590
  "contextWindow": 262144,
@@ -86621,7 +86669,7 @@
86621
86669
  "cost": {
86622
86670
  "input": 1.25,
86623
86671
  "output": 3.75,
86624
- "cacheRead": 0,
86672
+ "cacheRead": 0.125,
86625
86673
  "cacheWrite": 0
86626
86674
  },
86627
86675
  "contextWindow": 1000000,
@@ -86728,7 +86776,7 @@
86728
86776
  "cost": {
86729
86777
  "input": 1.4,
86730
86778
  "output": 4.4,
86731
- "cacheRead": 0,
86779
+ "cacheRead": 0.26,
86732
86780
  "cacheWrite": 0
86733
86781
  },
86734
86782
  "contextWindow": 202752,
@@ -87675,26 +87723,28 @@
87675
87723
  },
87676
87724
  "deepseek-v4-flash-0731": {
87677
87725
  "id": "deepseek-v4-flash-0731",
87678
- "name": "deepseek-v4-flash-0731",
87726
+ "name": "DeepSeek V4 Flash 0731",
87679
87727
  "api": "openai-completions",
87680
87728
  "provider": "venice",
87681
87729
  "baseUrl": "https://api.venice.ai/api/v1",
87682
- "reasoning": false,
87730
+ "reasoning": true,
87683
87731
  "input": [
87684
87732
  "text"
87685
87733
  ],
87686
87734
  "cost": {
87687
- "input": 0,
87688
- "output": 0,
87689
- "cacheRead": 0,
87735
+ "input": 0.175,
87736
+ "output": 0.35,
87737
+ "cacheRead": 0.035,
87690
87738
  "cacheWrite": 0
87691
87739
  },
87692
87740
  "contextWindow": 1000000,
87693
- "maxTokens": 1048576,
87694
- "supportsComputerUse": false,
87695
- "supportsComputerUseConfig": false,
87696
- "compat": {
87697
- "supportsUsageInStreaming": false
87741
+ "maxTokens": 32768,
87742
+ "thinking": {
87743
+ "mode": "effort",
87744
+ "efforts": [
87745
+ "high",
87746
+ "max"
87747
+ ]
87698
87748
  }
87699
87749
  },
87700
87750
  "deepseek-v4-pro": {
@@ -90547,9 +90597,9 @@
90547
90597
  "text"
90548
90598
  ],
90549
90599
  "cost": {
90550
- "input": 0.125,
90551
- "output": 0.5,
90552
- "cacheRead": 0,
90600
+ "input": 0.06,
90601
+ "output": 0.4,
90602
+ "cacheRead": 0.01,
90553
90603
  "cacheWrite": 0
90554
90604
  },
90555
90605
  "contextWindow": 128000,
@@ -93104,7 +93154,8 @@
93104
93154
  "baseUrl": "https://ai-gateway.vercel.sh",
93105
93155
  "reasoning": true,
93106
93156
  "input": [
93107
- "text"
93157
+ "text",
93158
+ "image"
93108
93159
  ],
93109
93160
  "cost": {
93110
93161
  "input": 0.15,
@@ -93174,7 +93225,8 @@
93174
93225
  "baseUrl": "https://ai-gateway.vercel.sh",
93175
93226
  "reasoning": true,
93176
93227
  "input": [
93177
- "text"
93228
+ "text",
93229
+ "image"
93178
93230
  ],
93179
93231
  "cost": {
93180
93232
  "input": 0.74,
@@ -93904,7 +93956,8 @@
93904
93956
  "provider": "vercel-ai-gateway",
93905
93957
  "reasoning": false,
93906
93958
  "input": [
93907
- "text"
93959
+ "text",
93960
+ "image"
93908
93961
  ],
93909
93962
  "cost": {
93910
93963
  "input": 0.09999999999999999,
@@ -93924,7 +93977,8 @@
93924
93977
  "provider": "vercel-ai-gateway",
93925
93978
  "reasoning": false,
93926
93979
  "input": [
93927
- "text"
93980
+ "text",
93981
+ "image"
93928
93982
  ],
93929
93983
  "cost": {
93930
93984
  "input": 0.15,
@@ -94017,7 +94071,8 @@
94017
94071
  "baseUrl": "https://ai-gateway.vercel.sh",
94018
94072
  "reasoning": false,
94019
94073
  "input": [
94020
- "text"
94074
+ "text",
94075
+ "image"
94021
94076
  ],
94022
94077
  "cost": {
94023
94078
  "input": 0.15,
@@ -98492,7 +98547,6 @@
98492
98547
  "contextWindow": 2000000,
98493
98548
  "maxTokens": 2000000,
98494
98549
  "supportsComputerUse": false,
98495
- "supportsComputerUseConfig": false,
98496
98550
  "compat": {
98497
98551
  "reasoningEffortMap": {
98498
98552
  "minimal": "low"
@@ -98524,7 +98578,6 @@
98524
98578
  "contextWindow": 2000000,
98525
98579
  "maxTokens": 2000000,
98526
98580
  "supportsComputerUse": false,
98527
- "supportsComputerUseConfig": false,
98528
98581
  "compat": {
98529
98582
  "reasoningEffortMap": {
98530
98583
  "minimal": "low"
@@ -98568,7 +98621,6 @@
98568
98621
  }
98569
98622
  },
98570
98623
  "supportsComputerUse": false,
98571
- "supportsComputerUseConfig": false,
98572
98624
  "compat": {
98573
98625
  "reasoningEffortMap": {
98574
98626
  "minimal": "low"
@@ -98613,7 +98665,6 @@
98613
98665
  }
98614
98666
  },
98615
98667
  "supportsComputerUse": false,
98616
- "supportsComputerUseConfig": false,
98617
98668
  "compat": {
98618
98669
  "reasoningEffortMap": {
98619
98670
  "minimal": "low"
@@ -98658,7 +98709,6 @@
98658
98709
  }
98659
98710
  },
98660
98711
  "supportsComputerUse": false,
98661
- "supportsComputerUseConfig": false,
98662
98712
  "compat": {
98663
98713
  "reasoningEffortMap": {
98664
98714
  "minimal": "low"
@@ -98690,7 +98740,6 @@
98690
98740
  "contextWindow": 512000,
98691
98741
  "maxTokens": 512000,
98692
98742
  "supportsComputerUse": false,
98693
- "supportsComputerUseConfig": false,
98694
98743
  "compat": {
98695
98744
  "reasoningEffortMap": {
98696
98745
  "minimal": "low"
@@ -98722,7 +98771,6 @@
98722
98771
  "contextWindow": 256000,
98723
98772
  "maxTokens": 256000,
98724
98773
  "supportsComputerUse": false,
98725
- "supportsComputerUseConfig": false,
98726
98774
  "compat": {
98727
98775
  "reasoningEffortMap": {
98728
98776
  "minimal": "low"
@@ -98753,7 +98801,6 @@
98753
98801
  "contextWindow": 200000,
98754
98802
  "maxTokens": 200000,
98755
98803
  "supportsComputerUse": false,
98756
- "supportsComputerUseConfig": false,
98757
98804
  "compat": {
98758
98805
  "reasoningEffortMap": {
98759
98806
  "minimal": "low"
@@ -105626,6 +105673,37 @@
105626
105673
  ]
105627
105674
  }
105628
105675
  },
105676
+ "glm-5.2-highspeed": {
105677
+ "id": "glm-5.2-highspeed",
105678
+ "name": "GLM-5.2 Highspeed",
105679
+ "api": "openai-completions",
105680
+ "provider": "zhipu-coding-plan",
105681
+ "baseUrl": "https://open.bigmodel.cn/api/coding/paas/v4",
105682
+ "reasoning": true,
105683
+ "input": [
105684
+ "text"
105685
+ ],
105686
+ "cost": {
105687
+ "input": 0,
105688
+ "output": 0,
105689
+ "cacheRead": 0,
105690
+ "cacheWrite": 0
105691
+ },
105692
+ "contextWindow": 1000000,
105693
+ "maxTokens": 131072,
105694
+ "compat": {
105695
+ "thinkingFormat": "zai",
105696
+ "reasoningContentField": "reasoning_content",
105697
+ "supportsDeveloperRole": false
105698
+ },
105699
+ "thinking": {
105700
+ "mode": "effort",
105701
+ "efforts": [
105702
+ "high",
105703
+ "max"
105704
+ ]
105705
+ }
105706
+ },
105629
105707
  "glm-5.2-highspeed[1m]": {
105630
105708
  "id": "glm-5.2-highspeed[1m]",
105631
105709
  "name": "GLM-5.2 Highspeed",
@@ -23,6 +23,36 @@ type OllamaShowResponse = {
23
23
  };
24
24
 
25
25
  const OLLAMA_RETRY_DELAYS_MS = [2_000, 5_000, 10_000];
26
+ /**
27
+ * Output-token ceiling that Ollama Cloud enforces for the DeepSeek V4 Pro/Flash
28
+ * deployments: `/api/chat` rejects `num_predict` above it with HTTP 400
29
+ * (`max_tokens (...) exceeds model's maximum output tokens (65536)`) even though
30
+ * the model pages advertise a 1M context / 384K output. Ollama's `/api/show`
31
+ * never reports this cap, so the catalog pins it for the affected models
32
+ * (ollama/ollama#16890, #7266). The wire layer clamps `num_predict` to the same
33
+ * value (`OLLAMA_CLOUD_NUM_PREDICT_CAP` in `packages/ai/src/providers/ollama.ts`,
34
+ * #3392/#3394).
35
+ */
36
+ export const OLLAMA_CLOUD_MAX_OUTPUT_TOKENS = 65_536;
37
+
38
+ /**
39
+ * Untagged base ids whose Ollama Cloud deployment enforces
40
+ * {@link OLLAMA_CLOUD_MAX_OUTPUT_TOKENS}. Only DeepSeek V4 Pro/Flash are known
41
+ * to cap output below their advertised window (ollama/ollama#16890); other cloud
42
+ * models keep their discovered limits.
43
+ */
44
+ const OLLAMA_CLOUD_OUTPUT_CAPPED_BASE_IDS: Record<string, true> = {
45
+ "deepseek-v4-flash": true,
46
+ "deepseek-v4-pro": true,
47
+ };
48
+
49
+ /** Whether an Ollama Cloud model id (tagged or not) enforces the 65536 output cap. */
50
+ export function isOllamaCloudOutputCapped(id: string): boolean {
51
+ const separator = id.indexOf(":");
52
+ const baseId = separator > 0 ? id.slice(0, separator) : id;
53
+ return OLLAMA_CLOUD_OUTPUT_CAPPED_BASE_IDS[baseId] === true;
54
+ }
55
+
26
56
  const OLLAMA_CLOUD_GLM_52_THINKING: ThinkingConfig = {
27
57
  mode: "effort",
28
58
  efforts: [Effort.High, Effort.Max],
@@ -133,10 +163,10 @@ export function ollamaCloudModelManagerOptions(
133
163
  }
134
164
  const capabilities = metadata?.capabilities;
135
165
  const discoveredContextWindow = getContextWindow(metadata?.model_info);
136
- // `/api/show` is the only trustworthy Ollama-owned source for size caps.
137
- // When it is unavailable (or returns only coarse capabilities), do NOT
138
- // inherit giant budgets from bundled fallback metadata sourced from a
139
- // different catalog; keep the historical safe fallback instead.
166
+ // `/api/show` reports the context length but never a per-model output
167
+ // cap. DeepSeek V4 Pro/Flash deployments enforce a 65536 output ceiling
168
+ // (ollama/ollama#16890, #7266); every other id keeps the trusted
169
+ // reference limit, falling back to the historical safe cap otherwise.
140
170
  const contextWindow = discoveredContextWindow ?? 128000;
141
171
  const reasoning = capabilities ? capabilities.includes("thinking") : (reference?.reasoning ?? false);
142
172
  const thinking = capabilities ? getThinkingConfig(id, capabilities) : reference?.thinking;
@@ -157,8 +187,9 @@ export function ollamaCloudModelManagerOptions(
157
187
  input,
158
188
  cost: reference?.cost ?? { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
159
189
  contextWindow,
160
- maxTokens:
161
- discoveredContextWindow !== null && discoveredContextWindow !== undefined
190
+ maxTokens: isOllamaCloudOutputCapped(id)
191
+ ? Math.min(contextWindow, OLLAMA_CLOUD_MAX_OUTPUT_TOKENS)
192
+ : discoveredContextWindow !== null && discoveredContextWindow !== undefined
162
193
  ? (providerReference?.maxTokens ?? Math.min(contextWindow, 8192))
163
194
  : Math.min(contextWindow, 8192),
164
195
  omitMaxOutputTokens: true,
@@ -2465,6 +2465,24 @@ export interface OpenRouterModelManagerConfig {
2465
2465
  fetch?: FetchImpl;
2466
2466
  }
2467
2467
 
2468
+ function mapOpenRouterThinking(entry: OpenAICompatibleModelRecord): ThinkingConfig | undefined {
2469
+ const reasoning = entry.reasoning;
2470
+ if (!isRecord(reasoning)) return undefined;
2471
+ const supportedEfforts = reasoning.supported_efforts;
2472
+ if (!Array.isArray(supportedEfforts)) return undefined;
2473
+ const efforts = THINKING_EFFORTS.filter(effort => supportedEfforts.includes(effort));
2474
+ if (efforts.length === 0) return undefined;
2475
+ const defaultLevel =
2476
+ typeof reasoning.default_effort === "string"
2477
+ ? THINKING_EFFORTS.find(effort => effort === reasoning.default_effort)
2478
+ : undefined;
2479
+ return {
2480
+ mode: "effort",
2481
+ efforts,
2482
+ ...(defaultLevel !== undefined && efforts.includes(defaultLevel) ? { defaultLevel } : {}),
2483
+ };
2484
+ }
2485
+
2468
2486
  export function openrouterModelManagerOptions(
2469
2487
  config?: OpenRouterModelManagerConfig,
2470
2488
  ): ModelManagerOptions<"openrouter"> {
@@ -2496,6 +2514,7 @@ export function openrouterModelManagerOptions(
2496
2514
  const baseModel = mapWithBundledReference(entry, defaults, reference);
2497
2515
  const pricing = entry.pricing as Record<string, unknown> | undefined;
2498
2516
  const params = Array.isArray(entry.supported_parameters) ? (entry.supported_parameters as string[]) : [];
2517
+ const thinking = mapOpenRouterThinking(entry);
2499
2518
  const modality = String((entry.architecture as Record<string, unknown> | undefined)?.modality ?? "");
2500
2519
  const topProvider = entry.top_provider as Record<string, unknown> | undefined;
2501
2520
 
@@ -2504,6 +2523,7 @@ export function openrouterModelManagerOptions(
2504
2523
  return {
2505
2524
  ...baseModel,
2506
2525
  reasoning: params.includes("reasoning"),
2526
+ ...(thinking !== undefined ? { thinking } : {}),
2507
2527
  input: modality.includes("image") ? ["text", "image"] : ["text"],
2508
2528
  cost: {
2509
2529
  input: parseFloat(String(pricing?.prompt ?? "0")) * 1_000_000,
package/src/types.ts CHANGED
@@ -401,6 +401,15 @@ export interface OpenAICompat {
401
401
  * that proxy gateways (Vertex AI, AWS Bedrock-style fronts, etc.) reject.
402
402
  */
403
403
  export interface AnthropicCompat {
404
+ /**
405
+ * Stream-watchdog idle-timeout fallback in ms for slow reasoning hosts.
406
+ * Set to 0 to disable the inter-event idle watchdog entirely, matching
407
+ * `OpenAICompat.streamIdleTimeoutMs`.
408
+ *
409
+ * When unset, direct Anthropic streams use `PI_STREAM_IDLE_TIMEOUT_MS`,
410
+ * then the legacy `PI_OPENAI_STREAM_IDLE_TIMEOUT_MS` alias, then 300s.
411
+ */
412
+ streamIdleTimeoutMs?: number;
404
413
  /**
405
414
  * Drop the top-level `strict: true` field on tool definitions. Vertex AI's
406
415
  * Anthropic-compatible endpoint rejects unknown tool fields with
@@ -712,7 +721,13 @@ export interface ResolvedOpenAIResponsesCompat extends ResolvedOpenAISharedCompa
712
721
  export type ResolvedOpenRouterCompat = ResolvedOpenAICompat & ResolvedOpenAIResponsesCompat;
713
722
 
714
723
  /** Fully-resolved anthropic-messages compat view (same contract as `ResolvedOpenAICompat`). */
715
- export type ResolvedAnthropicCompat = Required<AnthropicCompat> & {
724
+ export type ResolvedAnthropicCompat = Required<Omit<AnthropicCompat, "streamIdleTimeoutMs">> & {
725
+ /**
726
+ * Stream-watchdog idle-timeout fallback in ms for slow reasoning hosts; 0 disables the idle watchdog.
727
+ * Undefined defers to `PI_STREAM_IDLE_TIMEOUT_MS`, then the legacy
728
+ * `PI_OPENAI_STREAM_IDLE_TIMEOUT_MS` alias, then 300s.
729
+ */
730
+ streamIdleTimeoutMs?: number;
716
731
  /**
717
732
  * The configured endpoint is the official first-party Anthropic API
718
733
  * (https + exact `api.anthropic.com` host; a missing baseUrl counts as