monty
A minimal, secure Python interpreter written in Rust for use by AI
Integrate Monty with Python using PyO3 to leverage a sandboxed Rust interpreter. Explore this comprehensive guide for seamless integration and enhanced performance.
How to Define and Register Custom External Functions in Monty: A Complete GuideLearn how to define and register custom external functions in Monty with this complete guide. Enhance your Monty workflows by easily integrating your own Python implementations.
Python Types Supported in Monty: A Complete Guide to the Pydantic Sandbox RuntimeExplore Python types supported in Monty. Discover primitives, containers, callables, and standard library types within Pydantic's sandbox runtime for robust data handling.
How Iterative Execution Works in Monty: A Complete Guide to Sandboxed Async PythonDiscover how iterative execution in Monty enables sandboxed async Python. Learn how Monty pauses at external calls and futures, serializes VM state, and resumes execution for seamless integration.
How Monty Captures stdout and stderr from Executed Python CodeDiscover how Monty captures stdout and stderr from executed Python code by replacing standard stream objects and using a configurable PrintWriter for flexible output handling.
Built-in Functions Available in Monty: Complete Guide to the Rust Python InterpreterExplore Monty's 35 Rust compiled built-in functions like print len and sum for efficient VM dispatch. Get the complete guide to the Rust Python interpreter.
How Monty Tracks Memory Allocations in Python ObjectsDiscover how Monty tracks memory allocations in Python using a cooperative Heap arena and pluggable ResourceTracker to record statistics and enforce limits.
How Monty Limits Stack Depth: Function Calls and Data Structure RecursionDiscover how Monty limits stack depth using ResourceTracker for function calls and DepthGuard for container operations, preventing recursion errors.
Python Features Not Supported in Monty: A Complete Guide to Sandbox LimitationsExplore Python features unsupported in the pydantic Monty sandbox. Understand security limitations including class definitions, pattern matching, and generators.
How to Use Monty from JavaScript/TypeScript with napi-rsIntegrate Monty the sandboxed Python interpreter into your JavaScript/TypeScript projects with napi-rs. Install the @pydantic/monty package for seamless Rust-based Python execution.
Monty Performance Comparison to CPython: Startup Latency and Execution Speed AnalysisDiscover the Monty performance comparison to CPython. Analyze microsecond cold-start latency and execution speeds 0.5x to 5x faster than CPython for high-frequency Python execution.
How Monty's Built-in Type Checking Works: A Deep Dive into the Rust ImplementationExplore Monty's type checking implementation. Learn how it uses Ruff's ty crates and a Salsa database for efficient Python code analysis across interfaces.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →