Fast, lightweight AI agents powered by a Rust core
Project description
ferrant Python wrapper
This directory is an optional, thin Python binding around the Rust ferrant
crate. The agent loop, providers, MCP, graph scheduler, persistence, streaming,
and retrieval remain implemented in Rust. Installing this package does not
change the Rust crate or its examples.
pip install ferrant
Then import it directly:
import asyncio
import os
from ferrant import Agent
async def main():
agent = Agent.openai("gpt-5-nano", os.environ["OPENAI_API_KEY"])
print(await agent.run("Explain Rust ownership in one paragraph."))
asyncio.run(main())
For local wrapper development, use maturin develop --release from this
directory. End users do not need Maturin or a Rust toolchain when installing a
prebuilt wheel.
pip install ferrant also installs the ferrant command. Run ferrant init
to create a function-based Python agent, ferrant run to host it locally, and
ferrant deploy to start a new container from ferrant-runner:latest. See
the repository's docs/deployment.md for the deployment contract.
The wheel uses PyO3's stable ABI for Python 3.9+. Rust futures are exposed as
normal asyncio awaitables. Python custom-tool and graph-node callbacks are
synchronous by design; keep expensive execution in Rust tools, MCP servers, or
model calls.
See examples/ for Python counterparts of every top-level Rust example and
matched advanced workflow examples.
Focused Python examples
Run these from the python-wrapper/ directory after installing the package:
python examples/streaming.py
python examples/memory.py
python examples/rag.py
DOCUMENT_PATH=invoice.pdf python examples/document_extraction.py
DOCUMENT_PATH=invoice.pdf python examples/rag_document_extraction.py
streaming.pyprintscontent_deltaevents as the model generates them.memory.pystores a session in.ferrant/sessionsand recalls a prior turn.rag.pypersists a local hybrid vector index, retrieves relevant documents, and provides the matches as grounded agent context.document_extraction.pybase64-encodes a local PDF and asks OpenAI to extract invoice fields. SetDOCUMENT_PATHto a PDF andOPENAI_API_KEYbefore running it.rag_document_extraction.pytranscribes a local PDF with OpenAI, indexes the text locally, retrieves invoice-relevant passages, and returns schema-validated extraction results. SetDOCUMENT_PATHto a PDF.
The exposed surface covers OpenAI-compatible and Anthropic agents, Python tools, MCP-discovered tools, coordinator teams, multimodal input/output, streaming callbacks, schema-validated output, persistent retrieval, and durable workflow graphs with routes, parallel joins, retry/timeout policies, interrupts, resume, and recovery.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ferrant-0.1.15-cp39-abi3-win_amd64.whl.
File metadata
- Download URL: ferrant-0.1.15-cp39-abi3-win_amd64.whl
- Upload date:
- Size: 4.8 MB
- Tags: CPython 3.9+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
34e5b1b42580401938e955ea82f13258613425929e7c6e400c2c27add29be6c4
|
|
| MD5 |
18fe0ae956e132d60186498d3f810dff
|
|
| BLAKE2b-256 |
263cbf064ea1b2958f657f3ad35765917c9c03fc31b3adfb918b1d64004e8f63
|
Provenance
The following attestation bundles were made for ferrant-0.1.15-cp39-abi3-win_amd64.whl:
Publisher:
python-wheels.yml on avinash31d/ferrant
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ferrant-0.1.15-cp39-abi3-win_amd64.whl -
Subject digest:
34e5b1b42580401938e955ea82f13258613425929e7c6e400c2c27add29be6c4 - Sigstore transparency entry: 2148098481
- Sigstore integration time:
-
Permalink:
avinash31d/ferrant@ba73d55499a686ccd21dbac6e4cf8971494ca278 -
Branch / Tag:
refs/tags/python-v0.1.15 - Owner: https://github.com/avinash31d
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-wheels.yml@ba73d55499a686ccd21dbac6e4cf8971494ca278 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ferrant-0.1.15-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: ferrant-0.1.15-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 5.4 MB
- Tags: CPython 3.9+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3c57f1946d776ee69267fda70147944c8e31cb279e48f23abea7ec7a8e7679c1
|
|
| MD5 |
49d75898a19dc54366bea8bff22f1683
|
|
| BLAKE2b-256 |
713cbd7535aa6fb175421b26e36aa086699344a37823314b5bc1ce55c6324008
|
Provenance
The following attestation bundles were made for ferrant-0.1.15-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
python-wheels.yml on avinash31d/ferrant
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ferrant-0.1.15-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
3c57f1946d776ee69267fda70147944c8e31cb279e48f23abea7ec7a8e7679c1 - Sigstore transparency entry: 2148098489
- Sigstore integration time:
-
Permalink:
avinash31d/ferrant@ba73d55499a686ccd21dbac6e4cf8971494ca278 -
Branch / Tag:
refs/tags/python-v0.1.15 - Owner: https://github.com/avinash31d
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-wheels.yml@ba73d55499a686ccd21dbac6e4cf8971494ca278 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ferrant-0.1.15-cp39-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: ferrant-0.1.15-cp39-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 5.0 MB
- Tags: CPython 3.9+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a5cc7b073d012b635b87385e437b6fdf56fcfbf798a27c6f17806579daeed07
|
|
| MD5 |
1aa8b6bb0d56fb3e4e6e54282b2d35df
|
|
| BLAKE2b-256 |
a6972e4df5baca559bdd97aaedc8329bcb993a2c690b91ae68faa93dee235093
|
Provenance
The following attestation bundles were made for ferrant-0.1.15-cp39-abi3-macosx_11_0_arm64.whl:
Publisher:
python-wheels.yml on avinash31d/ferrant
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ferrant-0.1.15-cp39-abi3-macosx_11_0_arm64.whl -
Subject digest:
5a5cc7b073d012b635b87385e437b6fdf56fcfbf798a27c6f17806579daeed07 - Sigstore transparency entry: 2148098476
- Sigstore integration time:
-
Permalink:
avinash31d/ferrant@ba73d55499a686ccd21dbac6e4cf8971494ca278 -
Branch / Tag:
refs/tags/python-v0.1.15 - Owner: https://github.com/avinash31d
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-wheels.yml@ba73d55499a686ccd21dbac6e4cf8971494ca278 -
Trigger Event:
push
-
Statement type: