pi-makora-provider 1.1.0 → 1.2.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/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  **Open-weight models through [Makora](https://inference.makora.com)**
6
6
 
7
- _DeepSeek V4, Kimi K2.6, GLM 5.1, Qwen 3.6 — with client-side tool call repair for [pi](https://github.com/earendil-works/pi-coding-agent)._
7
+ _DeepSeek V4, Kimi K2.7 Code, GLM 5.2, Qwen 3.6 — with client-side tool call repair and preserved-thinking flags for [pi](https://github.com/earendil-works/pi-coding-agent)._
8
8
 
9
9
  [![pi extension](https://img.shields.io/badge/pi-extension-blueviolet)](https://github.com/earendil-works/pi-coding-agent)
10
10
  [![license](https://img.shields.io/badge/license-MIT-blue)](./LICENSE)
@@ -19,14 +19,14 @@ _DeepSeek V4, Kimi K2.6, GLM 5.1, Qwen 3.6 — with client-side tool call repair
19
19
  | Model | ID | Reasoning | Notes |
20
20
  |-------|----|-----------|-------|
21
21
  | DeepSeek V4 Flash | `deepseek-ai/DeepSeek-V4-Flash` | Yes | `include_reasoning` + `chat_template_kwargs.thinking` via `before_provider_request` payload rewrite; returns `reasoning` field |
22
- | DeepSeek V4 Pro | `deepseek-ai/DeepSeek-V4-Pro` | Yes | `chat_template_kwargs.thinking` via `before_provider_request` payload rewrite; returns `reasoning_content` field |
23
- | GLM 5.2 FP8 | `zai-org/GLM-5.2-FP8` | Yes | `enable_thinking` via `qwen-chat-template`; thinking levels copied from neuralwatt GLM 5.2; returns `reasoning_content` field |
24
- | Kimi K2.7 Code | `moonshotai/Kimi-K2.7-Code` | Yes | Reasoning on by default; client-side tool call parsing (vLLM streaming parser bypass) |
22
+ | DeepSeek V4 Pro | `deepseek-ai/DeepSeek-V4-Pro` | Yes | `chat_template_kwargs.thinking` via `before_provider_request` payload rewrite; returns `reasoning` field |
23
+ | GLM 5.2 FP8 | `zai-org/GLM-5.2-FP8` | Yes | `enable_thinking` via `qwen-chat-template`; effort via `reasoning_effort` (only `high`/`max` distinct, per vLLM GLM-5.2 recipe); thinking levels aligned with neuralwatt GLM 5.2; returns `reasoning` field |
24
+ | GLM 5.2 NVFP4 | `zai-org/GLM-5.2-NVFP4` | Yes | `enable_thinking` via `qwen-chat-template`; effort via `reasoning_effort` (only `high`/`max` distinct, per vLLM GLM-5.2 recipe); returns `reasoning` field |
25
+ | Kimi K2.7 Code | `moonshotai/Kimi-K2.7-Code` | Yes | Reasoning on by default (thinking-only model); `preserve_thinking` via `chatTemplateKwargs` for multi-turn continuity; returns `reasoning` field; client-side tool call parsing (vLLM streaming parser bypass) |
25
26
  | Llama 3.3 70B FP8 | `amd/Llama-3.3-70B-Instruct-FP8-KV` | No | |
26
27
  | Llama 3.3 70B Instruct | `meta-llama/Llama-3.3-70B-Instruct` | No | |
27
- | MiniMax M3 MXFP8 | `MiniMaxAI/MiniMax-M3-MXFP8` | Yes | Reasoning via `chat_template_kwargs.enable_thinking`; returns `reasoning_content` field |
28
- | Qwen 3.6 27B NVFP4 | `unsloth/Qwen3.6-27B-NVFP4` | Yes | `enable_thinking` via `qwen-chat-template`; client-side tool call parsing (vLLM streaming parser bypass) |
29
- | Qwen 3.6 35B A3B NVFP4 | `unsloth/Qwen3.6-35B-A3B-NVFP4` | Yes | `enable_thinking` via `qwen-chat-template`; client-side tool call parsing (vLLM streaming parser bypass) |
28
+ | Qwen 3.6 27B NVFP4 | `unsloth/Qwen3.6-27B-NVFP4` | Yes | `enable_thinking` via `qwen-chat-template`; `preserve_thinking` via `chatTemplateKwargs` for multi-turn continuity; returns `reasoning` field; client-side tool call parsing (vLLM streaming parser bypass) |
29
+ | Qwen 3.6 35B A3B NVFP4 | `unsloth/Qwen3.6-35B-A3B-NVFP4` | Yes | `enable_thinking` via `qwen-chat-template`; `preserve_thinking` via `chatTemplateKwargs` for multi-turn continuity; returns `reasoning` field; client-side tool call parsing (vLLM streaming parser bypass) |
30
30
  <!-- MODELS_TABLE_END -->
31
31
 
32
32
  ## Installation
@@ -163,15 +163,17 @@ These issues are common to all vLLM-hosted providers and affect Makora models:
163
163
 
164
164
  - **GLM tool calls — follow-up `tool_calls` crash workaround**: the ZAI chat template calls `.items()` on any assistant message that carries a `tool_calls` field (on the `tool_calls` list or on its JSON-string `arguments` field), raising a leaked Python `AttributeError` that vLLM returns as HTTP 400 (`'list object' has no attribute 'items'` / `'str object' has no attribute 'items'`). The `before_provider_request` hook (`stripGlmToolCalls`) strips `tool_calls` from assistant messages and converts them to GLM-native `<tool_call>` XML text in `content` — which the model natively understands in conversation history — before the follow-up request is sent. The hook is scoped to Makora's own GLM models via an exact model-id match (`isMakoraGlmVllmModel`): `before_provider_request` is global in pi (it fires for every loaded provider's requests and the event carries no `provider` field), so gating by model id is what keeps it from touching GLM models served by other providers. If upstream fixes the `.items()` crash, this transform is a harmless no-op (the XML text is valid GLM input either way).
165
165
 
166
- - **Kimi K2.6 + Qwen 3.6 tool calling**: vLLM's server-side streaming tool-call handling is broken or missing for these models — Makora's vLLM is missing both `--enable-auto-tool-choice` and `--tool-call-parser` for them, so they emit tool calls as raw text tokens rather than structured `tool_call` deltas.
166
+ - **Kimi K2.7 Code + Qwen 3.6 tool calling**: vLLM's server-side streaming tool-call handling is broken or missing for these models — Makora's vLLM is missing both `--enable-auto-tool-choice` and `--tool-call-parser` for them, so they emit tool calls as raw text tokens rather than structured `tool_call` deltas.
167
167
 
168
- - **Kimi K2.6**: Uses `<|tool_call_begin|>...<|tool_call_end|>` tokens.
168
+ - **Kimi K2.7 Code**: Uses `<|tool_call_begin|>...<|tool_call_end|>` tokens.
169
169
  - **Qwen 3.6**: Uses hermes-style `<function=...>` XML, sometimes with `█` delimiters.
170
170
 
171
- - **GLM 5.1 CoT leak**: On some vLLM builds, disabling reasoning may still leak chain-of-thought into `content` terminated by a ``` marker. See [vllm-project/vllm#31319](https://github.com/vllm-project/vllm/issues/31319).
171
+ - **GLM 5.2 CoT leak**: On some vLLM builds, disabling reasoning may still leak chain-of-thought into `content` terminated by a ``` marker. See [vllm-project/vllm#31319](https://github.com/vllm-project/vllm/issues/31319).
172
172
 
173
173
  - **DeepSeek V4 reasoning**: The official DeepSeek API uses `thinking: { type: "enabled" }` which Makora's vLLM silently ignores. The `before_provider_request` hook rewrites the payload to use vLLM-native params instead:
174
- - **DS V4 Pro**: `chat_template_kwargs: { thinking: true }`. Returns `reasoning_content`.
174
+ - **DS V4 Pro**: `chat_template_kwargs: { thinking: true }`. Returns `reasoning` (vLLM reasoning parser; the official DeepSeek API returns `reasoning_content`, but Makora's vLLM build returns `reasoning`).
175
175
  - **DS V4 Flash**: `include_reasoning: true` + `chat_template_kwargs: { thinking: true }`. `include_reasoning` alone returns `reasoning: null` on this vLLM build — both params are required. Returns `reasoning`.
176
- - **GLM 5.1 reasoning**: Returns `reasoning_content` (not `reasoning`). pi's OpenAI completions handler checks `reasoning_content` first, so this is handled correctly.
177
- - **MiniMax M3 reasoning**: Uses `chat_template_kwargs.enable_thinking` to toggle thinking (not `chat_template_kwargs.thinking` like DeepSeek). The `before_provider_request` hook rewrites the DeepSeek API-style `thinking` param into vLLM-native `chat_template_kwargs: { enable_thinking: true }`. Returns `reasoning_content` field.
176
+ - **Preserved thinking (multi-turn reasoning continuity)**: every reasoning model on Makora returns reasoning in the `reasoning` field (not `reasoning_content`). Pi sends prior assistant reasoning back on follow-up turns; Makora's vLLM chat templates accept it under either `reasoning` or `reasoning_content`. For models whose chat template defines an explicit preserved-thinking flag, the flag is sent via `compat.chatTemplateKwargs`:
177
+ - **Kimi K2.7 Code**: `preserve_thinking: true` (the model forces thinking-only mode with preserve_thinking on, per the vLLM recipe).
178
+ - **Qwen 3.6 27B / 35B**: `preserve_thinking: true` (Qwen 3.6 ships with preserve_thinking).
179
+ - **GLM 5.2**: no extra flag — the vLLM GLM-5.2 recipe uses only `enable_thinking` + `reasoning_effort`; preserved thinking works without a dedicated flag. Effort honors only `high` and `max` (lower pi levels resolve to the default `max`).
package/index.ts CHANGED
@@ -17,7 +17,7 @@
17
17
  * pi sends thinking: { type } via the "deepseek" thinkingFormat, but vLLM
18
18
  * ignores that — the before_provider_request hook rewrites the payload to
19
19
  * use chat_template_kwargs: { thinking: true } instead.
20
- * Returns reasoning_content field.
20
+ * Returns reasoning field (vLLM reasoning parser; not reasoning_content).
21
21
  * - DeepSeek V4 Flash: reasoning via include_reasoning +
22
22
  * chat_template_kwargs.thinking on vLLM.
23
23
  * The before_provider_request hook rewrites the payload to replace
@@ -34,15 +34,19 @@
34
34
  * delta. Setting zaiToolStream: true sends tool_stream: true in the
35
35
  * request, which forces vLLM to use the explicit tool streaming path
36
36
  * that correctly emits tool call chunks.
37
- * - GLM 5.2 FP8: reasoning via chat_template_kwargs.enable_thinking.
38
- * Thinking levels (minimal/low/medium/high/max) are copied from the
39
- * neuralwatt provider's GLM 5.2 configuration and mapped through pi's
40
- * qwen-chat-template thinkingFormat.
37
+ * - GLM 5.2 FP8 / NVFP4: reasoning via chat_template_kwargs.enable_thinking.
38
+ * Effort uses vLLM's reasoning_effort field (only `high` and `max` are
39
+ * distinct levels per the vLLM GLM-5.2 recipe; lower pi levels resolve to
40
+ * the default). Thinking levels aligned with the neuralwatt provider's
41
+ * GLM 5.2 configuration and mapped through pi's qwen-chat-template
42
+ * thinkingFormat. Returns `reasoning` field.
41
43
  * - GPT-OSS 120B: reasoning always on; returns `reasoning` field.
42
- * - Kimi K2.6 NVFP4 / Kimi K2.7 Code: reasoning always on by default;
43
- * returns `reasoning` field. Can be toggled via enable_thinking.
44
+ * - Kimi K2.7 Code: reasoning always on (thinking-only model);
45
+ * chatTemplateKwargs.preserve_thinking forces multi-turn reasoning
46
+ * continuity. Returns `reasoning` field. Can be toggled via enable_thinking.
44
47
  * - Qwen 3.6 models: reasoning via chat_template_kwargs.enable_thinking;
45
- * returns `reasoning` field.
48
+ * chatTemplateKwargs.preserve_thinking for multi-turn continuity.
49
+ * Returns `reasoning` field.
46
50
  * - MiniMax M3 MXFP8: reasoning via chat_template_kwargs.enable_thinking;
47
51
  * returns reasoning_content field.
48
52
  * - Llama 3.3 70B: not a reasoning model.
@@ -109,6 +113,10 @@ interface JsonModel {
109
113
  requiresToolResultName?: boolean;
110
114
  requiresAssistantAfterToolResult?: boolean;
111
115
  cacheControlFormat?: "anthropic";
116
+ /** Extra keys merged into vLLM `chat_template_kwargs` on every request.
117
+ * Used for preserved-thinking flags like `preserve_thinking` / `clear_thinking`
118
+ * that some chat templates require for multi-turn reasoning continuity. */
119
+ chatTemplateKwargs?: Record<string, unknown>;
112
120
  };
113
121
  }
114
122
 
package/models.json CHANGED
@@ -63,8 +63,8 @@
63
63
  }
64
64
  },
65
65
  {
66
- "id": "MiniMaxAI/MiniMax-M3-MXFP8",
67
- "name": "MiniMax M3 MXFP8",
66
+ "id": "moonshotai/Kimi-K2.7-Code",
67
+ "name": "Kimi K2.7 Code",
68
68
  "reasoning": false,
69
69
  "input": [
70
70
  "text"
@@ -75,7 +75,7 @@
75
75
  "cacheRead": 0,
76
76
  "cacheWrite": 0
77
77
  },
78
- "contextWindow": 1048576,
78
+ "contextWindow": 262144,
79
79
  "maxTokens": 0,
80
80
  "compat": {
81
81
  "supportsDeveloperRole": false,
@@ -84,8 +84,8 @@
84
84
  }
85
85
  },
86
86
  {
87
- "id": "moonshotai/Kimi-K2.7-Code",
88
- "name": "Kimi K2.7 Code",
87
+ "id": "unsloth/Qwen3.6-27B-NVFP4",
88
+ "name": "Qwen 3.6 27B NVFP4",
89
89
  "reasoning": false,
90
90
  "input": [
91
91
  "text"
@@ -105,8 +105,8 @@
105
105
  }
106
106
  },
107
107
  {
108
- "id": "unsloth/Qwen3.6-27B-NVFP4",
109
- "name": "Qwen 3.6 27B NVFP4",
108
+ "id": "unsloth/Qwen3.6-35B-A3B-NVFP4",
109
+ "name": "Qwen 3.6 35B A3B NVFP4",
110
110
  "reasoning": false,
111
111
  "input": [
112
112
  "text"
@@ -126,8 +126,8 @@
126
126
  }
127
127
  },
128
128
  {
129
- "id": "unsloth/Qwen3.6-35B-A3B-NVFP4",
130
- "name": "Qwen 3.6 35B A3B NVFP4",
129
+ "id": "zai-org/GLM-5.2-FP8",
130
+ "name": "GLM 5.2 FP8",
131
131
  "reasoning": false,
132
132
  "input": [
133
133
  "text"
@@ -138,7 +138,7 @@
138
138
  "cacheRead": 0,
139
139
  "cacheWrite": 0
140
140
  },
141
- "contextWindow": 262144,
141
+ "contextWindow": 1048576,
142
142
  "maxTokens": 0,
143
143
  "compat": {
144
144
  "supportsDeveloperRole": false,
@@ -147,8 +147,8 @@
147
147
  }
148
148
  },
149
149
  {
150
- "id": "zai-org/GLM-5.2-FP8",
151
- "name": "GLM 5.2 FP8",
150
+ "id": "zai-org/GLM-5.2-NVFP4",
151
+ "name": "GLM 5.2 NVFP4",
152
152
  "reasoning": false,
153
153
  "input": [
154
154
  "text"
@@ -159,7 +159,7 @@
159
159
  "cacheRead": 0,
160
160
  "cacheWrite": 0
161
161
  },
162
- "contextWindow": 980000,
162
+ "contextWindow": 1048576,
163
163
  "maxTokens": 0,
164
164
  "compat": {
165
165
  "supportsDeveloperRole": false,
package/package.json CHANGED
@@ -1,17 +1,9 @@
1
1
  {
2
2
  "name": "pi-makora-provider",
3
- "version": "1.1.0",
4
- "description": "Makora provider extension for pi - Access DeepSeek V4, GLM 5.1, Kimi K2.6, Llama 3.3, Qwen 3.6, and more through the Makora inference API",
3
+ "version": "1.2.0",
4
+ "description": "Makora provider extension for pi - Access DeepSeek V4, GLM 5.2, Kimi K2.7 Code, Llama 3.3, Qwen 3.6, and more through the Makora inference API",
5
5
  "type": "module",
6
6
  "main": "index.ts",
7
- "scripts": {
8
- "clean": "echo 'nothing to clean'",
9
- "build": "echo 'nothing to build'",
10
- "check": "echo 'nothing to check'",
11
- "test": "vitest run",
12
- "test:watch": "vitest",
13
- "update-models": "node scripts/update-models.js"
14
- },
15
7
  "keywords": [
16
8
  "pi",
17
9
  "extension",
@@ -42,5 +34,13 @@
42
34
  },
43
35
  "devDependencies": {
44
36
  "vitest": "^4.1.9"
37
+ },
38
+ "scripts": {
39
+ "clean": "echo 'nothing to clean'",
40
+ "build": "echo 'nothing to build'",
41
+ "check": "echo 'nothing to check'",
42
+ "test": "vitest run",
43
+ "test:watch": "vitest",
44
+ "update-models": "node scripts/update-models.js"
45
45
  }
46
- }
46
+ }
package/patch.json CHANGED
@@ -16,7 +16,7 @@
16
16
  },
17
17
  "deepseek-ai/DeepSeek-V4-Pro": {
18
18
  "reasoning": true,
19
- "notes": "`chat_template_kwargs.thinking` via `before_provider_request` payload rewrite; returns `reasoning_content` field",
19
+ "notes": "`chat_template_kwargs.thinking` via `before_provider_request` payload rewrite; returns `reasoning` field",
20
20
  "thinkingLevelMap": {
21
21
  "minimal": null,
22
22
  "low": null,
@@ -60,26 +60,32 @@
60
60
  },
61
61
  "unsloth/Qwen3.6-27B-NVFP4": {
62
62
  "reasoning": true,
63
- "notes": "`enable_thinking` via `qwen-chat-template`; client-side tool call parsing (vLLM streaming parser bypass)",
63
+ "notes": "`enable_thinking` via `qwen-chat-template`; `preserve_thinking` via `chatTemplateKwargs` for multi-turn continuity; returns `reasoning` field; client-side tool call parsing (vLLM streaming parser bypass)",
64
64
  "thinkingLevelMap": {
65
65
  "minimal": "low",
66
66
  "xhigh": "high"
67
67
  },
68
68
  "compat": {
69
69
  "thinkingFormat": "qwen-chat-template",
70
- "supportsReasoningEffort": true
70
+ "supportsReasoningEffort": true,
71
+ "chatTemplateKwargs": {
72
+ "preserve_thinking": true
73
+ }
71
74
  }
72
75
  },
73
76
  "unsloth/Qwen3.6-35B-A3B-NVFP4": {
74
77
  "reasoning": true,
75
- "notes": "`enable_thinking` via `qwen-chat-template`; client-side tool call parsing (vLLM streaming parser bypass)",
78
+ "notes": "`enable_thinking` via `qwen-chat-template`; `preserve_thinking` via `chatTemplateKwargs` for multi-turn continuity; returns `reasoning` field; client-side tool call parsing (vLLM streaming parser bypass)",
76
79
  "thinkingLevelMap": {
77
80
  "minimal": "low",
78
81
  "xhigh": "high"
79
82
  },
80
83
  "compat": {
81
84
  "thinkingFormat": "qwen-chat-template",
82
- "supportsReasoningEffort": true
85
+ "supportsReasoningEffort": true,
86
+ "chatTemplateKwargs": {
87
+ "preserve_thinking": true
88
+ }
83
89
  }
84
90
  },
85
91
  "MiniMaxAI/MiniMax-M3-MXFP8": {
@@ -108,14 +114,17 @@
108
114
  "text",
109
115
  "image"
110
116
  ],
111
- "notes": "Reasoning on by default; client-side tool call parsing (vLLM streaming parser bypass)",
117
+ "notes": "Reasoning on by default (thinking-only model); `preserve_thinking` via `chatTemplateKwargs` for multi-turn continuity; returns `reasoning` field; client-side tool call parsing (vLLM streaming parser bypass)",
112
118
  "thinkingLevelMap": {
113
119
  "minimal": "low",
114
120
  "xhigh": "high"
115
121
  },
116
122
  "compat": {
117
123
  "thinkingFormat": "qwen-chat-template",
118
- "supportsReasoningEffort": true
124
+ "supportsReasoningEffort": true,
125
+ "chatTemplateKwargs": {
126
+ "preserve_thinking": true
127
+ }
119
128
  }
120
129
  },
121
130
  "zai-org/GLM-5.1-FP8": {
@@ -134,11 +143,26 @@
134
143
  },
135
144
  "zai-org/GLM-5.2-FP8": {
136
145
  "reasoning": true,
137
- "notes": "`enable_thinking` via `qwen-chat-template`; thinking levels copied from neuralwatt GLM 5.2; returns `reasoning_content` field",
146
+ "notes": "`enable_thinking` via `qwen-chat-template`; effort via `reasoning_effort` (only `high`/`max` distinct, per vLLM GLM-5.2 recipe); thinking levels aligned with neuralwatt GLM 5.2; returns `reasoning` field",
138
147
  "thinkingLevelMap": {
139
- "minimal": "minimal",
140
- "low": "low",
141
- "medium": "medium",
148
+ "minimal": null,
149
+ "low": null,
150
+ "medium": null,
151
+ "high": "high",
152
+ "xhigh": "max"
153
+ },
154
+ "compat": {
155
+ "thinkingFormat": "qwen-chat-template",
156
+ "supportsReasoningEffort": true
157
+ }
158
+ },
159
+ "zai-org/GLM-5.2-NVFP4": {
160
+ "reasoning": true,
161
+ "notes": "`enable_thinking` via `qwen-chat-template`; effort via `reasoning_effort` (only `high`/`max` distinct, per vLLM GLM-5.2 recipe); returns `reasoning` field",
162
+ "thinkingLevelMap": {
163
+ "minimal": null,
164
+ "low": null,
165
+ "medium": null,
142
166
  "high": "high",
143
167
  "xhigh": "max"
144
168
  },