Metadata-Version: 2.1
Name: brevi
Version: 0.25.0
Summary: Compiles the plain Python AI agents write into fast native binaries via Rust, with one-line JSON errors and an MCP server.
Keywords: python,compiler,rust,mcp,ai-agents,llm,native,brevi
License: Apache-2.0
Project-URL: Homepage, https://brevi-lang.org
Project-URL: Documentation, https://brevi-lang.org/docs/
Project-URL: Source, https://github.com/ets-public/brevi
Project-URL: Issues, https://github.com/ets-public/brevi/issues
Project-URL: Changelog, https://github.com/ets-public/brevi/blob/main/CHANGELOG.md
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Rust
Classifier: Topic :: Software Development :: Compilers
Requires-Python: >=3.8
Description-Content-Type: text/markdown

# Brevi: fast, safe native builds of AI-written Python

Brevi is a compiler built for AI coding agents. The agent writes the plain Python it already writes best; Brevi builds it through Rust into a native binary that prints exactly what CPython prints and runs 1.7x to 40x faster with the default build. Anything it cannot build comes back as one short JSON line the agent can act on.

```
pip install brevi        # or run it without installing: uvx brevi mcp
```

```
$ printf 'print(sum(i * i for i in range(10)))\n' > main.py
$ brevi run main.py                     # build natively (cached), then run
285
$ brevi check main.py                   # build without running: errors only
$ brevi build main.py -o app --release  # an optimised binary to keep or ship
$ brevi mcp                             # MCP server for agents: check, run, test, patch, edit, show, guide
```

A sure mistake is reported before anything runs, as one line with a fix:

```
{"line":8,"msg":"name 'totl' is not defined","fix":"did you mean total?"}
```

Brevi compiles through `rustc`, so a Rust toolchain must be on the PATH ([rustup.rs](https://rustup.rs)).

- **For agents:** add the MCP server as the command `brevi` with the argument `mcp` (Claude Code: `claude mcp add brevi -- brevi mcp`). Its tools sandbox by default. [For AI agents](https://brevi-lang.org/docs/agents)
- **Same answers as CPython:** every saved agent program and large test program matches CPython's output and exit status. Imports of installed packages (numpy, pandas, requests, ...) work; most numpy code builds natively.
- **Public preview:** Brevi works today and is tested against CPython on every change, but expect the CLI to change between releases.

[Docs](https://brevi-lang.org/docs/) · [Source](https://github.com/ets-public/brevi) · [Changelog](https://github.com/ets-public/brevi/blob/main/CHANGELOG.md) · [Issues](https://github.com/ets-public/brevi/issues) · Apache-2.0

<!-- Lets the MCP registry confirm this package belongs to the server io.github.ets-public/brevi. -->
mcp-name: io.github.ets-public/brevi
