Skip to main content

Plural

Build the environment. Write the tasks. Benchmark and train agents on your real work.

PyPI Python CI License

Quickstart · Docs · Tutorial · Examples · pluralintel.com


Plural is a Python SDK and CLI for turning the systems your agents work with into environments, writing tasks in them, and finding out which model or agent does that work best, with the evidence behind every score.

  • Any system becomes an environment. Wrap a Python class, an MCP server, an OpenAPI service, or a recorded trace as an App. The agent sees only what its actions return.
  • Grade what happened, not what the agent claims. Verifiers read the App's hidden State after the episode, and can reward every step for training.
  • Reproducible by default. Every run pins each input by content hash, so plural job rerun repeats it exactly.
  • Runs where you need it. On your machine, in Docker, or in cloud sandboxes, with any model in the catalog, Claude Code, Codex, or your own harness.
  • Benchmarks and training from one setup. The same Task feeds a leaderboard and an RL loop, and several agents can share one Task to cooperate or compete.

Install

pip install "plural[mcp]"

Python 3.10 or newer. Model calls go through the Plural gateway, so a live run needs an API key from pluralintel.com: plural auth login.

Try it in 30 seconds

The support queue example has a scripted Agent, so it runs offline with no account:

git clone --depth 1 https://github.com/lastlabs-ai/plural && cd plural/examples/first-project
plural run --benchmark support-triage --agent scripted
Running benchmark/support-triage with scripted (openai/gpt-5.6-luna) locally: 3 Trials, 3 at a time (auto: every Trial at once).
  [1/3] trl_e346797c26bf78918a0ccd64  ticket-3  succeeded  score=1.000  | 1 succeeded, 0 failed, mean 1.000
  [2/3] trl_eabb98d92a791437296f8a41  ticket-2  succeeded  score=1.000  | 2 succeeded, 0 failed, mean 1.000
  [3/3] trl_d180e73c8fa30bc6cae755b5  ticket-1  succeeded  score=1.000  | 3 succeeded, 0 failed, mean 1.000
Job job_e7bbd52f5a400c1409488cef succeeded.
  scripted: mean score 1.000 over 3 Trials, 3 succeeded, coverage 100%

plural job show <job-id> lists each Trial, and plural trial show <trial-id> shows the Verifier's evidence and the full record.

Build your own

From the command line, a project is a folder of small, versioned resources:

plural project init my-eval && cd my-eval
plural env init support-desk                     # an Environment, a starter Task, a Verifier
plural run --task support-desk-first --model openai/gpt-5.6-luna

Or in Python. An App is a class whose actions are the agent's tools:

# wordle.py
from plural import App, Environment, Runtime, State, action, initial

class Game(State):
    secret: str = initial("", description="The hidden word.")
    guesses: int = 0
    solved: bool = False

class Wordle(App[Game]):
    """Guess a hidden five-letter word."""

    @action
    def guess(self, word: str) -> str:
        """Guess a word. + is right, ? is elsewhere, - is absent."""
        secret = self.state.secret
        self.state.guesses += 1
        self.state.solved = word == secret
        return " ".join("+" if a == b else "?" if a in secret else "-" for a, b in zip(word, secret))

    def terminated(self) -> bool:
        return self.state.solved or self.state.guesses >= 6

environment = Environment(name="wordle", apps=[Wordle()], runtime=Runtime.local())

A Task sets the hidden State, and a Verifier, kept in its own file so the agent can't read it, scores the result:

# run.py
from plural import Agent, DeterministicVerifier, Episode, Job, Task, VerifierOutput
from wordle import environment

def solved(episode: Episode) -> VerifierOutput:
    return VerifierOutput(score=float(episode.state["solved"]))

task = Task(
    name="crane",
    instructions="Find the hidden five-letter word.",
    environment=environment,
    initial_state={"secret": "crane"},
    verifiers=[DeterministicVerifier(name="solved", check=solved)],
)
result = Job(task, agents=[Agent(model="openai/gpt-5.6-luna")]).run()  # after plural auth login
print(result.aggregates[0].mean_score)

For a training loop, step the same Environment yourself, Gym-style:

observation, info = environment.reset(initial_state={"secret": "crane"}, seed=0)
observation, reward, terminated, truncated, info = environment.step("guess", word="trace")
# {'text': '- + + ? +'} 0.0 False False

The vocabulary

App One system the agent works with. Its actions are the agent's tools; its State stays hidden.
Environment Apps, plus where they run and the episode's limits.
Task One assignment in an Environment, with its starting State.
Verifier The grader: check scores the finished episode; reward credits each step.
Agent A model, its instructions, and the harness that drives it.
Benchmark A versioned set of Tasks and the rules for ranking results.
Job / Trial A run of Agents on a Task or Benchmark / one attempt, with its full record.

See it in the web app

Connect a folder to a private hosted project once, then add --record to any run to watch its Trials, trajectories, and costs in pluralintel.com. Every Job still runs from your machine, and pushing never makes anything public.

plural project init my-eval --push
plural run --task support-desk-first --model openai/gpt-5.6-luna --record

Learn more

Development

uv sync --group dev --group docs
uv run ruff check . && uv run mypy src
uv run pytest tests/unit tests/contract
uv run python scripts/check_docs.py

License

Apache-2.0

Metadata

Release files for plural 0.23.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for plural 0.23.1
File Size Uploaded Provenance Actions
plural-0.23.1.tar.gz 1.2 MB With provenance Details for plural-0.23.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for plural 0.23.1
File Interpreter ABI Platform Actions
plural-0.23.1-py3-none-any.whl Python 3 none any Details for plural-0.23.1-py3-none-any.whl

Total release size: 1.8 MB

Release files / plural-0.23.1.tar.gz

Download URL plural-0.23.1.tar.gz
Size 1.2 MB
Tags Source
SHA-256 checksum
How to use checksums
e5871dc3df0c8d81e59cd8a8154a4ee7c0c5de46eff3e68af45b348cebdf3818
BLAKE2b-256 checksum
How to use checksums
b294cdf847f9fa734f1f6c58b44d4ca9ee03e0346d2e4cc2d8813476634c7f17
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.

Transparency log

Release files / plural-0.23.1-py3-none-any.whl

Download URL plural-0.23.1-py3-none-any.whl
Size 696.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
036f45a189af8bd0d5ca626e8912419ac340a9a9a600ae2fa5acab0a41448c29
BLAKE2b-256 checksum
How to use checksums
bafde3f62533eefb2de3be39051d3582db6ffa019171d9ca16ae551e30099548
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.

Transparency log

Security for plural 0.23.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for plural-0.23.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.23.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page