@phi-code-admin/phi-code 0.60.3 → 0.60.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.
@@ -10,7 +10,7 @@
10
10
  "name": "Qwen 3.5 Plus",
11
11
  "reasoning": true,
12
12
  "input": ["text"],
13
- "contextWindow": 131072,
13
+ "contextWindow": 1000000,
14
14
  "maxTokens": 16384
15
15
  },
16
16
  {
@@ -18,23 +18,23 @@
18
18
  "name": "Qwen 3 Max",
19
19
  "reasoning": true,
20
20
  "input": ["text"],
21
- "contextWindow": 131072,
21
+ "contextWindow": 262144,
22
22
  "maxTokens": 16384
23
23
  },
24
24
  {
25
25
  "id": "qwen3-coder-plus",
26
26
  "name": "Qwen 3 Coder Plus",
27
- "reasoning": false,
27
+ "reasoning": true,
28
28
  "input": ["text"],
29
- "contextWindow": 131072,
29
+ "contextWindow": 1000000,
30
30
  "maxTokens": 16384
31
31
  },
32
32
  {
33
33
  "id": "qwen3-coder-next",
34
34
  "name": "Qwen 3 Coder Next",
35
- "reasoning": false,
35
+ "reasoning": true,
36
36
  "input": ["text"],
37
- "contextWindow": 131072,
37
+ "contextWindow": 1000000,
38
38
  "maxTokens": 16384
39
39
  },
40
40
  {
@@ -42,31 +42,31 @@
42
42
  "name": "Kimi K2.5",
43
43
  "reasoning": true,
44
44
  "input": ["text"],
45
- "contextWindow": 131072,
45
+ "contextWindow": 262144,
46
46
  "maxTokens": 16384
47
47
  },
48
48
  {
49
49
  "id": "glm-5",
50
50
  "name": "GLM 5",
51
- "reasoning": false,
51
+ "reasoning": true,
52
52
  "input": ["text"],
53
- "contextWindow": 131072,
54
- "maxTokens": 16384
53
+ "contextWindow": 200000,
54
+ "maxTokens": 128000
55
55
  },
56
56
  {
57
57
  "id": "glm-4.7",
58
58
  "name": "GLM 4.7",
59
- "reasoning": false,
59
+ "reasoning": true,
60
60
  "input": ["text"],
61
- "contextWindow": 131072,
62
- "maxTokens": 16384
61
+ "contextWindow": 200000,
62
+ "maxTokens": 128000
63
63
  },
64
64
  {
65
65
  "id": "MiniMax-M2.5",
66
66
  "name": "MiniMax M2.5",
67
- "reasoning": false,
67
+ "reasoning": true,
68
68
  "input": ["text"],
69
- "contextWindow": 131072,
69
+ "contextWindow": 1000000,
70
70
  "maxTokens": 16384
71
71
  }
72
72
  ]
@@ -37,6 +37,38 @@ interface RoutingConfig {
37
37
  default: { model: string; agent: string | null };
38
38
  }
39
39
 
