Skip to main content

sefia

Stateless Engraved Function Inference Abstraction

sefia turns typed Python functions into durable, replayable LLM-backed calls. An @infer function is an abstract method whose implementer is an LLM: the signature is the input contract, the return type is the validated output contract, the docstring is the instruction, and the body is ....

import glyff
from pydantic import BaseModel
from sefia import Domain


class Summary(BaseModel):
    key_points: list[str]
    uncertainty: str


infer = Domain(glyff.Domain("com.example.summaries", version="1")).infer

@infer
async def summarize(article: str) -> Summary:
    """Summarize the article for a technical audience; note key uncertainty."""
    ...

Because model and tool steps replay on re-invocation, a call can pause, resume after a restart, and drive human-in-the-loop flows over ordinary request/response handlers — with no workflow engine or graph DSL.

Install

pip install sefia

sefia is the core framework: decorators, session, profiles, and the tool system. It is model-provider-agnostic; to talk to an actual LLM provider, add an adapter such as sefia-litellm, or install the batteries-included stack sefios.

Documentation

See the repository for the full README, tutorial, and architecture docs.

Status

Early development. APIs may change before v1.0.

License

MIT

Release files for sefia 0.6.0

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

Source distribution (sdist)

Source distribution for sefia 0.6.0
File Size Uploaded
sefia-0.6.0.tar.gz 108.4 kB Details

Built distribution (wheel)

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

Total release size: 190.3 kB

Release files / sefia-0.6.0.tar.gz

Download URL sefia-0.6.0.tar.gz
Size 108.4 kB
Tags Source
SHA-256 checksum
How to use checksums
4eb00c9fd286a9b40aa7456d54888355e550d6dcd4eb1adcaae1044e7482b9a6
BLAKE2b-256 checksum
How to use checksums
ec5d8f230d8b8ad51fc391b2d3eeb2c6838f8e497b2e1b93a2bce6ed7d96ade8
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 25, 2026.

Transparency log

Release files / sefia-0.6.0-py3-none-any.whl

Download URL sefia-0.6.0-py3-none-any.whl
Size 81.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
79fe4b890000d9f00717745e0f3b21cc37a28c257de5ba72497ebafa3c446389
BLAKE2b-256 checksum
How to use checksums
f33e03ca7fb876bbdddeff4960a998a0dc9a42895bf538a584eb4bba608166ee
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 25, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.6.0 This release

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.1

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