@aliou/pi-synthetic 0.13.0 → 0.13.2

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
@@ -1,3 +1,5 @@
1
+ ![banner](https://assets.aliou.me/pi-extensions/banners/pi-synthetic.png)
2
+
1
3
  # Pi Synthetic Extension
2
4
 
3
5
  A Pi extension that adds [Synthetic](https://synthetic.new) as a model provider, giving you access to open-source models through an OpenAI-compatible API.
@@ -162,4 +164,4 @@ This repository uses [Changesets](https://github.com/changesets/changesets) for
162
164
  - [Synthetic](https://synthetic.new)
163
165
  - [Synthetic Models](https://synthetic.new/models)
164
166
  - [Synthetic API Docs](https://dev.synthetic.new/docs/api/overview)
165
- - [Pi Documentation](https://buildwithpi.ai/)
167
+ - [Pi Documentation](https://buildwithpi.ai/)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aliou/pi-synthetic",
3
- "version": "0.13.0",
3
+ "version": "0.13.2",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "private": false,
@@ -63,14 +63,8 @@ export function registerSyntheticProvider(pi: ExtensionAPI): void {
63
63
  Referer: "https://pi.dev",
64
64
  "X-Title": "npm:@aliou/pi-synthetic",
65
65
  },
66
- models: SYNTHETIC_MODELS.map((model) => ({
67
- id: model.id,
68
- name: model.name,
69
- reasoning: model.reasoning,
70
- input: model.input,
71
- cost: model.cost,
72
- contextWindow: model.contextWindow,
73
- maxTokens: model.maxTokens,
66
+ models: SYNTHETIC_MODELS.map(({ provider: _provider, ...model }) => ({
67
+ ...model,
74
68
  compat: {
75
69
  supportsDeveloperRole: false,
76
70
  maxTokensField: "max_tokens",
@@ -4,6 +4,7 @@ import { SYNTHETIC_MODELS } from "./models";
4
4
  interface ApiModel {
5
5
  id: string;
6
6
  name: string;
7
+ provider: string | null;
7
8
  input_modalities: string[];
8
9
  output_modalities: string[];
9
10
  context_length: number;
@@ -156,6 +157,19 @@ function compareModels(
156
157
  });
157
158
  }
158
159
  }
160
+
161
+ // Check provider
162
+ if (
163
+ apiModel.provider !== null &&
164
+ apiModel.provider !== hardcoded.provider
165
+ ) {
166
+ discrepancies.push({
167
+ model: hardcoded.id,
168
+ field: "provider",
169
+ hardcoded: hardcoded.provider,
170
+ api: apiModel.provider,
171
+ });
172
+ }
159
173
  }
160
174
 
161
175
  // Check for API models not in hardcoded list
@@ -2,29 +2,11 @@
2
2
  // Source: https://api.synthetic.new/openai/v1/models
3
3
  // maxTokens sourced from https://models.dev/api.json (synthetic provider)
4
4
 
5
- export interface SyntheticModelConfig {
6
- id: string;
7
- name: string;
8
- reasoning: boolean;
9
- input: ("text" | "image")[];
10
- cost: {
11
- input: number;
12
- output: number;
13
- cacheRead: number;
14
- cacheWrite: number;
15
- };
16
- contextWindow: number;
17
- maxTokens: number;
18
- compat?: {
19
- supportsDeveloperRole?: boolean;
20
- supportsReasoningEffort?: boolean;
21
- reasoningEffortMap?: Partial<
22
- Record<"minimal" | "low" | "medium" | "high" | "xhigh", string>
23
- >;
24
- maxTokensField?: "max_completion_tokens" | "max_tokens";
25
- requiresToolResultName?: boolean;
26
- requiresMistralToolIds?: boolean;
27
- };
5
+ import type { ProviderModelConfig } from "@mariozechner/pi-coding-agent";
6
+
7
+ export interface SyntheticModelConfig extends ProviderModelConfig {
8
+ /** Upstream backend Synthetic proxies this model through (e.g. "fireworks", "together", "synthetic"). */
9
+ provider: string;
28
10
  }
29
11
 
30
12
  const SYNTHETIC_REASONING_EFFORT_MAP = {
@@ -36,20 +18,21 @@ const SYNTHETIC_REASONING_EFFORT_MAP = {
36
18
  } as const;
37
19
 
38
20
  export const SYNTHETIC_MODELS: SyntheticModelConfig[] = [
39
- // API: hf:zai-org/GLM-4.7 → ctx=202752 (provider: fireworks)
21
+ // API: hf:zai-org/GLM-4.7 → ctx=202752
40
22
  {
41
23
  id: "hf:zai-org/GLM-4.7",
42
24
  name: "zai-org/GLM-4.7",
25
+ provider: "synthetic",
43
26
  reasoning: true,
44
27
  compat: {
45
28
  supportsReasoningEffort: true,
46
29
  reasoningEffortMap: SYNTHETIC_REASONING_EFFORT_MAP,
47
30
  },
48
- input: ["text", "image"],
31
+ input: ["text"],
49
32
  cost: {
50
- input: 2.19,
33
+ input: 0.45,
51
34
  output: 2.19,
52
- cacheRead: 2.19,
35
+ cacheRead: 0.45,
53
36
  cacheWrite: 0,
54
37
  },
55
38
  contextWindow: 202752,
@@ -59,6 +42,7 @@ export const SYNTHETIC_MODELS: SyntheticModelConfig[] = [
59
42
  {
60
43
  id: "hf:zai-org/GLM-5",
61
44
  name: "zai-org/GLM-5",
45
+ provider: "synthetic",
62
46
  reasoning: true,
63
47
  compat: {
64
48
  supportsReasoningEffort: true,
@@ -78,6 +62,7 @@ export const SYNTHETIC_MODELS: SyntheticModelConfig[] = [
78
62
  {
79
63
  id: "hf:zai-org/GLM-5.1",
80
64
  name: "zai-org/GLM-5.1",
65
+ provider: "synthetic",
81
66
  reasoning: true,
82
67
  compat: {
83
68
  supportsReasoningEffort: true,
@@ -98,6 +83,7 @@ export const SYNTHETIC_MODELS: SyntheticModelConfig[] = [
98
83
  {
99
84
  id: "hf:zai-org/GLM-4.7-Flash",
100
85
  name: "zai-org/GLM-4.7-Flash",
86
+ provider: "synthetic",
101
87
  reasoning: true,
102
88
  compat: {
103
89
  supportsReasoningEffort: true,
@@ -117,6 +103,7 @@ export const SYNTHETIC_MODELS: SyntheticModelConfig[] = [
117
103
  {
118
104
  id: "hf:MiniMaxAI/MiniMax-M2.1",
119
105
  name: "MiniMaxAI/MiniMax-M2.1",
106
+ provider: "fireworks",
120
107
  reasoning: true,
121
108
  compat: {
122
109
  supportsReasoningEffort: true,
@@ -136,6 +123,7 @@ export const SYNTHETIC_MODELS: SyntheticModelConfig[] = [
136
123
  {
137
124
  id: "hf:meta-llama/Llama-3.3-70B-Instruct",
138
125
  name: "meta-llama/Llama-3.3-70B-Instruct",
126
+ provider: "together",
139
127
  reasoning: false,
140
128
  input: ["text"],
141
129
  cost: {
@@ -151,6 +139,7 @@ export const SYNTHETIC_MODELS: SyntheticModelConfig[] = [
151
139
  {
152
140
  id: "hf:deepseek-ai/DeepSeek-R1-0528",
153
141
  name: "deepseek-ai/DeepSeek-R1-0528",
142
+ provider: "together",
154
143
  reasoning: true,
155
144
  compat: {
156
145
  supportsReasoningEffort: true,
@@ -170,6 +159,7 @@ export const SYNTHETIC_MODELS: SyntheticModelConfig[] = [
170
159
  {
171
160
  id: "hf:deepseek-ai/DeepSeek-V3.2",
172
161
  name: "deepseek-ai/DeepSeek-V3.2",
162
+ provider: "fireworks",
173
163
  reasoning: false,
174
164
  input: ["text"],
175
165
  cost: {
@@ -185,6 +175,7 @@ export const SYNTHETIC_MODELS: SyntheticModelConfig[] = [
185
175
  {
186
176
  id: "hf:moonshotai/Kimi-K2-Instruct-0905",
187
177
  name: "moonshotai/Kimi-K2-Instruct-0905",
178
+ provider: "fireworks",
188
179
  reasoning: false,
189
180
  input: ["text"],
190
181
  cost: {
@@ -200,6 +191,7 @@ export const SYNTHETIC_MODELS: SyntheticModelConfig[] = [
200
191
  {
201
192
  id: "hf:moonshotai/Kimi-K2-Thinking",
202
193
  name: "moonshotai/Kimi-K2-Thinking",
194
+ provider: "fireworks",
203
195
  reasoning: true,
204
196
  compat: {
205
197
  supportsReasoningEffort: true,
@@ -219,6 +211,7 @@ export const SYNTHETIC_MODELS: SyntheticModelConfig[] = [
219
211
  {
220
212
  id: "hf:openai/gpt-oss-120b",
221
213
  name: "openai/gpt-oss-120b",
214
+ provider: "fireworks",
222
215
  reasoning: false,
223
216
  input: ["text"],
224
217
  cost: {
@@ -234,6 +227,7 @@ export const SYNTHETIC_MODELS: SyntheticModelConfig[] = [
234
227
  {
235
228
  id: "hf:Qwen/Qwen3-Coder-480B-A35B-Instruct",
236
229
  name: "Qwen/Qwen3-Coder-480B-A35B-Instruct",
230
+ provider: "together",
237
231
  reasoning: true,
238
232
  compat: {
239
233
  supportsReasoningEffort: true,
@@ -253,6 +247,7 @@ export const SYNTHETIC_MODELS: SyntheticModelConfig[] = [
253
247
  {
254
248
  id: "hf:moonshotai/Kimi-K2.5",
255
249
  name: "moonshotai/Kimi-K2.5",
250
+ provider: "synthetic",
256
251
  reasoning: true,
257
252
  compat: {
258
253
  supportsReasoningEffort: true,
@@ -272,6 +267,7 @@ export const SYNTHETIC_MODELS: SyntheticModelConfig[] = [
272
267
  {
273
268
  id: "hf:nvidia/Kimi-K2.5-NVFP4",
274
269
  name: "nvidia/Kimi-K2.5-NVFP4",
270
+ provider: "synthetic",
275
271
  reasoning: true,
276
272
  compat: {
277
273
  supportsReasoningEffort: true,
@@ -291,6 +287,7 @@ export const SYNTHETIC_MODELS: SyntheticModelConfig[] = [
291
287
  {
292
288
  id: "hf:deepseek-ai/DeepSeek-V3",
293
289
  name: "deepseek-ai/DeepSeek-V3",
290
+ provider: "together",
294
291
  reasoning: false,
295
292
  input: ["text"],
296
293
  cost: {
@@ -306,6 +303,7 @@ export const SYNTHETIC_MODELS: SyntheticModelConfig[] = [
306
303
  {
307
304
  id: "hf:Qwen/Qwen3-235B-A22B-Thinking-2507",
308
305
  name: "Qwen/Qwen3-235B-A22B-Thinking-2507",
306
+ provider: "together",
309
307
  reasoning: true,
310
308
  compat: {
311
309
  supportsReasoningEffort: true,
@@ -325,6 +323,7 @@ export const SYNTHETIC_MODELS: SyntheticModelConfig[] = [
325
323
  {
326
324
  id: "hf:Qwen/Qwen3.5-397B-A17B",
327
325
  name: "Qwen/Qwen3.5-397B-A17B",
326
+ provider: "together",
328
327
  reasoning: true,
329
328
  compat: {
330
329
  supportsReasoningEffort: true,
@@ -344,6 +343,7 @@ export const SYNTHETIC_MODELS: SyntheticModelConfig[] = [
344
343
  {
345
344
  id: "hf:MiniMaxAI/MiniMax-M2.5",
346
345
  name: "MiniMaxAI/MiniMax-M2.5",
346
+ provider: "synthetic",
347
347
  reasoning: true,
348
348
  input: ["text"],
349
349
  cost: {
@@ -364,6 +364,7 @@ export const SYNTHETIC_MODELS: SyntheticModelConfig[] = [
364
364
  {
365
365
  id: "hf:nvidia/NVIDIA-Nemotron-3-Super-120B-A12B-NVFP4",
366
366
  name: "nvidia/NVIDIA-Nemotron-3-Super-120B-A12B-NVFP4",
367
+ provider: "synthetic",
367
368
  reasoning: true,
368
369
  compat: {
369
370
  supportsReasoningEffort: true,
@@ -44,6 +44,12 @@ export function registerSyntheticWebSearchTool(pi: ExtensionAPI): void {
44
44
  label: "Synthetic: Web Search",
45
45
  description:
46
46
  "Search the web using Synthetic's zero-data-retention API. Returns search results with titles, URLs, content snippets, and publication dates. Use for finding documentation, articles, recent information, or any web content. Results are fresh and not cached by Synthetic.",
47
+ promptSnippet: "Search the web using Synthetic's zero-data-retention API",
48
+ promptGuidelines: [
49
+ "Use synthetic_web_search for finding documentation, articles, recent information, or any web content.",
50
+ "Write specific queries with names, dates, versions, or locations for synthetic_web_search.",
51
+ "synthetic_web_search results are fresh and not cached by Synthetic.",
52
+ ],
47
53
  parameters: SearchParams,
48
54
 
49
55
  async execute(