synth-ai 0.2.6__py3-none-any.whl → 0.2.6.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/__init__.py +18 -25
- synth_ai/cli/rl_demo.py +52 -4
- synth_ai/demos/core/cli.py +443 -40
- synth_ai/demos/demo_task_apps/math/_common.py +17 -0
- synth_ai/demos/demo_task_apps/math/modal_task_app.py +415 -0
- synth_ai/environments/examples/crafter_classic/agent_demos/crafter_modal_ft/filter_traces_sft_turso.py +23 -9
- synth_ai/environments/service/app.py +13 -6
- synth_ai/experimental/synth_oss.py +2 -2
- synth_ai/http.py +26 -102
- synth_ai/http_client.py +104 -0
- synth_ai/lm/core/synth_models.py +2 -2
- synth_ai/tracing_v3/decorators.py +1 -0
- synth_ai/tracing_v3/hooks.py +1 -0
- synth_ai/tracing_v3/session_tracer.py +18 -7
- synth_ai/tracing_v3/turso/manager.py +3 -1
- synth_ai/tracing_v3/turso/models.py +3 -0
- synth_ai/tracing_v3/utils.py +1 -0
- {synth_ai-0.2.6.dist-info → synth_ai-0.2.6.dev2.dist-info}/METADATA +1 -1
- {synth_ai-0.2.6.dist-info → synth_ai-0.2.6.dev2.dist-info}/RECORD +23 -20
- {synth_ai-0.2.6.dist-info → synth_ai-0.2.6.dev2.dist-info}/WHEEL +0 -0
- {synth_ai-0.2.6.dist-info → synth_ai-0.2.6.dev2.dist-info}/entry_points.txt +0 -0
- {synth_ai-0.2.6.dist-info → synth_ai-0.2.6.dev2.dist-info}/licenses/LICENSE +0 -0
- {synth_ai-0.2.6.dist-info → synth_ai-0.2.6.dev2.dist-info}/top_level.txt +0 -0
synth_ai/__init__.py
CHANGED
|
@@ -5,39 +5,32 @@ Synth AI - Software for aiding the best and multiplying the will.
|
|
|
5
5
|
# Environment exports - moved from synth-env
|
|
6
6
|
from synth_ai.environments import * # noqa
|
|
7
7
|
import synth_ai.environments as environments # expose module name for __all__
|
|
8
|
-
|
|
9
|
-
from synth_ai.lm.
|
|
8
|
+
try:
|
|
9
|
+
from synth_ai.lm.core.main import LM # Moved from zyk to lm for better organization
|
|
10
|
+
except Exception: # allow minimal imports (e.g., tracing) without LM stack
|
|
11
|
+
LM = None # type: ignore
|
|
12
|
+
try:
|
|
13
|
+
from synth_ai.lm.provider_support.anthropic import Anthropic, AsyncAnthropic
|
|
14
|
+
except Exception: # optional in minimal environments
|
|
15
|
+
Anthropic = AsyncAnthropic = None # type: ignore
|
|
10
16
|
|
|
11
17
|
# Provider support exports - moved from synth-sdk to synth_ai/lm
|
|
12
|
-
|
|
18
|
+
try:
|
|
19
|
+
from synth_ai.lm.provider_support.openai import AsyncOpenAI, OpenAI
|
|
20
|
+
except Exception:
|
|
21
|
+
AsyncOpenAI = OpenAI = None # type: ignore
|
|
13
22
|
|
|
14
|
-
#
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
EventPartitionElement,
|
|
19
|
-
RewardSignal,
|
|
20
|
-
SystemTrace,
|
|
21
|
-
TrainingQuestion,
|
|
22
|
-
)
|
|
23
|
-
from synth_ai.tracing_v1.decorators import trace_event_async, trace_event_sync
|
|
24
|
-
from synth_ai.tracing_v1.upload import upload
|
|
23
|
+
# Legacy tracing v1 is not required for v3 usage and can be unavailable in minimal envs.
|
|
24
|
+
tracing = None # type: ignore
|
|
25
|
+
EventPartitionElement = RewardSignal = SystemTrace = TrainingQuestion = None # type: ignore
|
|
26
|
+
trace_event_async = trace_event_sync = upload = None # type: ignore
|
|
25
27
|
|
|
26
|
-
__version__ = "0.2.6"
|
|
28
|
+
__version__ = "0.2.6.dev1"
|
|
27
29
|
__all__ = [
|
|
28
30
|
"LM",
|
|
29
|
-
"tracing",
|
|
30
31
|
"OpenAI",
|
|
31
32
|
"AsyncOpenAI",
|
|
32
33
|
"Anthropic",
|
|
33
34
|
"AsyncAnthropic",
|
|
34
35
|
"environments",
|
|
35
|
-
|
|
36
|
-
"EventPartitionElement",
|
|
37
|
-
"RewardSignal",
|
|
38
|
-
"SystemTrace",
|
|
39
|
-
"TrainingQuestion",
|
|
40
|
-
"trace_event_async",
|
|
41
|
-
"trace_event_sync",
|
|
42
|
-
"upload",
|
|
43
|
-
] # Explicitly define public API
|
|
36
|
+
] # Explicitly define public API (v1 tracing omitted in minimal env)
|
synth_ai/cli/rl_demo.py
CHANGED
|
@@ -34,13 +34,17 @@ def register(cli):
|
|
|
34
34
|
def rl_demo():
|
|
35
35
|
"""RL Demo commands (separate from legacy demo)."""
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
# Help pyright understand dynamic Click group attributes
|
|
38
|
+
from typing import Any, cast as _cast
|
|
39
|
+
_rlg = _cast(Any, rl_demo)
|
|
40
|
+
|
|
41
|
+
@_rlg.command("check")
|
|
38
42
|
def rl_check():
|
|
39
43
|
_forward(["rl_demo.check"]) # reuse same implementation
|
|
40
44
|
|
|
41
45
|
# (prepare command removed; consolidated into configure)
|
|
42
46
|
|
|
43
|
-
@
|
|
47
|
+
@_rlg.command("deploy")
|
|
44
48
|
@click.option("--local", is_flag=True, help="Run local FastAPI instead of Modal deploy")
|
|
45
49
|
@click.option("--app", type=click.Path(), default=None, help="Path to Modal app.py for uv run modal deploy")
|
|
46
50
|
@click.option("--name", type=str, default="synth-math-demo", help="Modal app name")
|
|
@@ -57,11 +61,19 @@ def register(cli):
|
|
|
57
61
|
args.extend(["--script", script])
|
|
58
62
|
_forward(args)
|
|
59
63
|
|
|
60
|
-
@
|
|
64
|
+
@_rlg.command("configure")
|
|
61
65
|
def rl_configure():
|
|
62
66
|
_forward(["rl_demo.configure"])
|
|
63
67
|
|
|
64
|
-
@
|
|
68
|
+
@_rlg.command("init")
|
|
69
|
+
@click.option("--force", is_flag=True, help="Overwrite existing files in CWD")
|
|
70
|
+
def rl_init(force: bool):
|
|
71
|
+
args = ["rl_demo.init"]
|
|
72
|
+
if force:
|
|
73
|
+
args.append("--force")
|
|
74
|
+
_forward(args)
|
|
75
|
+
|
|
76
|
+
@_rlg.command("run")
|
|
65
77
|
@click.option("--config", type=click.Path(), default=None, help="Path to TOML config (skip prompt)")
|
|
66
78
|
@click.option("--batch-size", type=int, default=None)
|
|
67
79
|
@click.option("--group-size", type=int, default=None)
|
|
@@ -84,6 +96,20 @@ def register(cli):
|
|
|
84
96
|
args.append("--dry-run")
|
|
85
97
|
_forward(args)
|
|
86
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
|
+
|
|
87
113
|
# Dotted aliases (top-level) for convenience: rl_demo.check etc.
|
|
88
114
|
@cli.command("rl_demo.check")
|
|
89
115
|
def rl_check_alias():
|
|
@@ -112,6 +138,14 @@ def register(cli):
|
|
|
112
138
|
def rl_configure_alias():
|
|
113
139
|
_forward(["rl_demo.configure"])
|
|
114
140
|
|
|
141
|
+
@cli.command("rl_demo.init")
|
|
142
|
+
@click.option("--force", is_flag=True, help="Overwrite existing files in CWD")
|
|
143
|
+
def rl_init_alias(force: bool):
|
|
144
|
+
args = ["rl_demo.init"]
|
|
145
|
+
if force:
|
|
146
|
+
args.append("--force")
|
|
147
|
+
_forward(args)
|
|
148
|
+
|
|
115
149
|
@cli.command("rl_demo.run")
|
|
116
150
|
@click.option("--config", type=click.Path(), default=None, help="Path to TOML config (skip prompt)")
|
|
117
151
|
@click.option("--batch-size", type=int, default=None)
|
|
@@ -135,3 +169,17 @@ def register(cli):
|
|
|
135
169
|
args.append("--dry-run")
|
|
136
170
|
_forward(args)
|
|
137
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
|
+
|