Skip to content
The SDK

One contract for every RL environment.

The Python SDK and CLI behind Nenyax. Load any format, drive it with any model or policy, judge it your way, and improve it with any learner.

Python 3.11 to 3.13 · macOS and Linux · Free to start
01Any formatsix SDKs, six shapes02One contractManifest · Trajectory · Judgment03Same trajectorywhatever went in
Why one contract

RL environments are scattered. Your code shouldn't be.

Many SDKs

Gymnasium, OpenEnv, Verifiers, NeMo Gym, Harbor, reasoning-gym: each with its own API, and each trainer supports only a few.

One shape

Manifest, Capabilities, Trajectory and Judgment look the same whatever the source format.

One call

env.rollout(policy) works whether the environment steps, runs its own loop, or is a graded task.

Three modes

Who drives the loop decides the mode.

Nenyax doesn't replace these frameworks or define another format. It routes each native format into one contract, and every format maps to exactly one mode.

  • stepYou drive it with session() → act(). Gymnasium, OpenEnv, reasoning-gym, NeMo Gym, ORS, HF datasets.
  • rolloutIts own evaluation loop drives your model. Verifiers, lm-evaluation-harness.
  • taskA harness runs and grades it. Harbor, Karotte, AgentEnv, HUD.

Every format, one of three modesenv.rollout(policy) works in all three

stepyou drive it: session() → act()
rolloutits own eval loop drives your model
taska harness runs and grades it
Python

Load, define, judge, train.

The same Endpoint drives every environment and returns the same Trajectory. Every model call is recorded, with token ids and logprobs when the server returns them.

rollout.py
import nenyax
model = nenyax.Endpoint("http://localhost:8000/v1", "Qwen/Qwen3-8B") # any OpenAI-compatible server
for uri in [
"reasoning_gym:basic_arithmetic?size=100", # reasoning-gym
"verifiers:gsm8k", # Prime Intellect Environments Hub
"nemo_gym:http://localhost:8001?data=tasks.jsonl", # NVIDIA NeMo Gym
"openenv:https://openenv-openspiel-env.hf.space", # OpenEnv / Hugging Face Spaces
"harbor:./terminal-bench/fix-git", # Harbor / Terminal-Bench
]:
env = nenyax.load(uri)
traj = env.rollout(model) # same call, same Trajectory, every format
print(env.manifest.source_format, traj.score, len(traj.model_calls))
Conformance

Measured, not claimed.

nenyax check runs an environment and records the highest tier it actually reaches. A check that can't run is skipped, and a skip blocks its tier.

  • ConnectableIt loads, the manifest is valid, and an episode can start.
  • EvaluableA full episode completes with a finite judgment.
  • TrainableA seed or stable task id recreates the situation, and the model path is recorded.
  • AuditedThe verifier discriminates: a reference policy beats a null policy on every sampled task.

nenyax checkreasoning_gym:basic_arithmetic

Connectableloads, an episode can start
Evaluablea full episode completes
Trainableseeded and recorded
Auditedthe verifier discriminates
Verified formats

Run end to end, not assumed.

Every row was run by the integration suite, a real-model experiment, or both.

ModeHighest tierNotes
reasoning_gymreasoning-gym 0.1.25stepaudited106 procedural datasets, native verifiers
gymnasiumGymnasium 1.3steptrainableno oracle exists, so no audit
openenvOpenEnv 0.6stepevaluable / trainableevaluable on public Spaces, trainable on seeded servers
nemo_gymNeMo Gym 0.6stepauditedmcqa and reasoning_gym resources servers, over HTTP
verifiersVerifiers 0.3.1rolloutauditedlegacy and v1 tasksets; Environments Hub gsm8k
harborHarbor 0.23taskauditedterminus-2 wraps any chat model; oracle/nop audit the tests
Learners

Improve with any learner.

A learner is anything with policy() and update(groups). The built-ins cover in-context learning for closed APIs and weight updates for open models.

  • incontextCurates worked examples from the model's own best episodes. No weight changes, so it works with closed APIs.
  • grpo, dapo, rloo, gspo, rft, dpo and moreWeight updates for local open models on CUDA, MPS or CPU. Verified for correctness, still experimental at scale.
  • tinker, or yoursHosted LoRA on Thinking Machines Tinker, or your own class by entry point.
How training works

Each round kept only if it improvesGRPO · held-out

r1
r2
r3
r4
r5
r6

Round 4 was worse, so it was reverted0.71

Serve and export

Take it anywhere.

Serve anything as OpenEnv. Any step-mode environment becomes a standard OpenEnv server (/ws, /reset, /step, /schema), so OpenEnv clients and the trainers built on them use it unchanged. The episode's judgment rides along in the final observation's metadata.

Export what you record. Trajectories export as JSONL, Parquet or Hugging Face datasets, as raw, SFT or DPO rows, and traces go out over OpenTelemetry's GenAI conventions to Langfuse, Phoenix, MLflow or Weights & Biases.

Plugins

Seven kinds, one interface each.

Scaffold a plugin that passes its conformance test on day one, then use it by name in any config.

  • Scaffoldnenyax new-plugin sandbox acme
  • Checknenyax sandbox-check acme proves a backend delivers what it claims.
  • UsePick it by name: use = "acme".

Plugin kindsone interface each

driver sandbox provider hub learner judge telemetry

nenyax new-plugin sandbox acme

CLI

Everything from the terminal.

zsh
nenyax drivers # what is installed
nenyax info <uri> # manifest
nenyax check <uri> # conformance tier
nenyax try <uri> --provider ollama --model qwen3
nenyax train <uri> --learner incontext --provider vllm --model M
nenyax serve <uri> --port 8000 # expose as OpenEnv
nenyax search harbor terminal-bench # find environments on huggingface / prime / harbor
Get started

From install to a checked environment.

1

Install

Install the Nenyax CLI from your workspace.

2

Check

See what an environment really does.

nenyax check <uri>
3

Try

One episode with your model, readable replay.

nenyax try <uri>
4

Train

Pick a learner and a provider.

nenyax train <uri>
Questions

Good to know.

Nenyax is free to start, and the SDK and CLI come with it; install them from your workspace. See pricing.

Install the SDK.

Load your first environment, check its tier, and run it with your model.