Skip to main content

Pygent 0.3

Pygent is a PyTorch-like framework for composing LLM agents with no hidden per-call state from reusable Module graphs. Version 0.3 provides a single Execution owner for direct and managed calls, an asyncio Runtime, observable model/tool events, OpenAI-compatible adapters, portable tools and MCP adapters, ReAct, SQLite recovery, and HTTP/SSE workers.

Resource benchmark

Pygent 0.3.10 had the highest composite score among qualifying durable-runtime configurations at both tested loads. It recorded the lowest run time, P95, process-tree CPU, and peak RSS in each table.

Concurrent requests Durable rank Run P95 CPU Peak RSS Disk writes
200 1 of 4 3.828 s 3.758 s 4.906 s 102.2 MB 95.958 MB
1,000 1 of 3 23.070 s 22.603 s 23.453 s 211.1 MB 718.838 MB

This is not an all-metrics win: Pygent wrote 95.958 MB and 718.838 MB, respectively—74.2% and 156.8% more than LangGraph. The benchmark measures framework overhead on Windows with a local OpenAI-compatible mock, not model quality or production capacity, and the durable semantics are not identical. See the full methodology, tables, qualification rules, limitations, and optimization targets.

First principles

Pygent 0.3 第一原则 is the repository's highest authority. Module-specific first principles, SDK contracts, tests, examples, and code derive from it.

Quickstart

from pygent import AIMessage, Context, RecurrentModule, UserMessage


class Echo(RecurrentModule):
    async def forward(self, message, context):
        output = AIMessage(content=message.content.upper())
        return output, context + message + output


message, context = await Echo().invoke(UserMessage(content="hello"), Context())

Direct invoke(), stream(), and start() need no Runtime. Bind a Module to LocalRuntime when its call contract is supported and the application needs bounded concurrency, cancellation, deadlines, remote placement, durable history, or advanced Execution control. This standard recurrent example returns (message, context); ordinary Module inputs and results are user-defined. See the Execution contract.

Install pygent-ai[video] to enable PyAV-backed video inspection and normalization in the standard read tool. The base package does not install PyAV; an independently installed av package or system ffmpeg/ffprobe is detected automatically.

Documentation

Development

uv sync --all-extras
uv run pytest -q
uv run ruff check src tests examples benchmarks
uv run mypy src benchmarks
uv build
python -m examples.service.main
uv run --extra performance python -m benchmarks run synthetic-smoke

Python 3.11+ is required. Apache-2.0; see LICENSE.

Metadata

Release files for pygent-ai 0.3.23

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

Source distribution (sdist)

Source distribution for pygent-ai 0.3.23
File Size Uploaded
pygent_ai-0.3.23.tar.gz 1.0 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for pygent-ai 0.3.23
File
pygent_ai-0.3.23-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details
pygent_ai-0.3.23-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 abi3 Linux glibc 2.17+ x86-64 Details
pygent_ai-0.3.23-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.11 abi3 Linux glibc 2.17+ ARM64 Details
pygent_ai-0.3.23-cp311-abi3-macosx_11_0_arm64.whl CPython 3.11 abi3 macOS 11.0+ ARM64 Details
pygent_ai-0.3.23-cp311-abi3-macosx_10_12_x86_64.whl CPython 3.11 abi3 macOS 10.12+ x86-64 Details

Total release size: 14.1 MB

Release files / pygent_ai-0.3.23.tar.gz

Download URL pygent_ai-0.3.23.tar.gz
Size 1.0 MB
Tags Source
SHA-256 checksum
How to use checksums
78122a067068ea3d1323297213d2a86eeb646c6da1916aedbaa7d107c6cb27a2
BLAKE2b-256 checksum
How to use checksums
232e612d0cadcad53be9565918601993199369878655d60860a95baa7a81e019
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 24, 2026.

Transparency log

Release files / pygent_ai-0.3.23-cp311-abi3-win_amd64.whl

Download URL pygent_ai-0.3.23-cp311-abi3-win_amd64.whl
Size 2.4 MB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
13efce580ed2f8713a433df12c27d54f51e66aad7f33acc79bc79e97bde2aac5
BLAKE2b-256 checksum
How to use checksums
d69f71eafdc095f9cbef9f92f83ed31a08c3382f2be510010fc0b4b80b4b0e5a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 24, 2026.

Transparency log

Release files / pygent_ai-0.3.23-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL pygent_ai-0.3.23-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 2.8 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
b18605784469fe3a9648ff6165d0ba11122e7eaa2c0bf495520472a5043a2e94
BLAKE2b-256 checksum
How to use checksums
64b7c31aeab177f6e6b378ae662f58084618fb92371cbecf2a1cf650c8760988
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 24, 2026.

Transparency log

Release files / pygent_ai-0.3.23-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL pygent_ai-0.3.23-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 2.8 MB
Tags CPython 3.11 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
1790955092fcbe83ed068fd75d3b1c12a401650ef43d25b3675196b1f3a30599
BLAKE2b-256 checksum
How to use checksums
5bf731173a5da4e4ad21b27e6cc606783868b38c46c8dfc8be7eeeb1d0a33472
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 24, 2026.

Transparency log

Release files / pygent_ai-0.3.23-cp311-abi3-macosx_11_0_arm64.whl

Download URL pygent_ai-0.3.23-cp311-abi3-macosx_11_0_arm64.whl
Size 2.5 MB
Tags CPython 3.11 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
eabea5b0d7730d348f82d4ae241677686aeee614c636b6f71afc261f871b4ef4
BLAKE2b-256 checksum
How to use checksums
68aebd200be942e697db0942cf6c5c9b482a841ad2188347e088206c22748465
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 24, 2026.

Transparency log

Release files / pygent_ai-0.3.23-cp311-abi3-macosx_10_12_x86_64.whl

Download URL pygent_ai-0.3.23-cp311-abi3-macosx_10_12_x86_64.whl
Size 2.6 MB
Tags CPython 3.11 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
5a75be85a86d5adf1f6301c15670aa7e9c3c04b35216021b30700da281fbbbd5
BLAKE2b-256 checksum
How to use checksums
63caa15da6292af8f2aeacb83583a8051701f57f0421fda6854dd301595eb990
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 24, 2026.

Transparency log

Release history Release notifications | RSS feed

0.3.26

6 release files

0.3.25

6 release files

0.3.24

6 release files

This release

0.3.23 This release

6 release files

0.3.22

6 release files

0.3.21

6 release files

0.3.20

6 release files

0.3.19

6 release files

0.3.18

6 release files

0.3.17

6 release files

0.3.16

6 release files

0.3.15

6 release files

0.3.14

6 release files

0.3.13

6 release files

0.3.12

6 release files

0.3.11

6 release files

0.3.9

6 release files

0.3.8

6 release files

0.3.7

6 release files

0.3.6

6 release files

0.3.5

6 release files

0.3.4

6 release files

0.3.3

6 release files

0.3.2

6 release files

0.3.1

6 release files

0.3.0

6 release files

0.2.21

6 release files

0.2.20

6 release files

0.2.19

6 release files

0.2.18

6 release files

0.2.17

6 release files

0.2.16

6 release files

0.2.15

6 release files

0.2.14

6 release files

0.2.13

6 release files

0.2.12

6 release files

0.2.11

6 release files

0.2.10

2 release files

0.2.9

2 release files

0.2.8

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.15

2 release files

0.1.14

2 release files

0.1.11

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

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