40
+ // ─── Model Database ─────────────────────────────────────────────────────
41
+
42
+ const MODEL_DB: Record<string, { contextWindow: number; maxTokens: number; reasoning: boolean }> = {
43
+ // Alibaba / DashScope
44
+ "qwen3.5-plus": { contextWindow: 1000000, maxTokens: 16384, reasoning: true },
45
+ "qwen3-max-2026-01-23": { contextWindow: 262144, maxTokens: 16384, reasoning: true },
46
+ "qwen3-coder-plus": { contextWindow: 1000000, maxTokens: 16384, reasoning: true },
47
+ "qwen3-coder-next": { contextWindow: 1000000, maxTokens: 16384, reasoning: true },
48
+ "kimi-k2.5": { contextWindow: 262144, maxTokens: 16384, reasoning: true },
49
+ "glm-5": { contextWindow: 200000, maxTokens: 128000, reasoning: true },
50
+ "glm-4.7": { contextWindow: 200000, maxTokens: 128000, reasoning: true },
51
+ "MiniMax-M2.5": { contextWindow: 1000000, maxTokens: 16384, reasoning: true },
52
+ // OpenAI
53
+ "gpt-4o": { contextWindow: 128000, maxTokens: 16384, reasoning: false },
54
+ "gpt-4o-mini": { contextWindow: 128000, maxTokens: 16384, reasoning: false },
55
+ "o1": { contextWindow: 200000, maxTokens: 100000, reasoning: true },
56
+ "o3-mini": { contextWindow: 200000, maxTokens: 100000, reasoning: true },
57
+ // Anthropic
58
+ "claude-sonnet-4-20250514": { contextWindow: 200000, maxTokens: 64000, reasoning: true },
59
+ "claude-3-5-haiku-20241022": { contextWindow: 200000, maxTokens: 8192, reasoning: false },
60
+ // Google
61
+ "gemini-2.5-pro": { contextWindow: 1000000, maxTokens: 65536, reasoning: true },
62
+ "gemini-2.5-flash": { contextWindow: 1000000, maxTokens: 65536, reasoning: true },
63
+ // Groq
64
+ "llama-3.3-70b-versatile": { contextWindow: 128000, maxTokens: 32768, reasoning: false },
65
+ "mixtral-8x7b-32768": { contextWindow: 32768, maxTokens: 4096, reasoning: false },
66
+ };
67
+
68
+ function getModelSpec(id: string): { contextWindow: number; maxTokens: number; reasoning: boolean } {
69
+ return MODEL_DB[id] || { contextWindow: 128000, maxTokens: 16384, reasoning: true };
70
+ }
71
+
40
72
  // ─── Provider Detection ──────────────────────────────────────────────────
41
73
 
42
74
  function detectProviders(): DetectedProvider[] {
@@ -698,14 +730,17 @@ _Edit this file to customize Phi Code's behavior for your project._
698
730
  baseUrl: chosen.baseUrl,
699
731
  api: "openai-completions",
700
732
  apiKey: apiKey.trim(),
701
- models: chosen.models.map((id: string) => ({
702
- id,
703
- name: id,
704
- reasoning: true,
705
- input: ["text"],
706
- contextWindow: 131072,
707
- maxTokens: 16384,
708
- })),
733
+ models: chosen.models.map((id: string) => {
734
+ const spec = getModelSpec(id);
735
+ return {
736
+ id,
737
+ name: id,
738
+ reasoning: spec.reasoning,
739
+ input: ["text"],
740
+ contextWindow: spec.contextWindow,
741
+ maxTokens: spec.maxTokens,
742
+ };
743
+ }),
709
744
  };
710
745
 
711
746
  await writeFile(modelsJsonPath, JSON.stringify(modelsConfig, null, 2), "utf-8");
@@ -913,10 +948,13 @@ For persistence, set environment variables:
913
948
  baseUrl: providerDef.baseUrl,
914
949
  api: "openai-completions",
915
950
  apiKey: key,
916
- models: providerDef.models.map((id: string) => ({
917
- id, name: id, reasoning: true, input: ["text"],
918
- contextWindow: 131072, maxTokens: 16384,
919
- })),
951
+ models: providerDef.models.map((id: string) => {
952
+ const spec = getModelSpec(id);
953
+ return {
954
+ id, name: id, reasoning: spec.reasoning, input: ["text"],
955
+ contextWindow: spec.contextWindow, maxTokens: spec.maxTokens,
956
+ };
957
+ }),
920
958
  };
921
959
  writeFileSync(modelsJsonPath, JSON.stringify(modelsConfig, null, 2), "utf-8");
922
960
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phi-code-admin/phi-code",
3
- "version": "0.60.3",
3
+ "version": "0.60.4",
4
4
  "description": "Coding agent CLI with read, bash, edit, write tools and session management",
5
5
  "type": "module",
6
6
  "piConfig": {