verifiers 0.2.2.dev61__py3-none-any.whl → 0.2.2.dev62__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.
@@ -23,7 +23,6 @@ from verifiers.v1.runtimes import (
23
23
  NetworkPolicyConfig,
24
24
  Runtime,
25
25
  make_runtime,
26
- runtime_is_local,
27
26
  )
28
27
  from verifiers.v1.runtimes.base import _ENSURE_UV
29
28
 
@@ -248,6 +247,7 @@ async def serve(
248
247
  *,
249
248
  state_secret: str = "",
250
249
  state_base: str | None = None,
250
+ runtime: Runtime | None = None,
251
251
  ):
252
252
  cfg = server.config
253
253
  colocated = getattr(cfg, "colocated", False)
@@ -268,7 +268,7 @@ async def serve(
268
268
  if colocated and harness_runtime is not None:
269
269
  runtime = harness_runtime
270
270
  else:
271
- runtime = make_runtime(cfg.runtime)
271
+ runtime = runtime or make_runtime(cfg.runtime)
272
272
  await runtime.start()
273
273
  stack.push_async_callback(runtime.stop)
274
274
  # Only consumers outside the server runtime need its fixed published port. Colocated tools
@@ -315,7 +315,8 @@ class SharedToolServer:
315
315
  """One live taskset-scoped (shared) server, as the rollouts see it: its eval-level
316
316
  `url` plus whether its runtime is `local` (host-reachable) — a remote one is an
317
317
  interception consumer, so the interception must be exposed for it to reach the
318
- `/state` channel (see `Env._requires_tunnel`). An `external` server (a
318
+ `/state` channel (see `Env._requires_tunnel`). `runtime` is retained for translating
319
+ that channel into the server's network. An `external` server (a
319
320
  config-`url` endpoint) was not launched by the framework and sits outside its state
320
321
  machinery entirely: rollouts get its URL bare — no state tag (and no per-rollout
321
322
  secret sent to a third party)."""
@@ -323,6 +324,7 @@ class SharedToolServer:
323
324
  url: str
324
325
  local: bool
325
326
  external: bool = False
327
+ runtime: Runtime | None = None
326
328
 
327
329
 
328
330
  @contextlib.asynccontextmanager
@@ -359,11 +361,18 @@ async def serve_shared(toolsets: list[Toolset], harness_is_local: bool = True):
359
361
  url=cfg.url, local=False, external=True
360
362
  )
361
363
  else:
364
+ runtime = make_runtime(cfg.runtime)
362
365
  url = await stack.enter_async_context(
363
- serve(toolset, harness_is_local=harness_is_local)
366
+ serve(
367
+ toolset,
368
+ harness_is_local=harness_is_local,
369
+ runtime=runtime,
370
+ )
364
371
  )
365
372
  servers[name] = SharedToolServer(
366
- url=url, local=runtime_is_local(cfg.runtime)
373
+ url=url,
374
+ local=runtime.is_local,
375
+ runtime=runtime,
367
376
  )
368
377
  logger.info("shared tool server '%s': %s", name, servers[name].url)
369
378
  yield servers
@@ -395,8 +404,8 @@ async def serve_tools(
395
404
  taskset-scoped `shared` servers — already
396
405
  running eval-level (see `serve_shared`) — join under their per-rollout state tag.
397
406
  `state_base`/`state_secret` wire each server to the interception server's shared-state
398
- channel — `state_base` is universally reachable, so every server (per-rollout or
399
- `shared`, any runtime) uses it directly."""
407
+ channel. Each launched server translates the host-local base for its own runtime;
408
+ external servers stay untagged."""
400
409
  urls: dict[str, str] = {}
401
410
  async with contextlib.AsyncExitStack() as stack:
402
411
  for name, server in (shared or {}).items():
@@ -408,7 +417,12 @@ async def serve_tools(
408
417
  logger.info("tool server '%s' (shared, external): %s", name, server.url)
409
418
  continue
410
419
  url = harness_runtime.host_url(server.url) if server.local else server.url
411
- urls[name] = _shared_url_for_rollout(url, state_base, state_secret)
420
+ shared_state_base = (
421
+ server.runtime.host_url(state_base.rstrip("/"))
422
+ if server.runtime is not None and state_base
423
+ else state_base
424
+ )
425
+ urls[name] = _shared_url_for_rollout(url, shared_state_base, state_secret)
412
426
  # The tagged URL contains the bearer secret; log only the untagged base URL.
413
427
  logger.info("tool server '%s' (shared): %s", name, server.url)
414
428
  for toolset in toolsets:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: verifiers
3
- Version: 0.2.2.dev61
3
+ Version: 0.2.2.dev62
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
@@ -299,7 +299,7 @@ verifiers/v1/judges/reference.txt,sha256=Ej35kGXiT2uJ0LcHIeez49rCS_9uHmCQKoVdn93
299
299
  verifiers/v1/judges/rubric.py,sha256=PglrJhMQR6scFyfz20jVlLQEzeqXKV2P6r0K0K7jjBE,11916
300
300
  verifiers/v1/judges/rubric.txt,sha256=3KA2ZeYYdcDweJhUGopxu9EFgARhu2aWft5S5cj8Bc8,323
301
301
  verifiers/v1/mcp/__init__.py,sha256=pm8ZWBiL1q1tY4wHvJzM_QrZ9oR8aGm-bIRWiRJsgHI,408
302
- verifiers/v1/mcp/launch.py,sha256=KtRr59FMQkp4_m8ImUw-pIrxMUbDXd1RvzLJXw_HQ3Q,18452
302
+ verifiers/v1/mcp/launch.py,sha256=aPAsAGDjI6CWKs1edLpfcOL-TVzDoQto3v_gkCWb5bY,19005
303
303
  verifiers/v1/mcp/server.py,sha256=zS3-m-0IX3z8nVzUhQj391f8_OieE1nKr5S4Nj0dSSU,10987
304
304
  verifiers/v1/mcp/toolset.py,sha256=tSPXgTNREZyaeCnoFVnDfXxFAj_pStZMPUIgyPrY_Dk,996
305
305
  verifiers/v1/runtimes/__init__.py,sha256=TqNtJVahzQuLS4fgCVeT9xdOzTkp0hRAPOkl7eFVDUg,2011
@@ -338,8 +338,8 @@ verifiers/v1/utils/logging.py,sha256=OcMHA6NsYux3oIzjPuI95rDWmFBHNcHDjZeNIhXTX-Y
338
338
  verifiers/v1/utils/memory.py,sha256=ZkIvGk6uITAH5sKon65LifKPbvZr8mJ__PVc23FZpOQ,1835
339
339
  verifiers/v1/utils/sampling.py,sha256=52TJ5-Hmpvp4YSgKNR-LmAPVwm4RDcH-o2-BnbVTmYQ,965
340
340
  verifiers/v1/utils/version.py,sha256=-obEo_-l9-D8FLef4hYxncOe-uJpxrM1g2Hig_37Sgs,1607
341
- verifiers-0.2.2.dev61.dist-info/METADATA,sha256=vuxmOQykOIiG0GzqOXC2Xm7lC8DGx5EqMqFcjpgt1As,4545
342
- verifiers-0.2.2.dev61.dist-info/WHEEL,sha256=lCkmxWfQsSc9CfIClYeavTdQeEX2toPqufh9gI35EQA,87
343
- verifiers-0.2.2.dev61.dist-info/entry_points.txt,sha256=dF82JUYEFslR1AOW8LZfuBWeZeQoyX4wCRrduklg8-I,551
344
- verifiers-0.2.2.dev61.dist-info/licenses/LICENSE,sha256=v0RrUsdV3IDoZhrRce297IXS3xMHNJ-_LdLpFAUWb9k,1072
345
- verifiers-0.2.2.dev61.dist-info/RECORD,,
341
+ verifiers-0.2.2.dev62.dist-info/METADATA,sha256=xHKY48MkwB4NJxyK3Xv827da-JG9X1PcR2DgBjYXiHI,4545
342
+ verifiers-0.2.2.dev62.dist-info/WHEEL,sha256=lCkmxWfQsSc9CfIClYeavTdQeEX2toPqufh9gI35EQA,87
343
+ verifiers-0.2.2.dev62.dist-info/entry_points.txt,sha256=dF82JUYEFslR1AOW8LZfuBWeZeQoyX4wCRrduklg8-I,551
344
+ verifiers-0.2.2.dev62.dist-info/licenses/LICENSE,sha256=v0RrUsdV3IDoZhrRce297IXS3xMHNJ-_LdLpFAUWb9k,1072
345
+ verifiers-0.2.2.dev62.dist-info/RECORD,,