synth-ai 0.2.6.dev2__py3-none-any.whl → 0.2.6.dev4__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/__init__.py +1 -1
- synth_ai/cli/rl_demo.py +0 -29
- synth_ai/demos/core/cli.py +0 -98
- {synth_ai-0.2.6.dev2.dist-info → synth_ai-0.2.6.dev4.dist-info}/METADATA +1 -1
- {synth_ai-0.2.6.dev2.dist-info → synth_ai-0.2.6.dev4.dist-info}/RECORD +9 -9
- {synth_ai-0.2.6.dev2.dist-info → synth_ai-0.2.6.dev4.dist-info}/WHEEL +0 -0
- {synth_ai-0.2.6.dev2.dist-info → synth_ai-0.2.6.dev4.dist-info}/entry_points.txt +0 -0
- {synth_ai-0.2.6.dev2.dist-info → synth_ai-0.2.6.dev4.dist-info}/licenses/LICENSE +0 -0
- {synth_ai-0.2.6.dev2.dist-info → synth_ai-0.2.6.dev4.dist-info}/top_level.txt +0 -0
synth_ai/__init__.py
CHANGED
|
@@ -25,7 +25,7 @@ tracing = None # type: ignore
|
|
|
25
25
|
EventPartitionElement = RewardSignal = SystemTrace = TrainingQuestion = None # type: ignore
|
|
26
26
|
trace_event_async = trace_event_sync = upload = None # type: ignore
|
|
27
27
|
|
|
28
|
-
__version__ = "0.2.6.
|
|
28
|
+
__version__ = "0.2.6.dev4"
|
|
29
29
|
__all__ = [
|
|
30
30
|
"LM",
|
|
31
31
|
"OpenAI",
|
synth_ai/cli/rl_demo.py
CHANGED
|
@@ -96,20 +96,6 @@ def register(cli):
|
|
|
96
96
|
args.append("--dry-run")
|
|
97
97
|
_forward(args)
|
|
98
98
|
|
|
99
|
-
@_rlg.command("eval")
|
|
100
|
-
@click.option("--config", type=click.Path(), default=None, help="Path to TOML config (optional)")
|
|
101
|
-
@click.option("--model", type=str, default=None, help="Model to evaluate (default Qwen/Qwen3-0.6B)")
|
|
102
|
-
@click.option("--timeout", type=int, default=300, help="Seconds to wait for metrics")
|
|
103
|
-
def rl_eval(config: str | None, model: str | None, timeout: int):
|
|
104
|
-
args = ["rl_demo.eval"]
|
|
105
|
-
if config:
|
|
106
|
-
args.extend(["--config", config])
|
|
107
|
-
if model:
|
|
108
|
-
args.extend(["--model", model])
|
|
109
|
-
if timeout is not None:
|
|
110
|
-
args.extend(["--timeout", str(timeout)])
|
|
111
|
-
_forward(args)
|
|
112
|
-
|
|
113
99
|
# Dotted aliases (top-level) for convenience: rl_demo.check etc.
|
|
114
100
|
@cli.command("rl_demo.check")
|
|
115
101
|
def rl_check_alias():
|
|
@@ -168,18 +154,3 @@ def register(cli):
|
|
|
168
154
|
if dry_run:
|
|
169
155
|
args.append("--dry-run")
|
|
170
156
|
_forward(args)
|
|
171
|
-
|
|
172
|
-
@cli.command("rl_demo.eval")
|
|
173
|
-
@click.option("--config", type=click.Path(), default=None, help="Path to TOML config (optional)")
|
|
174
|
-
@click.option("--model", type=str, default=None, help="Model to evaluate (default Qwen/Qwen3-0.6B)")
|
|
175
|
-
@click.option("--timeout", type=int, default=300, help="Seconds to wait for metrics")
|
|
176
|
-
def rl_eval_alias(config: str | None, model: str | None, timeout: int):
|
|
177
|
-
args = ["rl_demo.eval"]
|
|
178
|
-
if config:
|
|
179
|
-
args.extend(["--config", config])
|
|
180
|
-
if model:
|
|
181
|
-
args.extend(["--model", model])
|
|
182
|
-
if timeout is not None:
|
|
183
|
-
args.extend(["--timeout", str(timeout)])
|
|
184
|
-
_forward(args)
|
|
185
|
-
|
synth_ai/demos/core/cli.py
CHANGED
|
@@ -938,96 +938,6 @@ def cmd_run(args: argparse.Namespace) -> int:
|
|
|
938
938
|
return 0
|
|
939
939
|
|
|
940
940
|
|
|
941
|
-
def cmd_eval(args: argparse.Namespace) -> int:
|
|
942
|
-
env = demo_core.load_env()
|
|
943
|
-
# Ensure required env
|
|
944
|
-
if not env.task_app_base_url:
|
|
945
|
-
print("Task app URL missing. Run: uvx synth-ai rl_demo deploy")
|
|
946
|
-
return 1
|
|
947
|
-
# Load config: prefer CWD demo_config.toml; else packaged default
|
|
948
|
-
cfg_path: str | None = None
|
|
949
|
-
if getattr(args, "config", None):
|
|
950
|
-
p = os.path.abspath(args.config)
|
|
951
|
-
if not os.path.isfile(p):
|
|
952
|
-
print(f"Config not found: {p}")
|
|
953
|
-
return 1
|
|
954
|
-
cfg_path = p
|
|
955
|
-
else:
|
|
956
|
-
cwd_prepared = os.path.abspath(os.path.join(os.getcwd(), "demo_config.toml"))
|
|
957
|
-
if os.path.isfile(cwd_prepared):
|
|
958
|
-
cfg_path = cwd_prepared
|
|
959
|
-
else:
|
|
960
|
-
packaged = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "demo_task_apps", "math", "config.toml"))
|
|
961
|
-
cfg_path = packaged if os.path.isfile(packaged) else None
|
|
962
|
-
if not cfg_path:
|
|
963
|
-
print("No config TOML found.")
|
|
964
|
-
return 1
|
|
965
|
-
|
|
966
|
-
import tomllib
|
|
967
|
-
with open(cfg_path, "rb") as fh:
|
|
968
|
-
inline_cfg = tomllib.load(fh)
|
|
969
|
-
|
|
970
|
-
# Model selection prompt
|
|
971
|
-
default_model = (args.model or (inline_cfg.get("model", {}) or {}).get("name") or "Qwen/Qwen3-0.6B")
|
|
972
|
-
entered = input(f"Model to evaluate [{default_model}]: ").strip()
|
|
973
|
-
model = entered or default_model
|
|
974
|
-
confirm = (input(f"Use model '{model}'? [Y/n]: ").strip().lower() or "y").startswith("y")
|
|
975
|
-
if not confirm:
|
|
976
|
-
print("Aborted by user.")
|
|
977
|
-
return 1
|
|
978
|
-
|
|
979
|
-
# Build on-board rollout request to the Task App (no backend RL job)
|
|
980
|
-
# Use Synth backend chat-completions proxy as inference URL (derive from DEV_BACKEND_URL)
|
|
981
|
-
# Ensure /api suffix for backend, then use proxy prefix for chat completions
|
|
982
|
-
backend_api = (env.dev_backend_url or "https://agent-learning.onrender.com/api").rstrip("/")
|
|
983
|
-
if not backend_api.endswith("/api"):
|
|
984
|
-
backend_api = f"{backend_api}/api"
|
|
985
|
-
inference_url = f"{backend_api}/proxy"
|
|
986
|
-
# ops: alternate agent/env for a small number of decisions (from config max_steps_per_episode if present)
|
|
987
|
-
try:
|
|
988
|
-
steps = int((inline_cfg.get("rollout", {}) or {}).get("max_steps_per_episode", 4))
|
|
989
|
-
except Exception:
|
|
990
|
-
steps = 4
|
|
991
|
-
ops: list[str] = []
|
|
992
|
-
for _ in range(max(1, steps // 2)):
|
|
993
|
-
ops.extend(["agent", "env"])
|
|
994
|
-
env_name = (inline_cfg.get("rollout", {}) or {}).get("env_name") or "math"
|
|
995
|
-
policy_name = (inline_cfg.get("rollout", {}) or {}).get("policy_name") or "math-react"
|
|
996
|
-
run_id = f"eval-{int(time.time())}"
|
|
997
|
-
body: Dict[str, Any] = {
|
|
998
|
-
"run_id": run_id,
|
|
999
|
-
"env": {
|
|
1000
|
-
"env_name": env_name,
|
|
1001
|
-
"config": inline_cfg.get("rollout", {}) or {},
|
|
1002
|
-
},
|
|
1003
|
-
"policy": {
|
|
1004
|
-
"policy_name": policy_name,
|
|
1005
|
-
"config": {"model": model, "inference_url": inference_url},
|
|
1006
|
-
},
|
|
1007
|
-
"ops": ops,
|
|
1008
|
-
"on_done": "terminate",
|
|
1009
|
-
}
|
|
1010
|
-
# POST to task app rollout endpoint
|
|
1011
|
-
headers = {"Content-Type": "application/json"}
|
|
1012
|
-
if env.env_api_key:
|
|
1013
|
-
headers["X-API-Key"] = env.env_api_key
|
|
1014
|
-
rc, resp = _http("POST", env.task_app_base_url.rstrip("/") + "/rollout", headers=headers, body=body)
|
|
1015
|
-
if rc not in (200, 201) or not isinstance(resp, dict):
|
|
1016
|
-
print("Eval rollout failed:", rc)
|
|
1017
|
-
try:
|
|
1018
|
-
print(json.dumps(resp, indent=2) if isinstance(resp, dict) else str(resp))
|
|
1019
|
-
except Exception:
|
|
1020
|
-
print(str(resp))
|
|
1021
|
-
print("Request body was:\n" + json.dumps(body, indent=2))
|
|
1022
|
-
return 2
|
|
1023
|
-
metrics = (resp.get("metrics") if isinstance(resp, dict) else None) or {}
|
|
1024
|
-
mean = metrics.get("mean_return")
|
|
1025
|
-
if mean is not None:
|
|
1026
|
-
print(f"eval.reward_mean={mean}")
|
|
1027
|
-
else:
|
|
1028
|
-
print(json.dumps(resp, indent=2))
|
|
1029
|
-
return 0
|
|
1030
|
-
|
|
1031
941
|
def main(argv: list[str] | None = None) -> int:
|
|
1032
942
|
p = argparse.ArgumentParser(prog="synth-ai")
|
|
1033
943
|
sub = p.add_subparsers(dest="cmd")
|
|
@@ -1069,14 +979,6 @@ def main(argv: list[str] | None = None) -> int:
|
|
|
1069
979
|
|
|
1070
980
|
_add_parser(["rl_demo.run", "demo.run"], configure=_run_opts)
|
|
1071
981
|
|
|
1072
|
-
def _eval_opts(parser):
|
|
1073
|
-
parser.add_argument("--config", type=str, default=None, help="Path to TOML config (optional)")
|
|
1074
|
-
parser.add_argument("--model", type=str, default=None, help="Model to evaluate (default Qwen/Qwen3-0.6B)")
|
|
1075
|
-
parser.add_argument("--timeout", type=int, default=300, help="Seconds to wait for metrics")
|
|
1076
|
-
parser.set_defaults(func=cmd_eval)
|
|
1077
|
-
|
|
1078
|
-
_add_parser(["rl_demo.eval", "demo.eval"], configure=_eval_opts)
|
|
1079
|
-
|
|
1080
982
|
args = p.parse_args(argv)
|
|
1081
983
|
if not hasattr(args, "func"):
|
|
1082
984
|
p.print_help()
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
synth_ai/__init__.py,sha256=
|
|
1
|
+
synth_ai/__init__.py,sha256=NixuXddy4lS2Wmj0F8eMt0HS_oYCTnq3iVVq5VYwWIc,1341
|
|
2
2
|
synth_ai/__main__.py,sha256=Kh1xBKkTE5Vs2qNMtDuuOXerHUptMcOiF3YziOpC6DA,146
|
|
3
3
|
synth_ai/http.py,sha256=lqjFXDmAP_xgfywK_rDSOVxuMy4rDH9S3Rtu9k1tLmk,1028
|
|
4
4
|
synth_ai/http_client.py,sha256=_9J8rUGoItUMnJLGZw7r0uXiJeLWR939kByRkvtP1XM,4429
|
|
@@ -10,7 +10,7 @@ synth_ai/cli/demo.py,sha256=GNVBxVtscxfAITFObyTOK8XPP2WGb-pv9LL4CiV_g6Q,4843
|
|
|
10
10
|
synth_ai/cli/legacy_root_backup.py,sha256=KSMADyJ2g5OVpsq_CeBzqIeDC2Um-9GyINzsJH-75uw,15872
|
|
11
11
|
synth_ai/cli/man.py,sha256=JQDon73ZkuKP9xr1_vRh5fjV9_b5xiUb7zNjny7ArB8,3765
|
|
12
12
|
synth_ai/cli/recent.py,sha256=mHhM-QrR_MfjfKSzBvvPUEC-lkXTWUZrQwqYTmb2x0Y,4173
|
|
13
|
-
synth_ai/cli/rl_demo.py,sha256=
|
|
13
|
+
synth_ai/cli/rl_demo.py,sha256=thFzIlOIXqJ_kFwaek0JMjaCH_Jq5Lpp2nOZ3A3t-3k,5980
|
|
14
14
|
synth_ai/cli/root.py,sha256=YAr7H2WYfnRt6_yxLix9O01-UnSy7OtYBVyNy4l5xIo,9614
|
|
15
15
|
synth_ai/cli/status.py,sha256=M_bt7U58Ubi-q-ZlrIpgCASKq9_k6uMjpx926f6kLLA,4591
|
|
16
16
|
synth_ai/cli/traces.py,sha256=_QBdCR92u0Gv51U4DH0Ws1d5yCrbJRpaYKe7pmcHrHs,6484
|
|
@@ -20,7 +20,7 @@ synth_ai/config/base_url.py,sha256=Bk7Bd9jKJP-LF0SW--WE01JhMfvOB6NUkFMRgPMnJuQ,3
|
|
|
20
20
|
synth_ai/core/experiment.py,sha256=hLkPtzUFA7iY3-QpeJ5K8YjvQeyfqnjab5P2CFaojys,236
|
|
21
21
|
synth_ai/core/system.py,sha256=s-Z7np2ISYmYc1r9YN-y2yb3cgRlOalrh0iaqnxeo84,206
|
|
22
22
|
synth_ai/demos/core/__init__.py,sha256=A2FjhY7KXGtyzdQXqeTPCkEhHfrH-eQg6bvP8HaYhZM,36
|
|
23
|
-
synth_ai/demos/core/cli.py,sha256=
|
|
23
|
+
synth_ai/demos/core/cli.py,sha256=MXiKIKH0gk2yW90TCjRA9F_4-scX5ft_2acytRMKCLs,41835
|
|
24
24
|
synth_ai/demos/demo_task_apps/__init__.py,sha256=8aUGEGpWUw11GRb3wQXRAmQ99yjAt5qd5FCTDJpXWjI,44
|
|
25
25
|
synth_ai/demos/demo_task_apps/core.py,sha256=3-C2dGdaqVqrVjnsxU2n6kGcuaprwuszBcTHePBypwo,13580
|
|
26
26
|
synth_ai/demos/demo_task_apps/math/__init__.py,sha256=WBzpZwSn7pRarBmhopQi34i9bEm05-71eM3siboOavY,43
|
|
@@ -411,9 +411,9 @@ synth_ai/v0/tracing_v1/events/manage.py,sha256=ZDXXP-ZwLH9LCsmw7Ru9o55d7bl_diPtJ
|
|
|
411
411
|
synth_ai/v0/tracing_v1/events/scope.py,sha256=BuBkhSpVHUJt8iGT9HJZF82rbb88mQcd2vM2shg-w2I,2550
|
|
412
412
|
synth_ai/v0/tracing_v1/events/store.py,sha256=0342lvAcalyJbVEIzQFaPuMQGgwiFm7M5rE6gr-G0E8,9041
|
|
413
413
|
synth_ai/zyk/__init__.py,sha256=htVLnzTYQ5rxzYpzSYBm7_o6uNKZ3pB_PrqkBrgTRS4,771
|
|
414
|
-
synth_ai-0.2.6.
|
|
415
|
-
synth_ai-0.2.6.
|
|
416
|
-
synth_ai-0.2.6.
|
|
417
|
-
synth_ai-0.2.6.
|
|
418
|
-
synth_ai-0.2.6.
|
|
419
|
-
synth_ai-0.2.6.
|
|
414
|
+
synth_ai-0.2.6.dev4.dist-info/licenses/LICENSE,sha256=ynhjRQUfqA_RdGRATApfFA_fBAy9cno04sLtLUqxVFM,1069
|
|
415
|
+
synth_ai-0.2.6.dev4.dist-info/METADATA,sha256=PJ9UXPH-7dMKJ58dA5GVkFxDqFzoIxoAJqG-NNEBx28,3980
|
|
416
|
+
synth_ai-0.2.6.dev4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
417
|
+
synth_ai-0.2.6.dev4.dist-info/entry_points.txt,sha256=Neq-3bT7TAijjgOIR77pKL-WYg6TWBDeO8pp_nL4vGY,91
|
|
418
|
+
synth_ai-0.2.6.dev4.dist-info/top_level.txt,sha256=fBmtZyVHuKaGa29oHBaaUkrUIWTqSpoVMPiVdCDP3k8,9
|
|
419
|
+
synth_ai-0.2.6.dev4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|