gpteam 0.1.1 → 0.1.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
@@ -6,7 +6,7 @@ Interactive GPTeam API client configurator.
6
6
  npx gpteam
7
7
  ```
8
8
 
9
- The CLI asks for an API key, detects available models, benchmarks all production ingress endpoints with real API requests, then backs up old files and writes the selected client configuration.
9
+ The CLI asks for an API key, detects available models, benchmarks all production ingress endpoints with real API requests, then backs up old files and writes the selected client configuration. Ingress endpoints are benchmarked in parallel, while rounds for the same endpoint remain sequential to keep real API request pressure bounded.
10
10
 
11
11
  Supported clients:
12
12
 
package/lib/bench.js CHANGED
@@ -5,14 +5,14 @@ import { inspectSSEBody } from './sse.js';
5
5
 
6
6
  export async function benchmarkNodes(nodes, options) {
7
7
  const rounds = options.rounds || 3;
8
- const results = [];
9
- for (const node of nodes) {
8
+ const runBenchmark = options.benchmarkNode || benchmarkNode;
9
+ const results = await Promise.all(nodes.map(async (node) => {
10
10
  const samples = [];
11
11
  for (let index = 0; index < rounds; index += 1) {
12
- samples.push(await benchmarkNode(node, options));
12
+ samples.push(await runBenchmark(node, options));
13
13
  }
14
- results.push(summarizeNode(node, samples));
15
- }
14
+ return summarizeNode(node, samples);
15
+ }));
16
16
  return results.sort((a, b) => scoreResult(a) - scoreResult(b));
17
17
  }
18
18
 
package/lib/cli.js CHANGED
@@ -31,6 +31,7 @@ export async function runCli(argv = []) {
31
31
  const maxOutputTokens = Number(args.maxOutputTokens || 648);
32
32
 
33
33
  console.log('\n开始真实测速:GET /api/health + POST /v1/responses stream=true');
34
+ console.log('测速会按入口并行执行,每个入口内部仍按轮次顺序执行,避免同时打出过多真实请求。');
34
35
  console.log(`模型:${model.id},测速输出上限:${maxOutputTokens}`);
35
36
  const results = await benchmarkNodes(INGRESS_NODES, {
36
37
  apiKey,
@@ -129,7 +130,7 @@ async function chooseModel(rl, models, preferred) {
129
130
  async function askContextLength(rl, model, preferred) {
130
131
  const max = Number(model.contextLength || 400000);
131
132
  if (preferred) return clamp(Number(preferred), 1, max);
132
- const answer = await rl.question(`请输入上下文长度(最大 ${max},输出上限 ${model.maxOutputTokens},默认 ${max},回车即选择默认):`);
133
+ const answer = await rl.question(`请输入上下文窗口(最大 ${max},输出上限 ${model.maxOutputTokens},默认 ${max},回车即选择默认):`);
133
134
  return clamp(Number(answer || max), 1, max);
134
135
  }
135
136
 
@@ -186,7 +187,7 @@ function clamp(value, min, max) {
186
187
  export function formatModelLabel(model) {
187
188
  const context = Number(model.contextLength || 0);
188
189
  const outputTokens = Number(model.maxOutputTokens || 0);
189
- return `${model.id}(输入上下文 ${context},输出上限 ${outputTokens})`;
190
+ return `${model.id}(上下文窗口 ${context},输出上限 ${outputTokens})`;
190
191
  }
191
192
 
192
193
  export function formatNodeLabel(node) {
package/lib/help.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export const PACKAGE_NAME = 'gpteam';
2
- export const PACKAGE_VERSION = '0.1.1';
2
+ export const PACKAGE_VERSION = '0.1.2';
3
3
 
4
4
  export function getHelpText() {
5
5
  return [
@@ -13,7 +13,7 @@ export function getHelpText() {
13
13
  ' --api-key <key> 预填 API key',
14
14
  ' --client <id> codex / opencode / claude-code / openclaw',
15
15
  ' --model <id> 预选模型,例如 gpt-5.5',
16
- ' --context <tokens> 预设上下文长度',
16
+ ' --context <tokens> 预设上下文窗口',
17
17
  ' --effort <level> 按模型支持项预选,常见为 none / low / medium / high / xhigh',
18
18
  ' --node <id> jp-direct / jp-split / hk-split / us-split',
19
19
  ' --rounds <n> 每个入口测速轮数,默认 3',
@@ -21,6 +21,6 @@ export function getHelpText() {
21
21
  ' --help 显示帮助',
22
22
  ' --version 显示版本',
23
23
  '',
24
- '说明:测速会请求 GET /api/health 和流式 POST /v1/responses。写新配置前会先备份旧配置。'
24
+ '说明:测速会请求 GET /api/health 和流式 POST /v1/responses。入口之间并行测速,写新配置前会先备份旧配置。'
25
25
  ].join('\n');
26
26
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gpteam",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "GPTeam API interactive client configurator and ingress benchmark CLI.",
5
5
  "type": "module",
6
6
  "bin": {