Started Dec 1RustMIT license

pydantic/monty

A secure Python sandbox, written in Rust, for code written by AI.

github.com/pydantic/monty

Leaderboard

21 participants
Rank 1@mevlanayalcin×1.947 subsLast submission 4 h ago
Rank 2@danielchin×1.431 subLast submission 2 h ago
Rank 3@ammonwk×1.224 subsLast submission 1 h ago

Start the project

~/xmas/monty/startCodSpeedHQ/codspeed 395

The case for a faster monty

~/xmas/monty/why

AI agents write code and run it at many steps of a task, so they run it often. A Monty sandbox starts in under 1 ms, against about 1.5 s for a container service, which leaves the interpreter's own speed as the time an agent waits: every speedup here shortens every step.

What to make faster

~/xmas/monty/targets

Your speedup counts every frozen benchmark. Here is what each suite measures.

  1. crates/monty-bench/benches/main.rs mainInterpreter speed: runs 35 Python scripts inside Monty (data processing with JSON, CSV, regex and strings, a few pyperformance programs, file walking), plus parsing, the REPL and session save and restore.
  2. crates/monty-bench/benches/decode.rs decodeDecoding speed of the frames a worker sends back to the host: 4 MiB of row dicts and 4 MiB of shared nested lists.
  3. crates/monty-bench/benches/pool.rs poolCost of running code in an isolated worker process: spawning a worker, checking out a session, and round-tripping external calls and rows over the wire.

How it is measured

~/xmas/monty/measure

CodSpeed runs the frozen benchmarks on every submission and measures walltime on CodSpeed Macro Runners Gen 2 ↗. Your score is the speedup of your best submission.