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.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| sefia-0.5.0.tar.gz | 92.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sefia-0.5.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 170.8 kB
Release files / sefia-0.5.0.tar.gz
| Download URL | sefia-0.5.0.tar.gz |
|---|---|
| Size | 92.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
87efd3257054f1b9e0aa5edca25007937b92e4f1b8a41b4819a832afa765d838
|
|
BLAKE2b-256 checksum How to use checksums |
53f9e7845416a5b2cbdfa58bfc3b10ee7fe778d0b5042c959ea715740f7afd77
|
| 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 19, 2026.
Transparency logRelease files / sefia-0.5.0-py3-none-any.whl
| Download URL | sefia-0.5.0-py3-none-any.whl |
|---|---|
| Size | 78.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
92cf82002737df201f3650067ddc0692ee3f6d573d5c89f404989fe398b996f0
|
|
BLAKE2b-256 checksum How to use checksums |
b54f262a6d20e7cc2b90a915c810a97fcfba8276516f5b713045c072294965fc
|
| 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 19, 2026.
Transparency log