Skip to content

Add the verifier HTTP server#2

Open
AbdelStark wants to merge 1 commit into
get-wrecked:mainfrom
AbdelStark:feat/verifier-http-server
Open

Add the verifier HTTP server#2
AbdelStark wants to merge 1 commit into
get-wrecked:mainfrom
AbdelStark:feat/verifier-http-server

Conversation

@AbdelStark
Copy link
Copy Markdown

What changed

This adds the verifier HTTP server described in the architecture docs.

The PR includes:

  • an Axum/Tokio server with GET /health, GET /stats, POST /verify, and POST /verify/batch
  • a typed request/response contract for verifier calls
  • a runtime router over the existing Rust verifiers
  • a small Python client for the server API
  • VerifierClient(rust_server_url=...) support in the Python training harness, with local fallback when the server is unavailable or a backend is not supported by the Rust route yet
  • server contract tests for health, single verification, and ordered batch verification
  • a README quick start for running the server and making a verification request

Why

The repository already describes the Rust verifier server as the boundary between the Python GRPO loop and deterministic reward functions, and the Python harness already accepted a rust_server_url. The executable crate did not expose that service yet; it only printed a test hint.

This makes that boundary real. A training loop can now call a long-lived verifier process over HTTP, batch verification requests, and keep Python as the orchestration layer instead of the only verification path.

Behavior notes

  • domain stays as the caller-facing domain name in the response.
  • verifier is optional. When it is present, the router uses it to select the backend; this lets callers keep domain names like gsm8k while routing through math_numerical.
  • Unsupported verifier names return a normal score payload with score: 0.0 and a reason, which keeps batch responses ordered and easy to consume.
  • The Python harness only sends backends with implemented Rust routes to the server. Other backends keep using the existing local fallback path.

Validation

  • cargo test
  • cargo clippy --all-targets -- -D warnings
  • python3 -m compileall -q python/rlvr
  • live server smoke test with cargo run -- --addr 127.0.0.1:18080
  • curl http://127.0.0.1:18080/health returned {"status":"ok","verifiers":16}
  • Python client smoke test covered both single verification and ordered batch verification

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant