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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sefia-0.4.0.tar.gz (87.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sefia-0.4.0-py3-none-any.whl (72.7 kB view details)

Uploaded Python 3

File details

Details for the file sefia-0.4.0.tar.gz.

File metadata

  • Download URL: sefia-0.4.0.tar.gz
  • Upload date:
  • Size: 87.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for sefia-0.4.0.tar.gz
Algorithm Hash digest
SHA256 07d5de1f2110501f50813b8099dd7294bc17f5c43e108a0ed459fcbdd41f22dd
MD5 022a361a5ea5d8bd75a4e24cee0f1c43
BLAKE2b-256 bd8f17a58e84c94ad0f7b75cee5b81720e3ae30c711ed1f637efb9dbf91b04ff

See more details on using hashes here.

Provenance

The following attestation bundles were made for sefia-0.4.0.tar.gz:

Publisher: publish-sefia.yml on nueruyu/sefia

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sefia-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: sefia-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 72.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for sefia-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0aa9fb6967e6e264f22297a21af1391c039665485353d14d3428cac8298b7124
MD5 01b5a5b42894fed8b229cb33ceae7810
BLAKE2b-256 56ece0a9eef43b06b03b13413d0887c86c0ed91ef6bdc3e329c3ccbea8446ab3

See more details on using hashes here.

Provenance

The following attestation bundles were made for sefia-0.4.0-py3-none-any.whl:

Publisher: publish-sefia.yml on nueruyu/sefia

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 files

0.3.0

2 files

0.2.0

2 files

0.1.1

2 files

0.1.0

2 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