Define LLM-powered steps as typed async Python functions.
Project description
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 ....
from pydantic import BaseModel
from sefia import infer
class Summary(BaseModel):
key_points: list[str]
uncertainty: str
@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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
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 sefia-0.1.0.tar.gz.
File metadata
- Download URL: sefia-0.1.0.tar.gz
- Upload date:
- Size: 72.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d25708bf5f2f7318ee151d8c591192a7c6f516c289d8da8ed8015ab9ac676c66
|
|
| MD5 |
11489e4cd5f6100796b1ccd3d784f1ee
|
|
| BLAKE2b-256 |
e64354e1270f2b51642a31903007f433a526387658adbd00b371000652b67ada
|
Provenance
The following attestation bundles were made for sefia-0.1.0.tar.gz:
Publisher:
publish-sefia.yml on nueruyu/sefia
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sefia-0.1.0.tar.gz -
Subject digest:
d25708bf5f2f7318ee151d8c591192a7c6f516c289d8da8ed8015ab9ac676c66 - Sigstore transparency entry: 2195684870
- Sigstore integration time:
-
Permalink:
nueruyu/sefia@4630f39225f6cc3d08c648a62cdb912dda5cae47 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/nueruyu
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-sefia.yml@4630f39225f6cc3d08c648a62cdb912dda5cae47 -
Trigger Event:
push
-
Statement type:
File details
Details for the file sefia-0.1.0-py3-none-any.whl.
File metadata
- Download URL: sefia-0.1.0-py3-none-any.whl
- Upload date:
- Size: 56.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
253f9b2ca1d731ce4e0bf8a5c352b0cedefbaa6c3a60206bdce829bc56f18a40
|
|
| MD5 |
03bb64f5a66bb77b30456b01f71be665
|
|
| BLAKE2b-256 |
6592cc9127618914ab7aa1ea7da0b9e726da4f130c4a1b1558e8810ccbd1e1ad
|
Provenance
The following attestation bundles were made for sefia-0.1.0-py3-none-any.whl:
Publisher:
publish-sefia.yml on nueruyu/sefia
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sefia-0.1.0-py3-none-any.whl -
Subject digest:
253f9b2ca1d731ce4e0bf8a5c352b0cedefbaa6c3a60206bdce829bc56f18a40 - Sigstore transparency entry: 2195684888
- Sigstore integration time:
-
Permalink:
nueruyu/sefia@4630f39225f6cc3d08c648a62cdb912dda5cae47 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/nueruyu
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-sefia.yml@4630f39225f6cc3d08c648a62cdb912dda5cae47 -
Trigger Event:
push
-
Statement type: