synth-ai 0.2.8.dev11__py3-none-any.whl → 0.2.8.dev13__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.

Files changed (37) hide show
  1. synth_ai/api/train/__init__.py +5 -0
  2. synth_ai/api/train/builders.py +165 -0
  3. synth_ai/api/train/cli.py +429 -0
  4. synth_ai/api/train/config_finder.py +120 -0
  5. synth_ai/api/train/env_resolver.py +302 -0
  6. synth_ai/api/train/pollers.py +66 -0
  7. synth_ai/api/train/task_app.py +128 -0
  8. synth_ai/api/train/utils.py +232 -0
  9. synth_ai/cli/__init__.py +23 -0
  10. synth_ai/cli/rl_demo.py +2 -2
  11. synth_ai/cli/root.py +2 -1
  12. synth_ai/cli/task_apps.py +520 -0
  13. synth_ai/demos/demo_task_apps/math/modal_task_app.py +31 -25
  14. synth_ai/task/__init__.py +94 -1
  15. synth_ai/task/apps/__init__.py +88 -0
  16. synth_ai/task/apps/grpo_crafter.py +438 -0
  17. synth_ai/task/apps/math_single_step.py +852 -0
  18. synth_ai/task/auth.py +132 -0
  19. synth_ai/task/client.py +148 -0
  20. synth_ai/task/contracts.py +29 -14
  21. synth_ai/task/datasets.py +105 -0
  22. synth_ai/task/errors.py +49 -0
  23. synth_ai/task/json.py +77 -0
  24. synth_ai/task/proxy.py +258 -0
  25. synth_ai/task/rubrics.py +212 -0
  26. synth_ai/task/server.py +398 -0
  27. synth_ai/task/tracing_utils.py +79 -0
  28. synth_ai/task/vendors.py +61 -0
  29. synth_ai/tracing_v3/session_tracer.py +13 -5
  30. synth_ai/tracing_v3/storage/base.py +10 -12
  31. synth_ai/tracing_v3/turso/manager.py +20 -6
  32. {synth_ai-0.2.8.dev11.dist-info → synth_ai-0.2.8.dev13.dist-info}/METADATA +3 -2
  33. {synth_ai-0.2.8.dev11.dist-info → synth_ai-0.2.8.dev13.dist-info}/RECORD +37 -15
  34. {synth_ai-0.2.8.dev11.dist-info → synth_ai-0.2.8.dev13.dist-info}/WHEEL +0 -0
  35. {synth_ai-0.2.8.dev11.dist-info → synth_ai-0.2.8.dev13.dist-info}/entry_points.txt +0 -0
  36. {synth_ai-0.2.8.dev11.dist-info → synth_ai-0.2.8.dev13.dist-info}/licenses/LICENSE +0 -0
  37. {synth_ai-0.2.8.dev11.dist-info → synth_ai-0.2.8.dev13.dist-info}/top_level.txt +0 -0
@@ -27,7 +27,11 @@ from contextlib import asynccontextmanager
27
27
  from datetime import datetime
28
28
  from typing import Any
29
29
 
30
- import pandas as pd
30
+ # Optional pandas import: fall back to records (list[dict]) if unavailable
31
+ try: # pragma: no cover - exercised in environments without pandas
32
+ import pandas as pd # type: ignore
33
+ except Exception: # pragma: no cover
34
+ pd = None # type: ignore[assignment]
31
35
  from sqlalchemy import select, text, update
32
36
  from sqlalchemy.exc import IntegrityError
33
37
  from sqlalchemy.ext.asyncio import AsyncEngine, AsyncSession, create_async_engine
@@ -406,20 +410,30 @@ class AsyncSQLTraceManager:
406
410
 
407
411
  async def query_traces(
408
412
  self, query: str, params: dict[str, Any] | None = None
409
- ) -> pd.DataFrame:
410
- """Execute a query and return results as DataFrame."""
413
+ ) -> Any:
414
+ """Execute a query and return results.
415
+
416
+ Returns a pandas DataFrame when pandas is available; otherwise a
417
+ list of dict records. Callers should handle both.
418
+ """
411
419
  async with self.session() as sess:
