verifiers 0.2.2.dev75__py3-none-any.whl → 0.2.2.dev76__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.
verifiers/v1/__init__.py CHANGED
@@ -22,7 +22,7 @@ from verifiers.v1.configs.legacy import LegacyEnvConfig
22
22
  from verifiers.v1.configs.retries import RetryConfig
23
23
  from verifiers.v1.configs.serve import (
24
24
  ElasticPoolConfig,
25
- ServingConfig,
25
+ ServeConfig,
26
26
  StaticPoolConfig,
27
27
  pool_serve_kwargs,
28
28
  )
@@ -254,7 +254,7 @@ __all__ = [ # noqa: RUF022 - grouped by public API area
254
254
  "Env",
255
255
  "SingleAgentEnv",
256
256
  "EnvConfig",
257
- "ServingConfig",
257
+ "ServeConfig",
258
258
  "LegacyEnvConfig",
259
259
  "resolve_env_field",
260
260
  "narrowed_env_annotation",
@@ -3,7 +3,6 @@
3
3
  from verifiers.v1.configs.cli.debug import DebugConfig
4
4
  from verifiers.v1.configs.cli.eval import EvalConfig
5
5
  from verifiers.v1.configs.cli.init import InitConfig
6
- from verifiers.v1.configs.cli.serve import ServeConfig
7
6
  from verifiers.v1.configs.cli.validate import ValidateConfig
8
7
 
9
- __all__ = ["DebugConfig", "EvalConfig", "InitConfig", "ServeConfig", "ValidateConfig"]
8
+ __all__ = ["DebugConfig", "EvalConfig", "InitConfig", "ValidateConfig"]
@@ -10,7 +10,7 @@ from verifiers.v1.clients import ClientConfig, EvalClientConfig
10
10
  from verifiers.v1.configs.cli.env import narrowed_env_annotation, resolve_env_field
11
11
  from verifiers.v1.configs.env import EnvConfig
12
12
  from verifiers.v1.configs.legacy import LegacyEnvConfig
13
- from verifiers.v1.configs.serve import ServingConfig
13
+ from verifiers.v1.configs.serve import ServeConfig
14
14
  from verifiers.v1.envs.single_agent import SingleAgentEnvConfig
15
15
  from verifiers.v1.types import SamplingConfig
16
16
 
@@ -19,7 +19,7 @@ class EvalConfig(BaseConfig):
19
19
  env: SerializeAsAny[EnvConfig] = SingleAgentEnvConfig()
20
20
  """The environment — which env, its seed taskset, each agent, its knobs. Narrowed to
21
21
  the selected env's config class by the env id, else the taskset id."""
22
- serve: ServingConfig = ServingConfig()
22
+ serve: ServeConfig = ServeConfig()
23
23
  """How the env is hosted under `--server`: the worker pool, each worker's episode
24
24
  bound. Ignored by an in-process run."""
25
25
  legacy: LegacyEnvConfig = LegacyEnvConfig()
@@ -1,8 +1,8 @@
1
1
  """How an env is served: the worker pool, where it binds, and each worker's bound.
2
2
 
3
3
  Serving is its own axis. `[env]` says what runs; this says how it's hosted, so an
4
- eval, a `serve` process, and a trainer configure it identically instead of each
5
- flattening pool knobs onto its own config."""
4
+ eval and a trainer's env server configure it identically instead of each flattening
5
+ pool knobs onto its own config."""
6
6
 
7
7
  from typing import Annotated, Literal
8
8
 
@@ -35,10 +35,10 @@ PoolConfig = Annotated[
35
35
  ]
36
36
 
37
37
 
38
- class ServingConfig(BaseConfig):
38
+ class ServeConfig(BaseConfig):
39
39
  """The `[serve]` block: the worker pool, the ZMQ address, and each worker's
40
- episode bound. Read by whoever hosts the env — the `serve` CLI, a server-backed
41
- eval, a trainer's orchestrator."""
40
+ episode bound. Read by whoever hosts the env — a server-backed eval, a
41
+ trainer's env-server process."""
42
42
 
43
43
  pool: PoolConfig = Field(default_factory=ElasticPoolConfig)
44
44
  """Worker-pool sizing. `elastic` (default) starts at one worker and scales up on
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: verifiers
3
- Version: 0.2.2.dev75
3
+ Version: 0.2.2.dev76
4
4
  Summary: Verifiers: Environments for LLM Reinforcement Learning
5
5
  Project-URL: Homepage, https://github.com/primeintellect-ai/verifiers
6
6
  Project-URL: Documentation, https://github.com/primeintellect-ai/verifiers
@@ -167,7 +167,7 @@ verifiers/utils/threaded_sandbox_client.py,sha256=XRzYhWBpMev7kw_aNMWAy6lfa-9uAn
167
167
  verifiers/utils/tool_utils.py,sha256=gInWZODWQUZN4TyEMuuITyOUm9qlHJxtcvr1zZl_zJs,1020
168
168
  verifiers/utils/usage_utils.py,sha256=Mw6WC78r6EsLyRFdP9ICveqptkjizbSkAC86ZH0geVU,3918
169
169
  verifiers/utils/version_utils.py,sha256=39gV8-mNF9GspAgKloLo8oy7_MVluMrwGPrntQv2hx4,2656
170
- verifiers/v1/__init__.py,sha256=kacTRsGsRHfOruv16ZyIOesfvCH_nW98ARKPYSgcNIc,7509
170
+ verifiers/v1/__init__.py,sha256=v6qrJQFeNL2b4wd0PsDWiituw2Y-f5rMaFmdbdP6SdM,7505
171
171
  verifiers/v1/agent.py,sha256=MQVKGjUhrP8uzRXAq94uJHkEsdHFziPxQHZ7TOD324I,31306
172
172
  verifiers/v1/env.py,sha256=g6fpoG-Z9lM3vTKrrU-QRJY3S88_y9zsPHwBvfs5vdY,17865
173
173
  verifiers/v1/episode.py,sha256=YtuRTV_PpwDglXFeN6UNg8IswpP1HseFLCYtascGMNI,3218
@@ -192,7 +192,6 @@ verifiers/v1/cli/init.py,sha256=Qj96Kwzfhaejhrc0yYqHNRl3ncoID028RGlHvS1C98Q,8508
192
192
  verifiers/v1/cli/output.py,sha256=pMS5Z0EBgyAVShNCAk9jVURNeLOaTfeRWpt0J8hHjq8,5890
193
193
  verifiers/v1/cli/replay.py,sha256=DAh9kB5PB-ppZLGhxdJwrCPch_Yky5HKhplwGFhKEz0,10164
194
194
  verifiers/v1/cli/resolve.py,sha256=OsNw4C3r9xOVFa-mminJFcex_bAsJ6EQ8K7A_H8u2kQ,4370
195
- verifiers/v1/cli/serve.py,sha256=_mdJaHVVe4pXzcpAot0ugcmiN3ra2gS4GrGmLghnX5M,2866
196
195
  verifiers/v1/cli/validate.py,sha256=7ax6FqIzNBSYjd3JXK4v7Vbq34Rozyh1OvGpYnGqlSg,10266
197
196
  verifiers/v1/cli/dashboard/__init__.py,sha256=v-baMxQuWxOCsbU7-p_jj2Q9BUnTN-TWi1q2hK6rU2s,198
198
197
  verifiers/v1/cli/dashboard/base.py,sha256=kUP93zJSIVLptSbnWX6MOy8kGg63fpeAzPqakCpPyDc,3547
@@ -216,16 +215,15 @@ verifiers/v1/configs/harness.py,sha256=CG8hGbHl3rr6yawH3YYMAFl01M7Piiwf4w5oiw2Va
216
215
  verifiers/v1/configs/judge.py,sha256=O7oe28tS24fKRXUML_-6vHrVGdG6w7061SPQXOH7XvM,2223
217
216
  verifiers/v1/configs/legacy.py,sha256=YOJM6L5u6-jYpZ1CLpPInufKdmz1lEsMNKIRdT2JaaY,1080
218
217
  verifiers/v1/configs/retries.py,sha256=-nPlgmz7J_NZ4GOYG6oCc3thXo4La2SufBmvQGvvPGo,821
219
- verifiers/v1/configs/serve.py,sha256=cHHnFGQtqEwvaovdeoVMpCebTHgPXKUuIivN5IhxZR0,2596
218
+ verifiers/v1/configs/serve.py,sha256=nSoJcTX2S0Vy9EUeNqW0Yo-f9_MUqpBiY-Q9FF_4cRo,2576
220
219
  verifiers/v1/configs/task.py,sha256=1ozZjfpahin7I_TqzC7f3xr7CHSthAdydegFPXW4d9k,1101
221
220
  verifiers/v1/configs/taskset.py,sha256=o-tr1xkmGmYG10_ySG-Du_djWS-dN4h7cv14WSvJ4eY,851
222
- verifiers/v1/configs/cli/__init__.py,sha256=3wBAONw5XkBPqbMjpHk5XBHlBVybR8JQ2JCPWijYBMU,444
221
+ verifiers/v1/configs/cli/__init__.py,sha256=TJaWQQHrcyXoeqS7P9S25ztd78YJ30_9_Ug0czRH7Tw,374
223
222
  verifiers/v1/configs/cli/debug.py,sha256=VFsZ1tiKGvvx5mFDOzqqeU4cRtQkJ8OeD8mmRBZhy8w,2849
224
223
  verifiers/v1/configs/cli/env.py,sha256=DJbJy0-DqqtmFm0r7NpvRBbuxXnXc1o-yurDKUBSGJk,2701
225
- verifiers/v1/configs/cli/eval.py,sha256=YWYMvPOIAG51e0JdmyA-U_P7eInMPZ_8DTFim6aWn6Y,6869
224
+ verifiers/v1/configs/cli/eval.py,sha256=HqIBtt8DuZEHZ07KgtE1jiqZy8OsDMfTahTuBAvslcA,6863
226
225
  verifiers/v1/configs/cli/init.py,sha256=tMaTDF_lU1Af3JmQpksk2mwe8CAfpnHsquXhwepZhYo,1019
227
226
  verifiers/v1/configs/cli/replay.py,sha256=xvMDZzIkvjgYl-a3ragjXI65DsD6FYl6gEFM5qpdIuA,2913
228
- verifiers/v1/configs/cli/serve.py,sha256=1rAt0QOL-XT3DMmRUIA40t1E3YuoD1vOADfsiTwFBf0,2981
229
227
  verifiers/v1/configs/cli/validate.py,sha256=UdgC6bQ2RYx3t8n9HjsImAHV_ifoOxYOSlbtdZzOnZY,2298
230
228
  verifiers/v1/dialects/__init__.py,sha256=p72C7VYrFQzVgTcfmzpHGSwXlvThfc4pvjBxsqw7kHE,786
231
229
  verifiers/v1/dialects/anthropic.py,sha256=nj9J7OOhexmPHa-sWiNP2xlI9_bGhvwM5VWzdh19pBc,13526
@@ -339,8 +337,8 @@ verifiers/v1/utils/platform.py,sha256=56Ixmk1SER6q5LvzyYcA0hgzGpzhxKZL8Hiqp4c_XV
339
337
  verifiers/v1/utils/retries.py,sha256=Y2ZgrAjn-qNkRKZP_RVNL_7EK0iaRcZeCa404lpGYi4,5417
340
338
  verifiers/v1/utils/score.py,sha256=-R5Cog14r_tJ6Q_oOfGr5VPAm2CCUhofYZB6B9lm4wM,5787
341
339
  verifiers/v1/utils/version.py,sha256=-obEo_-l9-D8FLef4hYxncOe-uJpxrM1g2Hig_37Sgs,1607
342
- verifiers-0.2.2.dev75.dist-info/METADATA,sha256=8ZNGDY1kLfAvLaXC5voMOQeGRtvHeflfC3eV0v34rWg,4545
343
- verifiers-0.2.2.dev75.dist-info/WHEEL,sha256=lCkmxWfQsSc9CfIClYeavTdQeEX2toPqufh9gI35EQA,87
344
- verifiers-0.2.2.dev75.dist-info/entry_points.txt,sha256=dF82JUYEFslR1AOW8LZfuBWeZeQoyX4wCRrduklg8-I,551
345
- verifiers-0.2.2.dev75.dist-info/licenses/LICENSE,sha256=v0RrUsdV3IDoZhrRce297IXS3xMHNJ-_LdLpFAUWb9k,1072
346
- verifiers-0.2.2.dev75.dist-info/RECORD,,
340
+ verifiers-0.2.2.dev76.dist-info/METADATA,sha256=vOCZL_bCXmOR9KHHvbzSCszxDmGtjDRTNxI0I8Zn8Hs,4545
341
+ verifiers-0.2.2.dev76.dist-info/WHEEL,sha256=lCkmxWfQsSc9CfIClYeavTdQeEX2toPqufh9gI35EQA,87
342
+ verifiers-0.2.2.dev76.dist-info/entry_points.txt,sha256=v6v0QT9vVExnfn4br42MostI_o3f3ZbWYlTormz-U3g,515
343
+ verifiers-0.2.2.dev76.dist-info/licenses/LICENSE,sha256=v0RrUsdV3IDoZhrRce297IXS3xMHNJ-_LdLpFAUWb9k,1072
344
+ verifiers-0.2.2.dev76.dist-info/RECORD,,
@@ -4,7 +4,6 @@ eval = verifiers.v1.cli.eval.main:main
4
4
  gepa = verifiers.v1.cli.gepa:main
5
5
  init = verifiers.v1.cli.init:main
6
6
  replay = verifiers.v1.cli.replay:main
7
- serve = verifiers.v1.cli.serve:main
8
7
  validate = verifiers.v1.cli.validate:main
9
8
  vf-build = verifiers.scripts.build:main
10
9
  vf-eval = verifiers.scripts.eval:main
verifiers/v1/cli/serve.py DELETED
@@ -1,79 +0,0 @@
1
- """Environment-server CLI entrypoint."""
2
-
3
- import sys
4
- from functools import partial
5
-
6
- from pydantic_config import cli
7
-
8
- from verifiers.v1.cli.resolve import (
9
- extract_id,
10
- narrow_config,
11
- plugin_errors,
12
- references_config_file,
13
- with_positional_taskset,
14
- )
15
- from verifiers.v1.configs.cli.serve import ServeConfig
16
- from verifiers.v1.configs.serve import pool_serve_kwargs
17
- from verifiers.v1.serve import serve_env
18
- from verifiers.v1.utils.logging import setup_logging
19
-
20
- USAGE = "usage: uv run serve [<taskset-id>] [--env.id <id>] [--legacy.id <env-id> (v0)] [options] [@ file.toml]"
21
-
22
-
23
- def main(argv: list[str] | None = None) -> None:
24
- argv = with_positional_taskset(list(sys.argv[1:]) if argv is None else list(argv))
25
-
26
- if not argv or any(arg in ("-h", "--help") for arg in argv):
27
- print(USAGE)
28
- sys.argv = [sys.argv[0], "--help"]
29
- with plugin_errors():
30
- cli(narrow_config(ServeConfig, argv))
31
- return
32
- legacy_id = any(a == "--legacy.id" or a.startswith("--legacy.id=") for a in argv)
33
- # An env-block flag (or a since-moved flat axis) skips the usage gate so the typed
34
- # parse renders its did-you-mean instead of a bare usage line.
35
- typed_axis = any(
36
- a.startswith(("--env.", "--taskset.", "--harness.", "--serve.")) for a in argv
37
- )
38
- if (
39
- not extract_id(argv, "env.taskset")
40
- and not legacy_id
41
- and not references_config_file(argv)
42
- and not typed_axis
43
- ):
44
- raise SystemExit(
45
- USAGE
46
- ) # need a taskset (positional / --env.taskset.id), a v0 --legacy.id, or @ file.toml
47
-
48
- with plugin_errors():
49
- config_type = narrow_config(ServeConfig, argv)
50
- sys.argv = [sys.argv[0], *argv]
51
- config = cli(config_type)
52
- if config.dry_run:
53
- print(config.model_dump_json(indent=2, exclude_none=True))
54
- return
55
- level = "DEBUG" if config.verbose else "INFO"
56
- setup_logging(level)
57
-
58
- # The pool config decides in-process vs router + worker pool (static or elastic); the
59
- # frontend speaks the same protocol either way. serve_env owns the SIGTERM teardown.
60
- # Pool workers are spawned with no logging, so hand serve_env the same setup to apply
61
- # in each one.
62
- server_kwargs = (
63
- {
64
- "env_id": config.legacy.id,
65
- "env_args": config.legacy.args,
66
- "extra_env_kwargs": config.legacy.extra_env_kwargs,
67
- }
68
- if config.is_legacy
69
- # `--serve.max-concurrent` is each v1 worker's episode bound; the legacy
70
- # bridge has never had one.
71
- else {"config": config.env, "max_concurrent": config.serve.max_concurrent}
72
- )
73
- serve_env(
74
- **pool_serve_kwargs(config.serve.pool),
75
- legacy=config.is_legacy,
76
- address=config.serve.address,
77
- log_setup=partial(setup_logging, level),
78
- **server_kwargs,
79
- )
@@ -1,62 +0,0 @@
1
- """Environment-server CLI configuration."""
2
-
3
- from pydantic import AliasChoices, Field, SerializeAsAny, model_validator
4
- from pydantic_config import BaseConfig
5
-
6
- from verifiers.v1.configs.cli.env import narrowed_env_annotation, resolve_env_field
7
- from verifiers.v1.configs.env import EnvConfig
8
- from verifiers.v1.configs.legacy import LegacyEnvConfig
9
- from verifiers.v1.configs.serve import ServingConfig
10
- from verifiers.v1.envs.single_agent import SingleAgentEnvConfig
11
-
12
-
13
- class ServeConfig(BaseConfig):
14
- """`uv run serve`: what to serve (`[env]`, or `[legacy]` for a classic v0 env) and
15
- how it's hosted (`[serve]`)."""
16
-
17
- env: SerializeAsAny[EnvConfig] = SingleAgentEnvConfig()
18
- """The environment — which env, its seed taskset, each agent, its knobs. Narrowed to
19
- the selected env's config class by the env id, else the taskset id."""
20
- serve: ServingConfig = ServingConfig()
21
- """How it's served: the worker pool, the bind address, each worker's episode bound."""
22
- legacy: LegacyEnvConfig = LegacyEnvConfig()
23
- """A classic (v0) environment to serve through the bridge instead of `[env]`."""
24
- verbose: bool = Field(False, validation_alias=AliasChoices("verbose", "v"))
25
- """Log at debug level instead of info."""
26
- dry_run: bool = False
27
- """Resolve + validate the config and dump it, then exit."""
28
-
29
- @property
30
- def is_legacy(self) -> bool:
31
- """Whether this run goes through the v0 bridge: a legacy id and no v1 taskset."""
32
- return self.legacy.id is not None and not self.env.taskset.id
33
-
34
- @property
35
- def env_id(self) -> str:
36
- """The run's identifier: the v1 env's, else the v0 env id."""
37
- return self.env.env_id or self.legacy.id or ""
38
-
39
- @model_validator(mode="after")
40
- def _refuse_mixed_run(self):
41
- # A v0 id next to any v1 env identity leaves one of the two going nowhere, and
42
- # which one depends on `is_legacy`: a taskset makes it False, so the v0 env never
43
- # loads; a bare `--env.id` leaves it True, so the v0 env runs under the v1 name.
44
- if self.legacy.id is None or not self.env.env_id:
45
- return self
46
- if self.env.taskset.id:
47
- raise ValueError(
48
- f"--legacy.id {self.legacy.id!r} is a classic (v0) env and can't combine "
49
- f"with the v1 taskset {self.env.taskset.id!r}. Pairing a reusable env with "
50
- f"a taskset is --env.id {self.legacy.id!r} (TOML: id under [env]); to run "
51
- "the v0 env instead, drop the taskset."
52
- )
53
- raise ValueError(
54
- f"--legacy.id {self.legacy.id!r} is a classic (v0) env and can't combine with "
55
- f"the v1 env --env.id {self.env.id!r}: the v0 env is what would run, stamped "
56
- "with the v1 env's name. Keep whichever one you meant to run."
57
- )
58
-
59
- @model_validator(mode="before")
60
- @classmethod
61
- def _resolve_env(cls, data):
62
- return resolve_env_field(data, narrowed_env_annotation(cls))