starforge-cli 0.1.9__tar.gz → 0.1.11__tar.gz
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.
- {starforge_cli-0.1.9 → starforge_cli-0.1.11}/PKG-INFO +2 -2
- {starforge_cli-0.1.9 → starforge_cli-0.1.11}/pyproject.toml +2 -2
- {starforge_cli-0.1.9 → starforge_cli-0.1.11}/starforge_cli/__init__.py +1 -1
- {starforge_cli-0.1.9 → starforge_cli-0.1.11}/starforge_cli/auth.py +1 -1
- {starforge_cli-0.1.9 → starforge_cli-0.1.11}/starforge_cli/cli_ui.py +2 -2
- {starforge_cli-0.1.9 → starforge_cli-0.1.11}/starforge_cli/client_device.py +3 -3
- starforge_cli-0.1.11/starforge_cli/commands/__init__.py +1 -0
- {starforge_cli-0.1.9 → starforge_cli-0.1.11}/starforge_cli/commands/admin.py +1 -1
- {starforge_cli-0.1.9 → starforge_cli-0.1.11}/starforge_cli/commands/jobs.py +3 -3
- {starforge_cli-0.1.9 → starforge_cli-0.1.11}/starforge_cli/commands/login.py +3 -3
- {starforge_cli-0.1.9 → starforge_cli-0.1.11}/starforge_cli/commands/plugin.py +2 -1
- {starforge_cli-0.1.9 → starforge_cli-0.1.11}/starforge_cli/commands/serve.py +2 -2
- {starforge_cli-0.1.9 → starforge_cli-0.1.11}/starforge_cli/packing.py +1 -1
- starforge_cli-0.1.9/starforge_cli/commands/__init__.py +0 -1
- {starforge_cli-0.1.9 → starforge_cli-0.1.11}/.gitignore +0 -0
- {starforge_cli-0.1.9 → starforge_cli-0.1.11}/README.md +0 -0
- {starforge_cli-0.1.9 → starforge_cli-0.1.11}/starforge_cli/api_client.py +0 -0
- {starforge_cli-0.1.9 → starforge_cli-0.1.11}/starforge_cli/catalog.py +0 -0
- {starforge_cli-0.1.9 → starforge_cli-0.1.11}/starforge_cli/cli.py +0 -0
- {starforge_cli-0.1.9 → starforge_cli-0.1.11}/starforge_cli/commands/bench.py +0 -0
- {starforge_cli-0.1.9 → starforge_cli-0.1.11}/starforge_cli/commands/common.py +0 -0
- {starforge_cli-0.1.9 → starforge_cli-0.1.11}/starforge_cli/commands/corpus.py +0 -0
- {starforge_cli-0.1.9 → starforge_cli-0.1.11}/starforge_cli/commands/dataset.py +0 -0
- {starforge_cli-0.1.9 → starforge_cli-0.1.11}/starforge_cli/commands/exp.py +0 -0
- {starforge_cli-0.1.9 → starforge_cli-0.1.11}/starforge_cli/commands/init.py +0 -0
- {starforge_cli-0.1.9 → starforge_cli-0.1.11}/starforge_cli/commands/recipe.py +0 -0
- {starforge_cli-0.1.9 → starforge_cli-0.1.11}/starforge_cli/commands/submit.py +0 -0
- {starforge_cli-0.1.9 → starforge_cli-0.1.11}/starforge_cli/commands/sweep.py +0 -0
- {starforge_cli-0.1.9 → starforge_cli-0.1.11}/starforge_cli/config_resolve.py +0 -0
- {starforge_cli-0.1.9 → starforge_cli-0.1.11}/starforge_cli/data_prep.py +0 -0
- {starforge_cli-0.1.9 → starforge_cli-0.1.11}/starforge_cli/new_experiment.py +0 -0
- {starforge_cli-0.1.9 → starforge_cli-0.1.11}/starforge_cli/plugins_lock.py +0 -0
- {starforge_cli-0.1.9 → starforge_cli-0.1.11}/starforge_cli/recipe_lock.py +0 -0
- {starforge_cli-0.1.9 → starforge_cli-0.1.11}/starforge_cli/repo.py +0 -0
- {starforge_cli-0.1.9 → starforge_cli-0.1.11}/starforge_cli/scaffold/agent-run.py.tmpl +0 -0
- {starforge_cli-0.1.9 → starforge_cli-0.1.11}/starforge_cli/scaffold/custom-framework/train.sh +0 -0
- {starforge_cli-0.1.9 → starforge_cli-0.1.11}/starforge_cli/scaffold/experiment-template/.gitkeep +0 -0
- {starforge_cli-0.1.9 → starforge_cli-0.1.11}/starforge_cli/scaffold/experiment-template/README.md +0 -0
- {starforge_cli-0.1.9 → starforge_cli-0.1.11}/starforge_cli/scaffold/experiment-template/config.yaml +0 -0
- {starforge_cli-0.1.9 → starforge_cli-0.1.11}/starforge_cli/scaffold/project/common/README.md +0 -0
- {starforge_cli-0.1.9 → starforge_cli-0.1.11}/starforge_cli/scaffold/project/common/__init__.py +0 -0
- {starforge_cli-0.1.9 → starforge_cli-0.1.11}/starforge_cli/scaffold/project/configs/README.md +0 -0
- {starforge_cli-0.1.9 → starforge_cli-0.1.11}/starforge_cli/scaffold/project/configs/base/README.md +0 -0
- {starforge_cli-0.1.9 → starforge_cli-0.1.11}/starforge_cli/scaffold/project/configs/base/distillation_math.yaml +0 -0
- {starforge_cli-0.1.9 → starforge_cli-0.1.11}/starforge_cli/scaffold/project/configs/base/grpo_lora.yaml +0 -0
- {starforge_cli-0.1.9 → starforge_cli-0.1.11}/starforge_cli/scaffold/project/configs/base/grpo_math_1B.yaml +0 -0
- {starforge_cli-0.1.9 → starforge_cli-0.1.11}/starforge_cli/scaffold/project/configs/base/grpo_megatron.yaml +0 -0
- {starforge_cli-0.1.9 → starforge_cli-0.1.11}/starforge_cli/scaffold/project/configs/base/grpo_noncolocated.yaml +0 -0
- {starforge_cli-0.1.9 → starforge_cli-0.1.11}/starforge_cli/scaffold/project/configs/base/grpo_sliding_puzzle.yaml +0 -0
- {starforge_cli-0.1.9 → starforge_cli-0.1.11}/starforge_cli/scaffold/project/configs/base/ppo_math_1B.yaml +0 -0
- {starforge_cli-0.1.9 → starforge_cli-0.1.11}/starforge_cli/scaffold/project/configs/base/rm.yaml +0 -0
- {starforge_cli-0.1.9 → starforge_cli-0.1.11}/starforge_cli/scaffold/project/configs/base/sft.yaml +0 -0
- {starforge_cli-0.1.9 → starforge_cli-0.1.11}/starforge_cli/scaffold/project/configs/models/README.md +0 -0
- {starforge_cli-0.1.9 → starforge_cli-0.1.11}/starforge_cli/scaffold/project/configs/models/qwen3.5-4b.yaml +0 -0
- {starforge_cli-0.1.9 → starforge_cli-0.1.11}/starforge_cli/scaffold/project/configs/models/qwen3.5-9b.yaml +0 -0
- {starforge_cli-0.1.9 → starforge_cli-0.1.11}/starforge_cli/scaffold/project/gitignore +0 -0
- {starforge_cli-0.1.9 → starforge_cli-0.1.11}/starforge_cli/spec_builder.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: starforge-cli
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.11
|
|
4
4
|
Summary: StarForge(星锻)命令行客户端:pip 安装后用 sf init 创建微调项目,再提交训练。
|
|
5
5
|
Project-URL: Homepage, https://github.com/wccdev/starforge
|
|
6
6
|
Project-URL: Documentation, https://github.com/wccdev/starforge
|
|
@@ -18,7 +18,7 @@ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
|
18
18
|
Requires-Python: >=3.10
|
|
19
19
|
Requires-Dist: datasets>=2.18
|
|
20
20
|
Requires-Dist: pyyaml>=6
|
|
21
|
-
Requires-Dist: starforge-core==0.2.
|
|
21
|
+
Requires-Dist: starforge-core==0.2.4
|
|
22
22
|
Requires-Dist: typer>=0.12
|
|
23
23
|
Provides-Extra: dev
|
|
24
24
|
Requires-Dist: fastapi>=0.110; extra == 'dev'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "starforge-cli"
|
|
3
|
-
version = "0.1.
|
|
3
|
+
version = "0.1.11"
|
|
4
4
|
description = "StarForge(星锻)命令行客户端:pip 安装后用 sf init 创建微调项目,再提交训练。"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.10"
|
|
@@ -17,7 +17,7 @@ classifiers = [
|
|
|
17
17
|
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
18
18
|
]
|
|
19
19
|
dependencies = [
|
|
20
|
-
"starforge-core==0.2.
|
|
20
|
+
"starforge-core==0.2.4",
|
|
21
21
|
"typer>=0.12",
|
|
22
22
|
"datasets>=2.18",
|
|
23
23
|
"pyyaml>=6",
|
|
@@ -272,7 +272,7 @@ class _PlainReporter:
|
|
|
272
272
|
|
|
273
273
|
def start_upload(self, total_bytes: int) -> None:
|
|
274
274
|
self._mark_phase_done("打包完成")
|
|
275
|
-
typer.echo(f" · 上传到
|
|
275
|
+
typer.echo(f" · 上传到 StarForge({human_bytes(total_bytes)})…", err=True)
|
|
276
276
|
|
|
277
277
|
def upload_tick(self, n: int) -> None:
|
|
278
278
|
pass
|
|
@@ -314,7 +314,7 @@ class _PipelineReporter:
|
|
|
314
314
|
self._upload_done = 0
|
|
315
315
|
self._stages = {
|
|
316
316
|
"pack": _StageState("pack", "打包工作目录"),
|
|
317
|
-
"upload": _StageState("upload", "上传到
|
|
317
|
+
"upload": _StageState("upload", "上传到 StarForge"),
|
|
318
318
|
"server": _StageState("server", "服务端受理"),
|
|
319
319
|
}
|
|
320
320
|
|
|
@@ -35,8 +35,8 @@ def collect_cli_device() -> dict[str, str]:
|
|
|
35
35
|
"user": (os.environ.get("USER") or os.environ.get("USERNAME") or "")[:64],
|
|
36
36
|
"terminal": (os.environ.get("TERM") or "")[:32],
|
|
37
37
|
"shell": shell,
|
|
38
|
-
"
|
|
39
|
-
"source": "
|
|
38
|
+
"cli_version": _cli_version()[:32],
|
|
39
|
+
"source": "forge-cli",
|
|
40
40
|
}
|
|
41
41
|
device_id = _device_id_hash(_stable_machine_id(), fallback=hostname)
|
|
42
42
|
if device_id:
|
|
@@ -49,7 +49,7 @@ def encode_device_param(info: dict[str, Any]) -> str:
|
|
|
49
49
|
return base64.urlsafe_b64encode(raw).decode().rstrip("=")
|
|
50
50
|
|
|
51
51
|
|
|
52
|
-
def
|
|
52
|
+
def _cli_version() -> str:
|
|
53
53
|
try:
|
|
54
54
|
from importlib.metadata import version
|
|
55
55
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""sf CLI 命令实现,按领域分模块;app 组装见 starforge_cli.cli。"""
|
|
@@ -104,7 +104,7 @@ def _print_maintenance(data: dict) -> None:
|
|
|
104
104
|
):
|
|
105
105
|
for item in data.get(key) or []:
|
|
106
106
|
typer.secho(
|
|
107
|
-
f" ⚠ [{label}] {item.get('
|
|
107
|
+
f" ⚠ [{label}] {item.get('run_id')} ({item.get('username')})"
|
|
108
108
|
+ (f" — {item['reason']}" if item.get("reason") else ""),
|
|
109
109
|
fg=color,
|
|
110
110
|
)
|
|
@@ -47,7 +47,7 @@ def status() -> None:
|
|
|
47
47
|
typer.echo(" (无)")
|
|
48
48
|
else:
|
|
49
49
|
for r in running:
|
|
50
|
-
jid = (r.get("job_ref") or r.get("
|
|
50
|
+
jid = (r.get("job_ref") or r.get("run_id") or "-")[:26]
|
|
51
51
|
typer.echo(f" {jid:<26} {r.get('status','-'):<10} GPU={r.get('gpus') or '-'} {r.get('exp','-')}")
|
|
52
52
|
|
|
53
53
|
cluster = api_client.cluster_status_via_server()
|
|
@@ -69,7 +69,7 @@ def _server_jobs_table(jobs: list[dict]) -> None:
|
|
|
69
69
|
return
|
|
70
70
|
typer.echo(f"{'TIME':<20} {'JOB ID':<26} {'状态':<10} {'GPU':>4} 实验")
|
|
71
71
|
for j in jobs:
|
|
72
|
-
jid = (j.get("job_ref") or j.get("
|
|
72
|
+
jid = (j.get("job_ref") or j.get("run_id") or "-")[:26]
|
|
73
73
|
typer.echo(
|
|
74
74
|
f"{str(j.get('submitted_at', '-'))[:19]:<20} {jid:<26} "
|
|
75
75
|
f"{str(j.get('status','-')):<10} {str(j.get('requested_gpus') or '-'):>4} "
|
|
@@ -113,7 +113,7 @@ def job_status(
|
|
|
113
113
|
) -> None:
|
|
114
114
|
gate()
|
|
115
115
|
match = [j for j in api_client.list_my_jobs(limit=200)
|
|
116
|
-
if job_id in (j.get("job_ref") or "", j.get("
|
|
116
|
+
if job_id in (j.get("job_ref") or "", j.get("run_id") or "")]
|
|
117
117
|
if not match:
|
|
118
118
|
cli_ui.fail(f"未找到作业 {job_id}")
|
|
119
119
|
_server_jobs_table(match)
|
|
@@ -12,13 +12,13 @@ from starforge_cli import auth, cli_ui
|
|
|
12
12
|
def login(
|
|
13
13
|
server: Optional[str] = typer.Option(
|
|
14
14
|
None, "--server", "-s",
|
|
15
|
-
help=f"
|
|
15
|
+
help=f"StarForge 服务地址(默认 {auth.DEFAULT_FORGE_SERVER})",
|
|
16
16
|
),
|
|
17
17
|
token: Optional[str] = typer.Option(None, "--token", help="非交互登录:直接用服务令牌(CI 用)"),
|
|
18
18
|
device_flow: bool = typer.Option(False, "--device-flow", help="强制使用设备码登录(SSH / 无浏览器)"),
|
|
19
19
|
no_browser: bool = typer.Option(False, "--no-browser", help="不打开浏览器(等同 --device-flow)"),
|
|
20
20
|
) -> None:
|
|
21
|
-
"""登录
|
|
21
|
+
"""登录 StarForge(本机默认浏览器;SSH 环境走验证码)。"""
|
|
22
22
|
srv = auth.current_server(server)
|
|
23
23
|
auth._save_server(srv)
|
|
24
24
|
if token:
|
|
@@ -37,7 +37,7 @@ def login(
|
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
def logout(
|
|
40
|
-
server: Optional[str] = typer.Option(None, "--server", "-s", help="指定
|
|
40
|
+
server: Optional[str] = typer.Option(None, "--server", "-s", help="指定 StarForge 地址(默认当前)"),
|
|
41
41
|
) -> None:
|
|
42
42
|
"""登出当前账号。"""
|
|
43
43
|
srv = auth.current_server(server)
|
|
@@ -90,6 +90,7 @@ def plugin_publish(
|
|
|
90
90
|
) -> None:
|
|
91
91
|
gate()
|
|
92
92
|
from starforge_core.plugins import (
|
|
93
|
+
PLUGIN_SCHEMA,
|
|
93
94
|
PluginError,
|
|
94
95
|
digest_files,
|
|
95
96
|
directory_digest,
|
|
@@ -106,7 +107,7 @@ def plugin_publish(
|
|
|
106
107
|
# 在上传前就报出来,不必等服务端往返。
|
|
107
108
|
validate_package_layout(src, manifest)
|
|
108
109
|
except PluginError as e:
|
|
109
|
-
cli_ui.fail(f"插件包非法:{e}", hint="检查 plugin.yaml(schema:
|
|
110
|
+
cli_ui.fail(f"插件包非法:{e}", hint=f"检查 plugin.yaml(schema: {PLUGIN_SCHEMA})")
|
|
110
111
|
digest = directory_digest(src)
|
|
111
112
|
|
|
112
113
|
buf = io.BytesIO()
|
|
@@ -40,7 +40,7 @@ def serve_start(
|
|
|
40
40
|
if ttl_hours:
|
|
41
41
|
body["ttl_s"] = ttl_hours * 3600
|
|
42
42
|
res = _call("POST", "/api/playground/start", body)
|
|
43
|
-
typer.secho(f"✓ 推理服务已启动 {res.get('
|
|
43
|
+
typer.secho(f"✓ 推理服务已启动 {res.get('run_id')}", fg=typer.colors.GREEN, bold=True)
|
|
44
44
|
typer.echo(f" 模型: {res.get('model')} 端口: {res.get('port')} 到期: {res.get('expires_at')}")
|
|
45
45
|
typer.echo(" 对话试用:web「Playground」页;一键停止:sf serve stop <run_id>")
|
|
46
46
|
|
|
@@ -56,7 +56,7 @@ def serve_ls() -> None:
|
|
|
56
56
|
for r in rows:
|
|
57
57
|
flag = "●" if r.get("active") else "○"
|
|
58
58
|
typer.echo(
|
|
59
|
-
f"{flag} {r.get('
|
|
59
|
+
f"{flag} {r.get('run_id')} {r.get('status'):<9} "
|
|
60
60
|
f"{r.get('model') or '-'} {r.get('gpus')}GPU 到期 {r.get('expires_at') or '-'}"
|
|
61
61
|
)
|
|
62
62
|
|
|
@@ -77,7 +77,7 @@ def _is_sensitive(rel: str) -> bool:
|
|
|
77
77
|
|
|
78
78
|
# 集群 Linux 侧会 source/读取;Windows 工作区可能是 CRLF,上传前须规范为 LF。
|
|
79
79
|
_UNIX_LF_SUFFIXES = (".sh", ".conf")
|
|
80
|
-
_UNIX_LF_BASENAMES = frozenset({"sf"
|
|
80
|
+
_UNIX_LF_BASENAMES = frozenset({"sf"})
|
|
81
81
|
|
|
82
82
|
|
|
83
83
|
def _needs_unix_lf(rel: str) -> bool:
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"""lab CLI 命令实现,按领域分模块;app 组装见 starforge_cli.cli。"""
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{starforge_cli-0.1.9 → starforge_cli-0.1.11}/starforge_cli/scaffold/custom-framework/train.sh
RENAMED
|
File without changes
|
{starforge_cli-0.1.9 → starforge_cli-0.1.11}/starforge_cli/scaffold/experiment-template/.gitkeep
RENAMED
|
File without changes
|
{starforge_cli-0.1.9 → starforge_cli-0.1.11}/starforge_cli/scaffold/experiment-template/README.md
RENAMED
|
File without changes
|
{starforge_cli-0.1.9 → starforge_cli-0.1.11}/starforge_cli/scaffold/experiment-template/config.yaml
RENAMED
|
File without changes
|
{starforge_cli-0.1.9 → starforge_cli-0.1.11}/starforge_cli/scaffold/project/common/README.md
RENAMED
|
File without changes
|
{starforge_cli-0.1.9 → starforge_cli-0.1.11}/starforge_cli/scaffold/project/common/__init__.py
RENAMED
|
File without changes
|
{starforge_cli-0.1.9 → starforge_cli-0.1.11}/starforge_cli/scaffold/project/configs/README.md
RENAMED
|
File without changes
|
{starforge_cli-0.1.9 → starforge_cli-0.1.11}/starforge_cli/scaffold/project/configs/base/README.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{starforge_cli-0.1.9 → starforge_cli-0.1.11}/starforge_cli/scaffold/project/configs/base/rm.yaml
RENAMED
|
File without changes
|
{starforge_cli-0.1.9 → starforge_cli-0.1.11}/starforge_cli/scaffold/project/configs/base/sft.yaml
RENAMED
|
File without changes
|
{starforge_cli-0.1.9 → starforge_cli-0.1.11}/starforge_cli/scaffold/project/configs/models/README.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|