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.3.0.tar.gz (82.4 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.3.0-py3-none-any.whl (66.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for sefia-0.3.0.tar.gz
Algorithm Hash digest
SHA256 d0ec23ee8e1268446b47a92aa4ee4f2985e1b3391b36435b0455d3f7f6791ef2
MD5 eb261fc8e83cab9a77e5e92a41fe8d1a
BLAKE2b-256 f413dbc2f01b20ea1eacda9a543dca3536bf9e90b0b817b6b1953d2d232c05ca

See more details on using hashes here.

Provenance

The following attestation bundles were made for sefia-0.3.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.3.0-py3-none-any.whl.

File metadata

  • Download URL: sefia-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 66.2 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.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aa3d03a621e7bf29694c4fb0ffe09f4efb38328f7b01f930d0621fef6970ea57
MD5 c2c2dc1fe4e2d72fbb68584e51af845d
BLAKE2b-256 bc068f362baf1e0e176fb95ac875418b475309b524a247d8f0abd8ee930fe847

See more details on using hashes here.

Provenance

The following attestation bundles were made for sefia-0.3.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

0.4.0

2 files

This release

0.3.0 This release

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