412
420
  result = await sess.execute(text(query), params or {})
413
421
  rows = result.mappings().all()
414
- return pd.DataFrame(rows)
422
+ if pd is not None:
423
+ return pd.DataFrame(rows)
424
+ return [dict(r) for r in rows]
415
425
 
416
426
  async def get_model_usage(
417
427
  self,
418
428
  start_date: datetime | None = None,
419
429
  end_date: datetime | None = None,
420
430
  model_name: str | None = None,
421
- ) -> pd.DataFrame:
422
- """Get model usage statistics."""
431
+ ) -> Any:
432
+ """Get model usage statistics.
433
+
434
+ Returns a pandas DataFrame when pandas is available; otherwise a list
435
+ of dict records.
436
+ """
423
437
  query = """
424
438
  SELECT * FROM model_usage_stats
425
439
  WHERE 1=1
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: synth-ai
3
- Version: 0.2.8.dev11
3
+ Version: 0.2.8.dev13
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
@@ -35,7 +35,6 @@ Requires-Dist: numpy>=2.2.3
35
35
  Requires-Dist: networkx>=3.4.2
36
36
  Requires-Dist: redis>=6.2.0
37
37
  Requires-Dist: duckdb>=1.0.0
38
- Requires-Dist: pandas>=2.2.3
39
38
  Requires-Dist: ty>=0.0.1a5
40
39
  Requires-Dist: toml>=0.10.2
41
40
  Requires-Dist: sqlalchemy>=2.0.42
@@ -70,6 +69,8 @@ Requires-Dist: datasets>=4.0.0; extra == "research"
70
69
  Provides-Extra: all
71
70
  Requires-Dist: crafter>=1.8.3; extra == "all"
72
71
  Requires-Dist: datasets>=4.0.0; extra == "all"
72
+ Provides-Extra: analytics
73
+ Requires-Dist: pandas>=2.2.3; extra == "analytics"
73
74
  Dynamic: license-file
74
75
 
75
76
  # Synth-AI
@@ -4,16 +4,25 @@ synth_ai/handshake.py,sha256=uzoTOpkf9JQgsyKWrlx8gjfQmK3HpqFQAZY1gZDtiIo,3735
4
4
  synth_ai/http.py,sha256=lqjFXDmAP_xgfywK_rDSOVxuMy4rDH9S3Rtu9k1tLmk,1028
5
5
  synth_ai/http_client.py,sha256=_9J8rUGoItUMnJLGZw7r0uXiJeLWR939kByRkvtP1XM,4429
6
6
  synth_ai/install_sqld.sh,sha256=AMBhlfq661PxeTTc6D4K_Nei_qwMvA84ei4NhQzmUUk,928
7
- synth_ai/cli/__init__.py,sha256=ThBK5FykxAqX8Mz0E4gj94_PX9EwMEtXcmm-A8krv7E,1559
7
+ synth_ai/api/train/__init__.py,sha256=aBwlmrj1HWVwDcvUrX4TqpS0BgvkE7Pv7npoIZmtTFU,118
8
+ synth_ai/api/train/builders.py,sha256=Fe684cGh-CQGPXydESCOjTkQpxbTJb47rVYKT8uONTs,6045
9
+ synth_ai/api/train/cli.py,sha256=4oDnsmuUutDyfesVOt8Uv6nkRksxo4oS9lWcrk5_aMc,17055
10
+ synth_ai/api/train/config_finder.py,sha256=GUYmYqtNRFKP8o8ME6JAp4daxhVIKSLmXxOOaLCh4ww,3795
11
+ synth_ai/api/train/env_resolver.py,sha256=PLvuorBg3ugxZUsfDeZAMrqmqEt56aGRInmhuHD6z8g,10715
12
+ synth_ai/api/train/pollers.py,sha256=EbkoV601aXEpqgfjNuugivtDooiRgOxBXSYZZ0Muj24,2114
13
+ synth_ai/api/train/task_app.py,sha256=zIeKas5AC7TmbDLmqYwXEzm9l-ABxU4i-Ir3jSIWy_I,3923
14
+ synth_ai/api/train/utils.py,sha256=rkouZjOFvY9WKXIuG-rlJhH9eyLLxi_ID6dj0JMNSmI,7213
15
+ synth_ai/cli/__init__.py,sha256=HU7nV2mhnvAmhuXyxEddIYO6ic5EWlBNECqYSelxQ-s,2083
8
16
  synth_ai/cli/balance.py,sha256=z4h1MQSyFX60k-13L9IT0rtOCI16iKNGJeNjFMZuv_k,8010
9
17
  synth_ai/cli/calc.py,sha256=RJyQJ41e02xn-V0vRRCAVkL59UHDqyz8XpYGsenfdm4,2085
10
18
  synth_ai/cli/demo.py,sha256=NeRiLv9ZQyX9tVxvZ6uV5YmucQ8fu5gyL5qZE0GfBZY,5496
11
19
  synth_ai/cli/legacy_root_backup.py,sha256=KSMADyJ2g5OVpsq_CeBzqIeDC2Um-9GyINzsJH-75uw,15872
12
20
  synth_ai/cli/man.py,sha256=JQDon73ZkuKP9xr1_vRh5fjV9_b5xiUb7zNjny7ArB8,3765
13
21
  synth_ai/cli/recent.py,sha256=mHhM-QrR_MfjfKSzBvvPUEC-lkXTWUZrQwqYTmb2x0Y,4173
14
- synth_ai/cli/rl_demo.py,sha256=HAZqHaGFKAu7yXtjglmmNcHp4js77wCYSpa2WTcjyUE,8050
15
- synth_ai/cli/root.py,sha256=C5eA3fuzyL6fpSDT7pRk4kT0BOAmdfS6SkaH3LgYTAY,9867
22
+ synth_ai/cli/rl_demo.py,sha256=_IYi5v3FTOpGe0zV9H9p5qZ3iT9ctXqbi9yXTZnwKFg,8056
23
+ synth_ai/cli/root.py,sha256=UqaQvfnrtCkA5IHUTNQ2VfErTD9L5fT1LSsBnqK9Ndg,10045
16
24
  synth_ai/cli/status.py,sha256=M_bt7U58Ubi-q-ZlrIpgCASKq9_k6uMjpx926f6kLLA,4591
25
+ synth_ai/cli/task_apps.py,sha256=HQy8qfTiciej8Fv9PbjzJwVl4ZE5eLXXOMKSgt156aY,22189
17
26
  synth_ai/cli/traces.py,sha256=_QBdCR92u0Gv51U4DH0Ws1d5yCrbJRpaYKe7pmcHrHs,6484
18
27
  synth_ai/cli/watch.py,sha256=HBKbAcpUkkPhGvsPRofckbu8oILiVqp35NXHkIEpTTc,17808
19
28
  synth_ai/compound/cais.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -30,7 +39,7 @@ synth_ai/demos/demo_task_apps/math/app.py,sha256=gNopoAhwM0vzdKuCa7AwQqSwiV2xagr
30
39
  synth_ai/demos/demo_task_apps/math/config.toml,sha256=Kxrzuyj7Az5mvzXaipPIyngKTDqphohf6uSWOHCF5cw,2105
31
40
  synth_ai/demos/demo_task_apps/math/deploy_modal.py,sha256=O4745sFuGEZTsygl-mz6ZOFJ7mog8CquXMgMyjFKr_c,2288
32
41
  synth_ai/demos/demo_task_apps/math/deploy_task_app.sh,sha256=qVffbAmsiCAxzFDzcxNVF4f7yyLWnmqPc1cNydHT5BQ,791
33
- synth_ai/demos/demo_task_apps/math/modal_task_app.py,sha256=eJtNUZvO0foucqQ5-jHOygu3VaffrUEHn9jd1_9ncdM,20112
42
+ synth_ai/demos/demo_task_apps/math/modal_task_app.py,sha256=nKrYZBtehAC3J9WHsmV9V2iiC7vbexEz1rTkOoU0wDI,20180
34
43
  synth_ai/environments/__init__.py,sha256=BQW0Nc_BFQq_N-pcqTyJVjW56kSEXu7XZyaSer-U95Q,1032
35
44
  synth_ai/environments/environment/__init__.py,sha256=EBol9AKxPTIPXWcbH9Tja-l3yL-N2kB8e5atyf6F66c,31
36
45
  synth_ai/environments/environment/core.py,sha256=0jd0CZ88_s_qqA3d1lOgVsnv-ucw_1lJDAIUj1gTSt0,2201
@@ -345,10 +354,23 @@ synth_ai/rl/contracts.py,sha256=6LJUT2UWHWebkoMprbIgsycV9ET3qLY-3NN1v4bJacY,673
345
354
  synth_ai/rl/env_keys.py,sha256=lb2kQwuk4zMXyTUnaVCAbYvIstiGznLCdx797rAsPFk,4960
346
355
  synth_ai/rl/secrets.py,sha256=RJU7N0idDNhENHyG9uAStXJxRGQMQti45xpm5i3uUGc,586
347
356
  synth_ai/scripts/verify_rewards.py,sha256=w1eFGi-H5It7J55Qyt5s1mPnSc4AldMmZ9roNzE0ulQ,3304
348
- synth_ai/task/__init__.py,sha256=1mkw9Gfgg7eYKxgvJGHvffpGZmJG9xTNn7ESKhERDv0,253
349
- synth_ai/task/contracts.py,sha256=-zzarbw-8XIBSbd9SPSU1UF0fYKuTFOweWh5yHrj9nk,3699
357
+ synth_ai/task/__init__.py,sha256=DmtEMz_--x3W8BaHindUTwd9QKq1vdIcBCLl5fmPJiQ,2410
358
+ synth_ai/task/auth.py,sha256=ore521yqj497fK6GVPcNLob8lY_gf4hblyo6w2BWFBA,4642
359
+ synth_ai/task/client.py,sha256=kV2OG6rO39F4s99HENhqqqoz0waSxwOvHmjcISiCIIE,5068
360
+ synth_ai/task/contracts.py,sha256=d1V8VtZ23UKX5hIem-dxXMQBr-7PdjVIdSXz09eygkY,4129
361
+ synth_ai/task/datasets.py,sha256=xt28vdxy6j85DmPM_fTBubYXeUcrnZ1mgIG8vac1xIU,3940
362
+ synth_ai/task/errors.py,sha256=wE4-cuk_1nDvejov8G-4tP7kZiwGd5aXqYSgATKoFW0,1550
350
363
  synth_ai/task/health.py,sha256=MItweOAtvYAVdhqDVaKJhRgvTOqgSLZylgY8m7YqVp8,985
364
+ synth_ai/task/json.py,sha256=JPw4UXHPiqGAIP2yCA4OF2AR5Z-euoO2Sw4KUfJ9GZg,2572
365
+ synth_ai/task/proxy.py,sha256=h07a2Hdw7iT392Ygb7ZatHjI7u5ge-43ueN-Ub8IrZU,9010
366
+ synth_ai/task/rubrics.py,sha256=-dXzLEJJGe0JTwoQ8w1Lhkdp4y_2rOvXdC51i3373oU,7122
367
+ synth_ai/task/server.py,sha256=bYrqnwtbGEdI_lieBMslgh-sUwdyzEbbHnmjovrRef8,15187
368
+ synth_ai/task/tracing_utils.py,sha256=kro--A6BTCVReLMNRX4_v2arLVXYIQNKtn3RDMMrOmE,2400
351
369
  synth_ai/task/validators.py,sha256=IGE9zTjHYXOehwakMkcOAaDLSaHw_0Tp8uzL2ydCZ9U,361
370
+ synth_ai/task/vendors.py,sha256=zG-qeP2OC1s5kJECZdf02QBvn-v_qHcz-rG0C8Ws0wA,1664
371
+ synth_ai/task/apps/__init__.py,sha256=M0DeEhvUhyXh1A_AnVSBXTeJY75c7BVsW0A_1vxL_08,2677
372
+ synth_ai/task/apps/grpo_crafter.py,sha256=eCxD9eHYLIkvo4mFhlIY14u-Ipp_zmHj6wvg08Vu58Y,15809
373
+ synth_ai/task/apps/math_single_step.py,sha256=jhoArV52jlWxN6HO2XYTnrLC3aWF23G1B9PRVx5LkVM,30278
352
374
  synth_ai/tracing/__init__.py,sha256=0Yy1YDMe_Duw976yu0HL1cbqPWdZEvtgEdtjDguNvcc,781
353
375
  synth_ai/tracing_v1/__init__.py,sha256=uV6qf8_rJTxRx6tCsXvqnjHhA1mR0im2rANuh0McrHA,930
354
376
  synth_ai/tracing_v3/__init__.py,sha256=9lKM-blbXo6Sk1oBpyYayjMVU43f9Y_35M1OvRynWoU,3251
@@ -361,11 +383,11 @@ synth_ai/tracing_v3/llm_call_record_helpers.py,sha256=mqSQStFC02z9b7uoTO7FjgJfd8
361
383
  synth_ai/tracing_v3/lm_call_record_abstractions.py,sha256=j2RGuXVaV_EXmIosuXRDjptJSlrDXwb8x06k2fF6lqo,9195
362
384
  synth_ai/tracing_v3/migration_helper.py,sha256=izm7SNHtG3VDv_5ZmMk_mmwKitmShxUK3joNFOArZIY,4177
363
385
  synth_ai/tracing_v3/replica_sync.py,sha256=MoJRcMp6rZVC1QZF9EH2oUV70C7Br0N8DhEUZ9PeWks,8670
364
- synth_ai/tracing_v3/session_tracer.py,sha256=olgRSIhkH-UNPdNPYv9DYc4_poPiMnLEkbIrE68UrWI,17290
386
+ synth_ai/tracing_v3/session_tracer.py,sha256=wMJ-mzt2gDt3RZ2FoYdOaE0cXNn9M6gKKNN2EMfWT48,17683
365
387
  synth_ai/tracing_v3/utils.py,sha256=7HQptlq6B1nlmkv6M-lsNdmRisYJk3KNTTditr7dhB8,3444
366
388
  synth_ai/tracing_v3/examples/basic_usage.py,sha256=wNpn8t0s0-2wusamBjn8WyyDUM_5Qz5_7TJuK4tSA98,7196
367
389
  synth_ai/tracing_v3/storage/__init__.py,sha256=VPjBh180bcSPz1HsbqaqfnvguwqwomaEYKxkrhfGABY,332
368
- synth_ai/tracing_v3/storage/base.py,sha256=6gzMy0wHnkPRK1gPWRQWZk5Q1EFhWtdcXHfuUP_F12E,3587
390
+ synth_ai/tracing_v3/storage/base.py,sha256=cGIWcTY8EIkIZOgputOTkWMgxH1hM866OO-BnHISrV4,3663
369
391
  synth_ai/tracing_v3/storage/config.py,sha256=F20Vh5rBYtN9H2MFfVw9tQT8IjKmPsOtNfdcy1vIx8g,2077
370
392
  synth_ai/tracing_v3/storage/exceptions.py,sha256=zqfsjb4r8qcZGlId0h9-x0RpJq2_DRDfdlzW6_KIRCw,708
371
393
  synth_ai/tracing_v3/storage/factory.py,sha256=fztR3YxxFpRBFtRsJvvn5Gb7eNWfzMScX48cJiVIgos,1262
@@ -373,7 +395,7 @@ synth_ai/tracing_v3/storage/types.py,sha256=LevN8M12ilZ0EaiQ6Y3yONSMuLGEhSKNt0ir
373
395
  synth_ai/tracing_v3/storage/utils.py,sha256=GTc0AYzuaCAwci6sg7UCgtMnluNIIUDbrBOJcP8LvmE,6056
374
396
  synth_ai/tracing_v3/turso/__init__.py,sha256=MSvWojb9unyfLeTSaiVfw5T3dK72MzNQbvoCEZB9zag,414
375
397
  synth_ai/tracing_v3/turso/daemon.py,sha256=RHcwab3pe3rbD8Ccl10_61KWgaieBv0fHVOsn9NkFfk,4334
376
- synth_ai/tracing_v3/turso/manager.py,sha256=ktPuq9Md7XuVsvnKNSQirArVzwb06fo1QRH4Xu-i5-c,31375
398
+ synth_ai/tracing_v3/turso/manager.py,sha256=dIyG-PxpIA6gNcttCwl6sha2iDXu4Omcw_mUcWWufeU,31919
377
399
  synth_ai/tracing_v3/turso/models.py,sha256=XPt_pF1QsLFdyfWcRhPx71fpWJKNFzVV0sfN4owJi_U,16347
378
400
  synth_ai/v0/tracing/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
379
401
  synth_ai/v0/tracing/abstractions.py,sha256=pL9XCf9UEWdX4IRizzRK9XUNBtDeBYfkVD51F8UOB0s,6898
@@ -412,9 +434,9 @@ synth_ai/v0/tracing_v1/events/manage.py,sha256=ZDXXP-ZwLH9LCsmw7Ru9o55d7bl_diPtJ
412
434
  synth_ai/v0/tracing_v1/events/scope.py,sha256=BuBkhSpVHUJt8iGT9HJZF82rbb88mQcd2vM2shg-w2I,2550
413
435
  synth_ai/v0/tracing_v1/events/store.py,sha256=0342lvAcalyJbVEIzQFaPuMQGgwiFm7M5rE6gr-G0E8,9041
414
436
  synth_ai/zyk/__init__.py,sha256=htVLnzTYQ5rxzYpzSYBm7_o6uNKZ3pB_PrqkBrgTRS4,771
415
- synth_ai-0.2.8.dev11.dist-info/licenses/LICENSE,sha256=ynhjRQUfqA_RdGRATApfFA_fBAy9cno04sLtLUqxVFM,1069
416
- synth_ai-0.2.8.dev11.dist-info/METADATA,sha256=ibi9UBO3d-6_HewGfYvGBR01F-HxD5G-lYV-on2Gp8s,5153
417
- synth_ai-0.2.8.dev11.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
418
- synth_ai-0.2.8.dev11.dist-info/entry_points.txt,sha256=Neq-3bT7TAijjgOIR77pKL-WYg6TWBDeO8pp_nL4vGY,91
419
- synth_ai-0.2.8.dev11.dist-info/top_level.txt,sha256=fBmtZyVHuKaGa29oHBaaUkrUIWTqSpoVMPiVdCDP3k8,9
420
- synth_ai-0.2.8.dev11.dist-info/RECORD,,
437
+ synth_ai-0.2.8.dev13.dist-info/licenses/LICENSE,sha256=ynhjRQUfqA_RdGRATApfFA_fBAy9cno04sLtLUqxVFM,1069
438
+ synth_ai-0.2.8.dev13.dist-info/METADATA,sha256=yEVWdmdvOWOTkGiVtUur4gFCWt85Sb_gApuD4rf15uU,5201
439
+ synth_ai-0.2.8.dev13.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
440
+ synth_ai-0.2.8.dev13.dist-info/entry_points.txt,sha256=Neq-3bT7TAijjgOIR77pKL-WYg6TWBDeO8pp_nL4vGY,91
441
+ synth_ai-0.2.8.dev13.dist-info/top_level.txt,sha256=fBmtZyVHuKaGa29oHBaaUkrUIWTqSpoVMPiVdCDP3k8,9
442
+ synth_ai-0.2.8.dev13.dist-info/RECORD,,