Skip to main content

Alloygent

A typed Python library for building agent workflows from plain functions.

Install

pip install alloygent

Development

uv sync
uv run ruff check .
uv build

Usage

from alloygent import Agent, Context, Model, ModelResponse, tool


class EchoModel(Model):
    def _call(self, messages: list[Context], tools=None, **params) -> ModelResponse:
        last_message = messages[-1].content
        return ModelResponse(message=f"Echo: {last_message}")


@tool()
def add(a: int, b: int) -> int:
    """Add two numbers."""
    return a + b


agent = Agent(model=EchoModel("echo"), tools=[add])
result = agent.run("hello")
print(result.message)

Publishing

Build and publish from your laptop with a PyPI API token:

uv build
uv publish --token "pypi-..."

The GitHub workflow builds release distributions for tags and manual runs, but does not upload to PyPI.

Release files for alloygent 0.1.1

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

Source distribution (sdist)

Source distribution for alloygent 0.1.1
File Size Uploaded
alloygent-0.1.1.tar.gz 4.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for alloygent 0.1.1
File Interpreter ABI Platform
alloygent-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 11.2 kB

Release files / alloygent-0.1.1.tar.gz

Download URL alloygent-0.1.1.tar.gz
Size 4.7 kB
Tags Source
SHA-256 checksum
How to use checksums
ed772063b61af8dc90933e116cc87b7370e37f0f3c6c21783fce8de2d40e38ed
BLAKE2b-256 checksum
How to use checksums
df611f2e8a7f3576cc3bbaff30af370a72395f8575da3feba7cf2592151a7cdc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.30 {"installer":{"name":"uv","version":"0.11.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / alloygent-0.1.1-py3-none-any.whl

Download URL alloygent-0.1.1-py3-none-any.whl
Size 6.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1a7d07e4ab019a8cf8716a837e6c4e3f40e2d60a02edbd9be8574ce024c7215e
BLAKE2b-256 checksum
How to use checksums
031075d3bb882994253890ca64ace46367672618767647b046a99a8a2e582b07
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.30 {"installer":{"name":"uv","version":"0.11.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

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