synth-ai 0.2.7__py3-none-any.whl → 0.2.8.dev2__py3-none-any.whl
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.
Potentially problematic release.
This version of synth-ai might be problematic. Click here for more details.
- synth_ai/cli/demo.py +44 -39
- synth_ai/demos/core/cli.py +0 -9
- {synth_ai-0.2.7.dist-info → synth_ai-0.2.8.dev2.dist-info}/METADATA +6 -5
- {synth_ai-0.2.7.dist-info → synth_ai-0.2.8.dev2.dist-info}/RECORD +8 -8
- {synth_ai-0.2.7.dist-info → synth_ai-0.2.8.dev2.dist-info}/WHEEL +0 -0
- {synth_ai-0.2.7.dist-info → synth_ai-0.2.8.dev2.dist-info}/entry_points.txt +0 -0
- {synth_ai-0.2.7.dist-info → synth_ai-0.2.8.dev2.dist-info}/licenses/LICENSE +0 -0
- {synth_ai-0.2.7.dist-info → synth_ai-0.2.8.dev2.dist-info}/top_level.txt +0 -0
synth_ai/cli/demo.py
CHANGED
|
@@ -35,60 +35,65 @@ def _forward_to_new(args: list[str]) -> None:
|
|
|
35
35
|
|
|
36
36
|
def register(cli):
|
|
37
37
|
@cli.group("demo", invoke_without_command=True)
|
|
38
|
+
@click.option("--force", is_flag=True, help="Overwrite existing files in CWD when initializing demo")
|
|
38
39
|
@click.option("--list", "list_only", is_flag=True, help="List available legacy demos and exit")
|
|
39
40
|
@click.option("-f", "filter_term", default="", help="Filter legacy demos by substring")
|
|
40
41
|
@click.pass_context
|
|
41
|
-
def demo(ctx: click.Context, list_only: bool, filter_term: str):
|
|
42
|
+
def demo(ctx: click.Context, force: bool, list_only: bool, filter_term: str):
|
|
42
43
|
"""Demo helpers.
|
|
43
44
|
|
|
44
|
-
-
|
|
45
|
+
- Default (no subcommand): initialize RL demo files into ./synth_demo/ (alias of rl_demo init)
|
|
46
|
+
- Legacy mode: with --list, find and run examples/*/run_demo.sh
|
|
45
47
|
- New RL demo subcommands: deploy, configure, run
|
|
46
48
|
"""
|
|
47
49
|
if ctx.invoked_subcommand is not None:
|
|
48
50
|
return
|
|
49
|
-
# Legacy behavior: interactive examples runner
|
|
50
|
-
repo_root = Path(os.getcwd())
|
|
51
|
-
examples_dir = repo_root / "examples"
|
|
52
|
-
demos = _find_demo_scripts(examples_dir)
|
|
53
|
-
if filter_term:
|
|
54
|
-
demos = [p for p in demos if filter_term.lower() in str(p).lower()]
|
|
55
|
-
|
|
56
|
-
if not demos:
|
|
57
|
-
click.echo("No run_demo.sh scripts found under examples/.")
|
|
58
|
-
return
|
|
59
51
|
|
|
52
|
+
# If explicitly asked to list legacy demos, show interactive picker
|
|
60
53
|
if list_only:
|
|
54
|
+
repo_root = Path(os.getcwd())
|
|
55
|
+
examples_dir = repo_root / "examples"
|
|
56
|
+
demos = _find_demo_scripts(examples_dir)
|
|
57
|
+
if filter_term:
|
|
58
|
+
demos = [p for p in demos if filter_term.lower() in str(p).lower()]
|
|
59
|
+
|
|
60
|
+
if not demos:
|
|
61
|
+
click.echo("No run_demo.sh scripts found under examples/.")
|
|
62
|
+
return
|
|
63
|
+
|
|
61
64
|
click.echo("Available demos:")
|
|
62
|
-
for p in demos:
|
|
63
|
-
click.echo(f"
|
|
64
|
-
|
|
65
|
+
for idx, p in enumerate(demos, start=1):
|
|
66
|
+
click.echo(f" {idx}. {p.relative_to(repo_root)}")
|
|
67
|
+
click.echo("")
|
|
68
|
+
|
|
69
|
+
def _validate_choice(val: str) -> int:
|
|
70
|
+
try:
|
|
71
|
+
i = int(val)
|
|
72
|
+
except Exception as err:
|
|
73
|
+
raise click.BadParameter("Enter a number from the list") from err
|
|
74
|
+
if i < 1 or i > len(demos):
|
|
75
|
+
raise click.BadParameter(f"Choose a number between 1 and {len(demos)}")
|
|
76
|
+
return i
|
|
65
77
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
78
|
+
choice = click.prompt("Select a demo to run", value_proc=_validate_choice)
|
|
79
|
+
script = demos[choice - 1]
|
|
80
|
+
|
|
81
|
+
click.echo("")
|
|
82
|
+
click.echo(f"🚀 Running {script.relative_to(repo_root)}\n")
|
|
70
83
|
|
|
71
|
-
def _validate_choice(val: str) -> int:
|
|
72
84
|
try:
|
|
73
|
-
|
|
74
|
-
except
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
return
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
try:
|
|
87
|
-
subprocess.run(["bash", str(script)], check=True)
|
|
88
|
-
except subprocess.CalledProcessError as e:
|
|
89
|
-
click.echo(f"❌ Demo exited with non-zero status: {e.returncode}")
|
|
90
|
-
except KeyboardInterrupt:
|
|
91
|
-
click.echo("\n🛑 Demo interrupted by user")
|
|
85
|
+
subprocess.run(["bash", str(script)], check=True)
|
|
86
|
+
except subprocess.CalledProcessError as e:
|
|
87
|
+
click.echo(f"❌ Demo exited with non-zero status: {e.returncode}")
|
|
88
|
+
except KeyboardInterrupt:
|
|
89
|
+
click.echo("\n🛑 Demo interrupted by user")
|
|
90
|
+
return
|
|
91
|
+
|
|
92
|
+
# Default: forward to RL demo init behavior, optionally with --force
|
|
93
|
+
args: list[str] = ["rl_demo.init"]
|
|
94
|
+
if force:
|
|
95
|
+
args.append("--force")
|
|
96
|
+
_forward_to_new(args)
|
|
92
97
|
|
|
93
98
|
# (prepare command removed; configure now prepares baseline TOML)
|
|
94
99
|
|
synth_ai/demos/core/cli.py
CHANGED
|
@@ -66,15 +66,6 @@ def cmd_setup(_args: argparse.Namespace) -> int:
|
|
|
66
66
|
env = demo_core.load_env()
|
|
67
67
|
local_env = demo_core.load_dotenv_file(cwd_env_path)
|
|
68
68
|
|
|
69
|
-
def _is_modal_public_url(u: str) -> bool:
|
|
70
|
-
try:
|
|
71
|
-
s = (u or "").strip().lower()
|
|
72
|
-
if not (s.startswith("http://") or s.startswith("https://")):
|
|
73
|
-
return False
|
|
74
|
-
return (".modal.run" in s) and ("modal.local" not in s) and ("pypi-mirror" not in s)
|
|
75
|
-
except Exception:
|
|
76
|
-
return False
|
|
77
|
-
|
|
78
69
|
def _maybe_fix_task_url() -> None:
|
|
79
70
|
if not env.task_app_name:
|
|
80
71
|
return
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: synth-ai
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.8.dev2
|
|
4
4
|
Summary: RL as a service SDK - Core AI functionality and tracing
|
|
5
5
|
Author-email: Synth AI <josh@usesynth.ai>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -98,16 +98,17 @@ synth-ai comes with a built-in RL example tailored for training Qwen/Qwen3-0.6B
|
|
|
98
98
|
Please create an account at [Synth](https://usesynth.ai) and [Modal](https://modal.com) for the Math hello‑world test run. Then run:
|
|
99
99
|
|
|
100
100
|
```bash
|
|
101
|
-
uvx synth-ai
|
|
102
|
-
uvx synth-ai
|
|
101
|
+
uvx synth-ai demo
|
|
102
|
+
uvx synth-ai setup
|
|
103
|
+
uvx synth-ai deploy
|
|
103
104
|
uvx synth-ai run
|
|
104
105
|
```
|
|
105
106
|
|
|
106
107
|
To walk through kicking off your first RL run, see the [Synth‑AI Documentation](https://docs.usesynth.ai/synth-ai/introduction).
|
|
107
108
|
|
|
108
|
-
### What `
|
|
109
|
+
### What `setup` does now
|
|
109
110
|
|
|
110
|
-
When you run `uvx synth-ai rl_demo setup
|
|
111
|
+
When you run `uvx synth-ai setup` (or the legacy `uvx synth-ai rl_demo setup`), the SDK opens your browser to the Synth dashboard for a one‑time pairing (handshake) with your signed‑in session. The SDK will automatically:
|
|
111
112
|
|
|
112
113
|
- Detect your current user and organization
|
|
113
114
|
- Ensure both API keys exist for that user+org
|
|
@@ -7,7 +7,7 @@ synth_ai/install_sqld.sh,sha256=AMBhlfq661PxeTTc6D4K_Nei_qwMvA84ei4NhQzmUUk,928
|
|
|
7
7
|
synth_ai/cli/__init__.py,sha256=ThBK5FykxAqX8Mz0E4gj94_PX9EwMEtXcmm-A8krv7E,1559
|
|
8
8
|
synth_ai/cli/balance.py,sha256=z4h1MQSyFX60k-13L9IT0rtOCI16iKNGJeNjFMZuv_k,8010
|
|
9
9
|
synth_ai/cli/calc.py,sha256=RJyQJ41e02xn-V0vRRCAVkL59UHDqyz8XpYGsenfdm4,2085
|
|
10
|
-
synth_ai/cli/demo.py,sha256=
|
|
10
|
+
synth_ai/cli/demo.py,sha256=NeRiLv9ZQyX9tVxvZ6uV5YmucQ8fu5gyL5qZE0GfBZY,5496
|
|
11
11
|
synth_ai/cli/legacy_root_backup.py,sha256=KSMADyJ2g5OVpsq_CeBzqIeDC2Um-9GyINzsJH-75uw,15872
|
|
12
12
|
synth_ai/cli/man.py,sha256=JQDon73ZkuKP9xr1_vRh5fjV9_b5xiUb7zNjny7ArB8,3765
|
|
13
13
|
synth_ai/cli/recent.py,sha256=mHhM-QrR_MfjfKSzBvvPUEC-lkXTWUZrQwqYTmb2x0Y,4173
|
|
@@ -21,7 +21,7 @@ synth_ai/config/base_url.py,sha256=c85LaABBrvsl8Fp8KH0LNtJJrpnUwlzA5Ywbuth8fHE,3
|
|
|
21
21
|
synth_ai/core/experiment.py,sha256=hLkPtzUFA7iY3-QpeJ5K8YjvQeyfqnjab5P2CFaojys,236
|
|
22
22
|
synth_ai/core/system.py,sha256=s-Z7np2ISYmYc1r9YN-y2yb3cgRlOalrh0iaqnxeo84,206
|
|
23
23
|
synth_ai/demos/core/__init__.py,sha256=A2FjhY7KXGtyzdQXqeTPCkEhHfrH-eQg6bvP8HaYhZM,36
|
|
24
|
-
synth_ai/demos/core/cli.py,sha256=
|
|
24
|
+
synth_ai/demos/core/cli.py,sha256=LMw8ExI_1lUQrX0QFJzhegStwLkxqooTjD6r1Nr7fwY,55976
|
|
25
25
|
synth_ai/demos/demo_task_apps/__init__.py,sha256=8aUGEGpWUw11GRb3wQXRAmQ99yjAt5qd5FCTDJpXWjI,44
|
|
26
26
|
synth_ai/demos/demo_task_apps/core.py,sha256=ifKxxRKqC-y43MaqLHNuerXAlBHO8MI8ZBo2CzYcOoU,14563
|
|
27
27
|
synth_ai/demos/demo_task_apps/math/__init__.py,sha256=WBzpZwSn7pRarBmhopQi34i9bEm05-71eM3siboOavY,43
|
|
@@ -412,9 +412,9 @@ synth_ai/v0/tracing_v1/events/manage.py,sha256=ZDXXP-ZwLH9LCsmw7Ru9o55d7bl_diPtJ
|
|
|
412
412
|
synth_ai/v0/tracing_v1/events/scope.py,sha256=BuBkhSpVHUJt8iGT9HJZF82rbb88mQcd2vM2shg-w2I,2550
|
|
413
413
|
synth_ai/v0/tracing_v1/events/store.py,sha256=0342lvAcalyJbVEIzQFaPuMQGgwiFm7M5rE6gr-G0E8,9041
|
|
414
414
|
synth_ai/zyk/__init__.py,sha256=htVLnzTYQ5rxzYpzSYBm7_o6uNKZ3pB_PrqkBrgTRS4,771
|
|
415
|
-
synth_ai-0.2.
|
|
416
|
-
synth_ai-0.2.
|
|
417
|
-
synth_ai-0.2.
|
|
418
|
-
synth_ai-0.2.
|
|
419
|
-
synth_ai-0.2.
|
|
420
|
-
synth_ai-0.2.
|
|
415
|
+
synth_ai-0.2.8.dev2.dist-info/licenses/LICENSE,sha256=ynhjRQUfqA_RdGRATApfFA_fBAy9cno04sLtLUqxVFM,1069
|
|
416
|
+
synth_ai-0.2.8.dev2.dist-info/METADATA,sha256=hk_80ggzdFV-q4zBf-RjWDguRzwDmA94cnEGBPu33bg,5011
|
|
417
|
+
synth_ai-0.2.8.dev2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
418
|
+
synth_ai-0.2.8.dev2.dist-info/entry_points.txt,sha256=Neq-3bT7TAijjgOIR77pKL-WYg6TWBDeO8pp_nL4vGY,91
|
|
419
|
+
synth_ai-0.2.8.dev2.dist-info/top_level.txt,sha256=fBmtZyVHuKaGa29oHBaaUkrUIWTqSpoVMPiVdCDP3k8,9
|
|
420
|
+
synth_ai-0.2.8.dev2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|