Skip to main content

fabricatio-core

MIT Python Versions PyPI Version PyPI Downloads PyPI Downloads Build Tool: uv

Foundational Python library for building LLM-driven applications using an event-based agent architecture. Built on a hybrid Rust/Python foundation for performance-critical operations.

Requires Python 3.12+.

Installation

pip install fabricatio
# or
uv pip install fabricatio

For all optional extras:

pip install fabricatio[full]

Key Components

Event System (Event, EventEmitter)

Segmented event type with task-status lifecycle methods (push_running, push_finished, etc.) and glob-wildcard (*) matching. The global EventEmitter dispatches events asynchronously with on/off/emit.

from fabricatio_core.emitter import EMITTER
from fabricatio_core.rust import Event

EMITTER.on("task::*::finished", my_handler)

LLM Routing (Router, RouterUsage)

Multi-provider router for completion, embedding, and reranking. RouterUsage provides structured LLM interaction patterns — ask, list strings, code generation, judging, choosing — with configurable validation and fallback defaults.

from fabricatio_core.rust import ROUTER, router_usage

response = await ROUTER.completion(send_to="default", message="Hello")
result = await router_usage.choosing("Pick two items", valid_names=["a", "b", "c"], k=2)

Task Model (Task)

Pydantic-based task with lifecycle status management (Pending, Running, Finished, Failed, Cancelled), dependency tracking, structured proposal generation from prompts, and automatic event emission on state transitions.

task = Task(name="data_ingestion", description="Ingest raw data")
task.start()
# ... execute ...
task.finish(output={"rows": 1042})

Workflow Engine (Action, WorkFlow)

Abstract action pipeline with shared context propagation. WorkFlow orchestrates sequences of Action instances, managing input/output keys, error handling, and task lifecycle.

class ParseData(Action):
    async def _execute(self, **cxt):
        return parse(cxt["task_input"])

wf = WorkFlow(actions=[ParseData().to_task_output()], name="parse_pipeline")
await wf.execute(task)

Role Framework (Role)

Agent roles map event patterns to workflows. Global registry supports register_role / get_registered_role. Roles dispatch workflows automatically when matching events are emitted.

from fabricatio_core.models.role import Role, register_role

analyst = Role(name="analyst", description="Data analysis agent")
analyst.deploy_on("data::ingested", parse_wf)
register_role(analyst)

Template Rendering (TemplateManager)

Handlebars-based template engine. Load templates from directories, render with structured data.

from fabricatio_core.rust import TEMPLATE_MANAGER

TEMPLATE_MANAGER.add_store("./templates").discover_templates()
output = TEMPLATE_MANAGER.render_template("greeting", {"name": "World"})

Capability Mixins (UseLLM, UseEmbedding, UseReranker, Propose)

Inheritable classes that add LLM querying, embedding generation, reranking, and structured proposal capabilities to any model. All integrate with the Router for provider dispatch.

class MyAgent(UseLLM, UseEmbedding, Propose, WithBriefing):
    pass

agent = MyAgent(name="helper")
answer = await agent.aask(question="What is 2+2?")
obj = await agent.propose(MyModel, prompt="Create a config object")

Text Parsing & Language Utilities (Rust)

Fast Rust-backed functions for text processing:

  • split_sentence_bounds / split_word_bounds — Unicode-aware text splitting
  • split_into_chunks — chunk text with configurable overlap
  • tokens_of / word_count — token and word counting
  • blake3_hash — BLAKE3 content hashing
  • detect_language — language detection
  • is_english, is_chinese, is_japanese, etc. — language checks
  • is_likely_text — file content type detection
  • CodeSnippetParser, CodeBlockParser, GenericBlockParser, JsonParser — structured block extraction from LLM outputs

Base Model Hierarchy (models.generic)

Pydantic-based abstract base classes for consistent model design: Named, Described, WithBriefing, WithDependency, ScopedConfig (with hierarchical fallback), ProposedAble, InstantiateFromString, Display, and more.

Decorators

  • cfg_on / cfg_on_async — feature-gated function execution
  • depend_on_external_cmd — check external binary availability
  • logging_execution_info / logging_exec_time — execution logging
  • once — ensure single invocation

Configuration (Config)

Structured configuration with sub-sections for LLM, embedding, reranking, emitter, routing, templates, debug, and deployment settings. Accessible via fabricatio_core.rust.CONFIG.

Package Structure

fabricatio-core/
├── python/fabricatio_core/
│   ├── capabilities/      - LLM, embedding, reranker, and proposal mixins
│   ├── models/            - Action, Role, Task, generic base models, kwargs types
│   ├── rust/              - PyO3 Rust extension (autogenerated stubs)
│   ├── decorators.py      - cfg_on, once, logging_exec_time, etc.
│   ├── emitter.py         - EventEmitter with wildcard pattern matching
│   ├── journal.py         - Logger bridge to Rust logger
│   ├── utils.py           - ok, cfg, override_kwargs, first_available, etc.
│   └── __init__.py        - Public API surface
├── src/                   - Rust sources (parser, templates, event, language, etc.)
└── pyproject.toml

License

MIT — see LICENSE

Metadata

Release files for fabricatio-core 0.14.1

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

Built distributions (wheels)

Table of built distributions (wheels) for fabricatio-core 0.14.1
File Actions
fabricatio_core-0.14.1-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details for fabricatio_core-0.14.1-cp314-cp314-win_amd64.whl
fabricatio_core-0.14.1-cp314-cp314-manylinux_2_38_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.38+ x86-64 Details for fabricatio_core-0.14.1-cp314-cp314-manylinux_2_38_x86_64.whl
fabricatio_core-0.14.1-cp314-cp314-manylinux_2_38_aarch64.whl CPython 3.14 CPython 3.14 Linux glibc 2.38+ ARM64 Details for fabricatio_core-0.14.1-cp314-cp314-manylinux_2_38_aarch64.whl
fabricatio_core-0.14.1-cp314-cp314-macosx_11_0_arm64.whl CPython 3.14 CPython 3.14 macOS 11.0+ ARM64 Details for fabricatio_core-0.14.1-cp314-cp314-macosx_11_0_arm64.whl
fabricatio_core-0.14.1-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details for fabricatio_core-0.14.1-cp313-cp313-win_amd64.whl
fabricatio_core-0.14.1-cp313-cp313-manylinux_2_38_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.38+ x86-64 Details for fabricatio_core-0.14.1-cp313-cp313-manylinux_2_38_x86_64.whl
fabricatio_core-0.14.1-cp313-cp313-manylinux_2_38_aarch64.whl CPython 3.13 CPython 3.13 Linux glibc 2.38+ ARM64 Details for fabricatio_core-0.14.1-cp313-cp313-manylinux_2_38_aarch64.whl
fabricatio_core-0.14.1-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details for fabricatio_core-0.14.1-cp313-cp313-macosx_11_0_arm64.whl
fabricatio_core-0.14.1-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details for fabricatio_core-0.14.1-cp312-cp312-win_amd64.whl
fabricatio_core-0.14.1-cp312-cp312-manylinux_2_38_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.38+ x86-64 Details for fabricatio_core-0.14.1-cp312-cp312-manylinux_2_38_x86_64.whl
fabricatio_core-0.14.1-cp312-cp312-manylinux_2_38_aarch64.whl CPython 3.12 CPython 3.12 Linux glibc 2.38+ ARM64 Details for fabricatio_core-0.14.1-cp312-cp312-manylinux_2_38_aarch64.whl
fabricatio_core-0.14.1-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details for fabricatio_core-0.14.1-cp312-cp312-macosx_11_0_arm64.whl

Total release size: 167.6 MB

Release files / fabricatio_core-0.14.1-cp314-cp314-win_amd64.whl

Download URL fabricatio_core-0.14.1-cp314-cp314-win_amd64.whl
Size 13.9 MB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
5a17ecd0d948407f0d994ca439e4e997d868d861e66e8ca6b9b8effabfc16e63
BLAKE2b-256 checksum
How to use checksums
a3fa5f59ea677aafbf63487d29c90cf0fbc63837b6fca6c27541de5f168caa81
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / fabricatio_core-0.14.1-cp314-cp314-manylinux_2_38_x86_64.whl

Download URL fabricatio_core-0.14.1-cp314-cp314-manylinux_2_38_x86_64.whl
Size 15.0 MB
Tags CPython 3.14 Linux glibc 2.38+ x86-64
SHA-256 checksum
How to use checksums
7d75618c2fbdde86b6fbc8cfcdeebd48f896f9071e8ea49deff097de6132e1d3
BLAKE2b-256 checksum
How to use checksums
900a258481a7dab1d46085cf204706c1232efd8ea36d7fb9464b079802a8d7b9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / fabricatio_core-0.14.1-cp314-cp314-manylinux_2_38_aarch64.whl

Download URL fabricatio_core-0.14.1-cp314-cp314-manylinux_2_38_aarch64.whl
Size 13.4 MB
Tags CPython 3.14 Linux glibc 2.38+ ARM64
SHA-256 checksum
How to use checksums
2fd90336e68aa0e3d04104dbecfb815308c5f4516553b3e553476f8b1e756434
BLAKE2b-256 checksum
How to use checksums
41b7fab8d050808ef267647100eec43d45022ba92ad83ec87e860c1acc273759
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / fabricatio_core-0.14.1-cp314-cp314-macosx_11_0_arm64.whl

