verifiers 0.2.1.dev22__py3-none-any.whl → 0.2.1.dev24__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.
@@ -263,7 +263,9 @@ async def serve(
263
263
  # `state_base`, which is universally reachable (the interception is exposed via a tunnel
264
264
  # whenever any consumer is remote). Eval-level shared servers get no per-rollout channel
265
265
  # (`state_base` is None for them).
266
- state_url = f"{state_base.rstrip('/')}/state" if state_base else None
266
+ state_url = (
267
+ f"{runtime.host_url(state_base.rstrip('/'))}/state" if state_base else None
268
+ )
267
269
  port = await serve_in_runtime(
268
270
  server,
269
271
  runtime,
@@ -289,6 +291,8 @@ async def serve(
289
291
  runtime, port, colocated=colocated, consumer_is_local=consumer_is_local
290
292
  )
291
293
  )
294
+ if not for_host and not colocated and harness_runtime is not None:
295
+ base = harness_runtime.host_url(base)
292
296
  yield f"{base.rstrip('/')}/mcp"
293
297
 
294
298
 
@@ -389,7 +393,8 @@ async def serve_tools(
389
393
  urls[name] = server.url
390
394
  logger.info("tool server '%s' (shared, external): %s", name, server.url)
391
395
  continue
392
- urls[name] = _shared_url_for_rollout(server.url, state_base, state_secret)
396
+ url = harness_runtime.host_url(server.url) if server.local else server.url
397
+ urls[name] = _shared_url_for_rollout(url, state_base, state_secret)
393
398
  # The tagged URL contains the bearer secret; log only the untagged base URL.
394
399
  logger.info("tool server '%s' (shared): %s", name, server.url)
395
400
  for toolset in toolsets:
verifiers/v1/rollout.py CHANGED
@@ -158,7 +158,7 @@ class Rollout:
158
158
  async with self._serve_interception(
159
159
  runtime, session, [*tool_servers, *([user] if user else [])]
160
160
  ) as (base_url, secret):
161
- endpoint = f"{base_url}/v1"
161
+ endpoint = f"{runtime.host_url(base_url)}/v1"
162
162
  async with (
163
163
  serve_tools(
164
164
  tool_servers,
@@ -19,13 +19,10 @@ from verifiers.v1.utils.aio import run_shielded
19
19
 
20
20
  logger = logging.getLogger(__name__)
21
21
 
22
- # Ensure `uv` is available to run our PEP 723 scripts (the harness + tool servers): use it
23
- # if present, else bootstrap it — via pip; else via the standalone installer (curl/wget),
24
- # first installing curl + CA certs from the distro package manager when the image has no
25
- # downloader at all (bare task images, e.g. Harbor's). It installs to ~/.local/bin, which
26
- # we prepend to PATH so the provisioning command finds it; uv resolves each script's inline
27
- # deps into its own cache, isolated from the eval process. (Needs network + one of
28
- # uv / pip / curl / wget / apt-get / apk.)
22
+ # Ensure the latest `uv` is available for our PEP 723 scripts: prefer pip on Python images,
23
+ # then fall back to the standalone installer (curl/wget), installing curl + CA certs when a
24
+ # bare image has no downloader. Both paths install to ~/.local/bin, which we prepend to PATH.
25
+ # (Needs network + one of pip / curl / wget / apt-get / apk.)
29
26
  _INSTALL_CURL = ( # only when the image has no downloader; needs a known package manager
30
27
  "{ command -v curl >/dev/null 2>&1 || command -v wget >/dev/null 2>&1; } "
31
28
  "|| { apt-get update -qq && apt-get install -y -qq curl ca-certificates; } "
@@ -37,12 +34,8 @@ _DOWNLOAD_UV = (
37
34
  )
38
35
  _ENSURE_UV = (
39
36
  'export PATH="$HOME/.local/bin:$PATH" UV_INSTALL_DIR="$HOME/.local/bin"; '
40
- # Always install the latest uv into $HOME/.local/bin (ahead of any image uv on PATH) rather
41
- # than reusing whatever the image ships: base images carry wildly varying uvs (too old for the
42
- # `uv sync --script` / `uv python find --script` that prepare_uv_script runs, or stale/shadowed
43
- # on PATH). Installing fresh sidesteps all version probing. Falls back to pip when no downloader.
44
- f"{{ {_INSTALL_CURL}; {_DOWNLOAD_UV}; }} "
45
- "|| pip install -q -U uv 2>/dev/null"
37
+ "pip install -q -U --user uv 2>/dev/null "
38
+ f"|| {{ {_INSTALL_CURL}; {_DOWNLOAD_UV}; }}"
46
39
  )
47
40
 
48
41
  # The single port a self-publishing runtime (modal/prime) forwards to a public URL for a server
@@ -244,6 +237,10 @@ class Runtime(ABC):
244
237
  async def write(self, path: str, data: bytes) -> None:
245
238
  pass
246
239
 
240
+ def host_url(self, url: str) -> str:
241
+ """The URL a program inside this runtime uses to reach a host-bound `url`."""
242
+ return url
243
+
247
244
  @property
248
245
  def published_port(self) -> int | None:
249
246
  """A fixed port this runtime exposes to the outside at startup, declared up front to the
@@ -5,8 +5,10 @@ import contextlib
5
5
  import logging
6
6
  import shlex
7
7
  import subprocess
8
+ import sys
8
9
  from pathlib import PurePosixPath
9
10
  from typing import Literal
11
+ from urllib.parse import urlsplit
10
12
 
11
13
  from pydantic_config import BaseConfig
12
14
 
@@ -118,6 +120,14 @@ class DockerRuntime(Runtime):
118
120
  self.config.image,
119
121
  )
120
122
 
123
+ def host_url(self, url: str) -> str:
124
+ # Docker Desktop (macOS/Windows) runs containers in a VM, so `--network host`
125
+ # doesn't reach the host's loopback; `host.docker.internal` does.
126
+ host = urlsplit(url).hostname
127
+ if sys.platform != "linux" and host in ("127.0.0.1", "localhost"):
128
+ return url.replace(host, "host.docker.internal", 1)
129
+ return url
130
+
121
131
  async def run(self, argv: list[str], env: dict[str, str]) -> ProgramResult:
122
132
  env_args = [arg for k, v in env.items() for arg in ("--env", f"{k}={v}")]
123
133
  return await docker(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: verifiers
3
- Version: 0.2.1.dev22
3
+ Version: 0.2.1.dev24
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
@@ -209,7 +209,7 @@ verifiers/v1/legacy.py,sha256=R5vY7Q-wSY7CCyb3WGI2qJ52SwaVw0wrY5Bc-XEsNv0,20462
209
209
  verifiers/v1/loaders.py,sha256=UBiwHl76cjgw41xsz07bc9hKg1cnT1c4m05G-R1ipt4,5044
210
210
  verifiers/v1/push.py,sha256=-jZdFjPTLuyBD5H_YeUYz5KFpbFHKzIhnW3BtiY_f8o,8545
211
211
  verifiers/v1/retries.py,sha256=oZYN0S5XQjvMHLxB_06iMNAzBMjlKotTwuQtgIGUgfw,5748
212
- verifiers/v1/rollout.py,sha256=tIE460aYUPyAA3O_Jna5vRxJB7vUBcWr3PRXupLEHwU,10182
212
+ verifiers/v1/rollout.py,sha256=Y069AdltwLo5Bci_2Mg723TttTq5Tajnfr3TJA6Rn2Y,10200
213
213
  verifiers/v1/scoring.py,sha256=I_mtqhTZ195hj2-CB5jzr3BY5GFKgNEvTf331f7Is4k,5740
214
214
  verifiers/v1/session.py,sha256=1ur9JZbNd3NfFSy6LNJpQYveVZXW71-S6xme54AfVnY,4796
215
215
  verifiers/v1/state.py,sha256=hYo7DkOMNyh5pcKz7Xr7j-qQN2-LOKKDTlD-KdKmW40,698
@@ -291,13 +291,13 @@ verifiers/v1/judges/reference.txt,sha256=Ej35kGXiT2uJ0LcHIeez49rCS_9uHmCQKoVdn93
291
291
  verifiers/v1/judges/rubric.py,sha256=HEWFLhTKYPO6c1uuY4FY2iKDyQnan-6DiLB5NeQpiPI,11856
292
292
  verifiers/v1/judges/rubric.txt,sha256=3KA2ZeYYdcDweJhUGopxu9EFgARhu2aWft5S5cj8Bc8,323
293
293
  verifiers/v1/mcp/__init__.py,sha256=Bn_eIjJxPXOoRqAroC_W92jDmEesUVkq-0QTUwxoV3Y,634
294
- verifiers/v1/mcp/launch.py,sha256=OmJfEW2eefABIcmQlrVpziRVd05Hr518G8tzj_Ta0Gc,20845
294
+ verifiers/v1/mcp/launch.py,sha256=wt-pCIoQKsdQkYWn0v_ACkageDbp4_YzjmeVT7o60A0,21092
295
295
  verifiers/v1/mcp/server.py,sha256=MXEW6w72TkLa3iEPqrWgxQSlOBR-ostjImt5LNMtVo0,10692
296
296
  verifiers/v1/mcp/toolset.py,sha256=tSPXgTNREZyaeCnoFVnDfXxFAj_pStZMPUIgyPrY_Dk,996
297
297
  verifiers/v1/mcp/user.py,sha256=u_2KMRtNfg6WkwOCRLpR7j4ziFCUzGb1t6SomTbbu4Q,1591
298
298
  verifiers/v1/runtimes/__init__.py,sha256=L8BCIcL9InpQi3ip2-WoZKyO6FHXLnKBoYFWexEpI8Y,2138
299
- verifiers/v1/runtimes/base.py,sha256=jc5GoDG6oZ7gS7UKnit7zBTZyV00c8J81Mu8bj_e80g,11666
300
- verifiers/v1/runtimes/docker.py,sha256=yYyp8ownr4WqJbjNH5RLFVGZtDdd1_VfqUgd-rqvfog,6971
299
+ verifiers/v1/runtimes/base.py,sha256=VlaQoOqj0-Bj2Q6nBpMtPk8Z_5caXwjdDuHzUJxcDYU,11183
300
+ verifiers/v1/runtimes/docker.py,sha256=c96-HxwuH-aQY_mFYbFTb6TgLInUDuMTgY7z9T6DB3k,7414
301
301
  verifiers/v1/runtimes/limiters.py,sha256=LUcsvyvDkjgdDwMgx4QUduYHHPsgQJ_tgCVCV7L79Hs,2719
302
302
  verifiers/v1/runtimes/modal.py,sha256=a4NghySLu0k_YGqi59OlZdA6AqLYU96KNY2w_FExpTw,8788
303
303
  verifiers/v1/runtimes/prime.py,sha256=vnx9agHjOUxUInL99bTA9wgFAgyRdc59U6iAOmgMJDg,11547
@@ -324,8 +324,8 @@ verifiers/v1/utils/interrupt.py,sha256=F-KKhc5ndPJJfhd3SuMqyqhXhA32FhCRy5KWFJpEo
324
324
  verifiers/v1/utils/logging.py,sha256=OcMHA6NsYux3oIzjPuI95rDWmFBHNcHDjZeNIhXTX-Y,2084
325
325
  verifiers/v1/utils/memory.py,sha256=ZkIvGk6uITAH5sKon65LifKPbvZr8mJ__PVc23FZpOQ,1835
326
326
  verifiers/v1/utils/sampling.py,sha256=JczGzBn6s3wsIrSY2Hy3hE8m6NreNgsNzhSjDikQqX0,1037
327
- verifiers-0.2.1.dev22.dist-info/METADATA,sha256=ceFgWYA8_t864_EsZHqA1OwCTQoVbWX0QyrPS8V9ONw,5136
328
- verifiers-0.2.1.dev22.dist-info/WHEEL,sha256=mffPy8wBnZQn2VnJUU5jE99KsxaSfiyMHV9Yt0aLVxs,87
329
- verifiers-0.2.1.dev22.dist-info/entry_points.txt,sha256=dF82JUYEFslR1AOW8LZfuBWeZeQoyX4wCRrduklg8-I,551
330
- verifiers-0.2.1.dev22.dist-info/licenses/LICENSE,sha256=v0RrUsdV3IDoZhrRce297IXS3xMHNJ-_LdLpFAUWb9k,1072
331
- verifiers-0.2.1.dev22.dist-info/RECORD,,
327
+ verifiers-0.2.1.dev24.dist-info/METADATA,sha256=wdrMNFYferAi7vmgilNIAb9x0QWpri0ZnW8YIJMSClM,5136
328
+ verifiers-0.2.1.dev24.dist-info/WHEEL,sha256=mffPy8wBnZQn2VnJUU5jE99KsxaSfiyMHV9Yt0aLVxs,87
329
+ verifiers-0.2.1.dev24.dist-info/entry_points.txt,sha256=dF82JUYEFslR1AOW8LZfuBWeZeQoyX4wCRrduklg8-I,551
330
+ verifiers-0.2.1.dev24.dist-info/licenses/LICENSE,sha256=v0RrUsdV3IDoZhrRce297IXS3xMHNJ-_LdLpFAUWb9k,1072
331
+ verifiers-0.2.1.dev24.dist-info/RECORD,,