Download URL fabricatio_core-0.14.1-cp314-cp314-macosx_11_0_arm64.whl
Size 13.5 MB
Tags CPython 3.14 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
730adb72460e6b9439c9cda61bfe21cf4c09b11a5dca763c2d49234f5de63418
BLAKE2b-256 checksum
How to use checksums
83c43248128e02fdd632ebeb1f98682551ac45b2cd72dee225c67d21a1374997
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / fabricatio_core-0.14.1-cp313-cp313-win_amd64.whl

Download URL fabricatio_core-0.14.1-cp313-cp313-win_amd64.whl
Size 13.9 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
75d02d2485107a786ba93b8ffeec882461427794d6ae6ed5d86c99a3bbd38fe6
BLAKE2b-256 checksum
How to use checksums
e4c576ece920dce8eb36aa42a75bbbed1c80d56fadaf3e361514bf931af56b95
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / fabricatio_core-0.14.1-cp313-cp313-manylinux_2_38_x86_64.whl

Download URL fabricatio_core-0.14.1-cp313-cp313-manylinux_2_38_x86_64.whl
Size 15.0 MB
Tags CPython 3.13 Linux glibc 2.38+ x86-64
SHA-256 checksum
How to use checksums
841d48ec19ce6b824ed3aea6f7934c6e0eb56e73830b8b565111441b344f41e5
BLAKE2b-256 checksum
How to use checksums
137c1d5d523c0823206540d903cba34f643e093db651cf0c8972c2c9a62c18c3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / fabricatio_core-0.14.1-cp313-cp313-manylinux_2_38_aarch64.whl

Download URL fabricatio_core-0.14.1-cp313-cp313-manylinux_2_38_aarch64.whl
Size 13.4 MB
Tags CPython 3.13 Linux glibc 2.38+ ARM64
SHA-256 checksum
How to use checksums
e9b7e024de115d08e437f40ca54e265b4c55459d8f689d17b03be9249d8f705b
BLAKE2b-256 checksum
How to use checksums
3753065a9b89414de573151d75fdb249ee890cdd8cc92ce0702f0128c44651e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / fabricatio_core-0.14.1-cp313-cp313-macosx_11_0_arm64.whl

Download URL fabricatio_core-0.14.1-cp313-cp313-macosx_11_0_arm64.whl
Size 13.5 MB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
576cbb51969f43009700e95e7f41cae184a2def7eaf840b5a59c09643e04ecab
BLAKE2b-256 checksum
How to use checksums
ea01f089d9922be4d153aa00f7e63da00ebb6bd45265c3f5b466f9594b92de36
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / fabricatio_core-0.14.1-cp312-cp312-win_amd64.whl

Download URL fabricatio_core-0.14.1-cp312-cp312-win_amd64.whl
Size 13.9 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
d21cf87a4d8e719630d4961349448ae37ee82efc9851273d443ecef523289eb6
BLAKE2b-256 checksum
How to use checksums
57ac2978383d48049603882e0e80a2802800807e48fb4a26a11d8aedd7512250
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / fabricatio_core-0.14.1-cp312-cp312-manylinux_2_38_x86_64.whl

Download URL fabricatio_core-0.14.1-cp312-cp312-manylinux_2_38_x86_64.whl
Size 15.0 MB
Tags CPython 3.12 Linux glibc 2.38+ x86-64
SHA-256 checksum
How to use checksums
cb51360fafd938e9eb188ce7f13a37b9a5dfc6b7730824dc003d1f6fad937acb
BLAKE2b-256 checksum
How to use checksums
0895ce9f4569cc7c8c36c4f293bcfd242925f5b89bb5a27838d99b691f8a7ee6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / fabricatio_core-0.14.1-cp312-cp312-manylinux_2_38_aarch64.whl

Download URL fabricatio_core-0.14.1-cp312-cp312-manylinux_2_38_aarch64.whl
Size 13.5 MB
Tags CPython 3.12 Linux glibc 2.38+ ARM64
SHA-256 checksum
How to use checksums
3fb4fc3ff5ebab66fdad319eefcd5cc1fe1de9dd1c00c293575aad47a2a1c714
BLAKE2b-256 checksum
How to use checksums
0da21f87469dcf3970c523bc5778e8605a496a5ac99de87a054e4e8a13e0a96b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / fabricatio_core-0.14.1-cp312-cp312-macosx_11_0_arm64.whl

Download URL fabricatio_core-0.14.1-cp312-cp312-macosx_11_0_arm64.whl
Size 13.5 MB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
5db4db557732b7d28159a20ed76c38f58423db9d53b136c053bb1bb2e489fe19
BLAKE2b-256 checksum
How to use checksums
e2e7b101e8e37c526217d07d9afa103a1a6ef94388a579a6c703c5f09f42a85c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for fabricatio-core 0.14.1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.14.1 This release

12 release files No provenance

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