Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

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.13.1.dev0

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.13.1.dev0
File
fabricatio_core-0.13.1.dev0-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details
fabricatio_core-0.13.1.dev0-cp314-cp314-manylinux_2_38_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.38+ x86-64 Details
fabricatio_core-0.13.1.dev0-cp314-cp314-manylinux_2_38_aarch64.whl CPython 3.14 CPython 3.14 Linux glibc 2.38+ ARM64 Details
fabricatio_core-0.13.1.dev0-cp314-cp314-macosx_11_0_arm64.whl CPython 3.14 CPython 3.14 macOS 11.0+ ARM64 Details
fabricatio_core-0.13.1.dev0-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details
fabricatio_core-0.13.1.dev0-cp313-cp313-manylinux_2_38_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.38+ x86-64 Details
fabricatio_core-0.13.1.dev0-cp313-cp313-manylinux_2_38_aarch64.whl CPython 3.13 CPython 3.13 Linux glibc 2.38+ ARM64 Details
fabricatio_core-0.13.1.dev0-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details
fabricatio_core-0.13.1.dev0-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
fabricatio_core-0.13.1.dev0-cp312-cp312-manylinux_2_38_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.38+ x86-64 Details
fabricatio_core-0.13.1.dev0-cp312-cp312-manylinux_2_38_aarch64.whl CPython 3.12 CPython 3.12 Linux glibc 2.38+ ARM64 Details
fabricatio_core-0.13.1.dev0-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details

Total release size: 164.7 MB

Release files / fabricatio_core-0.13.1.dev0-cp314-cp314-win_amd64.whl

Download URL fabricatio_core-0.13.1.dev0-cp314-cp314-win_amd64.whl
Size 13.7 MB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
071f78d42beb253c2b7011b36d30934bdcb4a63a51fa406ff2848070d2d44567
BLAKE2b-256 checksum
How to use checksums
bcf6ac1f9c9d8dc3e971bea520c590a45126ad84dd4d26d8308b8fd6b5e6dfe1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","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.13.1.dev0-cp314-cp314-manylinux_2_38_x86_64.whl

Download URL fabricatio_core-0.13.1.dev0-cp314-cp314-manylinux_2_38_x86_64.whl
Size 14.8 MB
Tags CPython 3.14 Linux glibc 2.38+ x86-64
SHA-256 checksum
How to use checksums
2f356db966a05e9519a1a9028fd004af8094eaf62d78bff15587e866e5c74991
BLAKE2b-256 checksum
How to use checksums
8c80c05f189c46545ada254b57d43f1f65bc4e40bc0b89ba39837b97b40f6db7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","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.13.1.dev0-cp314-cp314-manylinux_2_38_aarch64.whl

Download URL fabricatio_core-0.13.1.dev0-cp314-cp314-manylinux_2_38_aarch64.whl
Size 13.2 MB
Tags CPython 3.14 Linux glibc 2.38+ ARM64
SHA-256 checksum
How to use checksums
dfb17b6163123986aa6ed3fe22d756f263a71e66ec4b5d79a33f52dc086644a9
BLAKE2b-256 checksum
How to use checksums
da0b6e927cc1745ada4a208a70afcaf3d55e78bdc9426c99a3035a907ffa49e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","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.13.1.dev0-cp314-cp314-macosx_11_0_arm64.whl

Download URL fabricatio_core-0.13.1.dev0-cp314-cp314-macosx_11_0_arm64.whl
Size 13.3 MB
Tags CPython 3.14 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
7da2c049ecdf2a80ecf43729030b1512f3f7c92aed2acadc29de0ce0f9abe905
BLAKE2b-256 checksum
How to use checksums
81821471a29c25d22fa908652a2660fa02537a3feb33403e0bd741a71ba2d528
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","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.13.1.dev0-cp313-cp313-win_amd64.whl

Download URL fabricatio_core-0.13.1.dev0-cp313-cp313-win_amd64.whl
Size 13.7 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
97c7a4f0b83b8ec79c7d411b5925ae4bf7d396cff88e6d4ca067ab9318ca5e40
BLAKE2b-256 checksum
How to use checksums
17e763af96e4614ca91efab27fe3f6c116211f5ae95d382b12f83044c0f90751
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","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.13.1.dev0-cp313-cp313-manylinux_2_38_x86_64.whl

Download URL fabricatio_core-0.13.1.dev0-cp313-cp313-manylinux_2_38_x86_64.whl
Size 14.8 MB
Tags CPython 3.13 Linux glibc 2.38+ x86-64
SHA-256 checksum
How to use checksums
adf98ee49b8f10781f6897a3bf1e72b0d84ffb841c3098519f79bf137edde379
BLAKE2b-256 checksum
How to use checksums
88e521b52fab3baa784cbf4999506af556e728b2edb86976c05a23cfa6b4f6bd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","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.13.1.dev0-cp313-cp313-manylinux_2_38_aarch64.whl

Download URL fabricatio_core-0.13.1.dev0-cp313-cp313-manylinux_2_38_aarch64.whl
Size 13.2 MB
Tags CPython 3.13 Linux glibc 2.38+ ARM64
SHA-256 checksum
How to use checksums
9bcd1245a8dbc361fe176cb59c65beb9d54024eaf07fb9770ad6de58e44e74c0
BLAKE2b-256 checksum
How to use checksums
93fe6b3e8238a0d498e168029317305db90a74332e134d2dab0674703d2689a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","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.13.1.dev0-cp313-cp313-macosx_11_0_arm64.whl

Download URL fabricatio_core-0.13.1.dev0-cp313-cp313-macosx_11_0_arm64.whl
Size 13.3 MB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
42ef072396c8976a86588789222eb8634e35c9d6b023026ec520158611705b24
BLAKE2b-256 checksum
How to use checksums
b1641f523d861584a181f708b462ac3e2f65d78cb17f5baf3daa10c41a0afe22
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","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.13.1.dev0-cp312-cp312-win_amd64.whl

Download URL fabricatio_core-0.13.1.dev0-cp312-cp312-win_amd64.whl
Size 13.7 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
7d9042a444397ff8c36bf6992b0b546a247f99c46b6c66261f81e828a09e425b
BLAKE2b-256 checksum
How to use checksums
1a5bf6eea0b16f6d872c5252dab60d574ea6c4d12fb41bf32d76adc34250cac1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","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.13.1.dev0-cp312-cp312-manylinux_2_38_x86_64.whl

Download URL fabricatio_core-0.13.1.dev0-cp312-cp312-manylinux_2_38_x86_64.whl
Size 14.8 MB
Tags CPython 3.12 Linux glibc 2.38+ x86-64
SHA-256 checksum
How to use checksums
020d78d03b7af3c58478a45052a5cb4712fe214dd858c590fa8fd3578fd0b937
BLAKE2b-256 checksum
How to use checksums
3920dd76cbff0e02bc411fc841fc084a7e681e7b3dd0e6c6a78d7862c541e387
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","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.13.1.dev0-cp312-cp312-manylinux_2_38_aarch64.whl

Download URL fabricatio_core-0.13.1.dev0-cp312-cp312-manylinux_2_38_aarch64.whl
Size 13.2 MB
Tags CPython 3.12 Linux glibc 2.38+ ARM64
SHA-256 checksum
How to use checksums
cef20e288c2c0c77936e19ac51c8e36c34575668060001f173110a244442ca4c
BLAKE2b-256 checksum
How to use checksums
a334f66b487bb0bb77129b7dd0c24c4d92c9cf11951d84d92e624c0f62530dc8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","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.13.1.dev0-cp312-cp312-macosx_11_0_arm64.whl

Download URL fabricatio_core-0.13.1.dev0-cp312-cp312-macosx_11_0_arm64.whl
Size 13.3 MB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
ea0a0e6dd200834078bfafef8bc00c8a8b696580d742e7e0d146f1a24bbea8b4
BLAKE2b-256 checksum
How to use checksums
279843fa7d1a147c955c1f7a5312b7916f2b772601dade185383802528c42dc2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","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 history Release notifications | RSS feed

This release

0.13.1.dev0 This release

12 release files

0.9.0

12 release files

0.8.6

12 release files

0.8.5

12 release files

0.8.4

12 release files

0.8.3

12 release files

0.8.2

12 release files

0.7.0

12 release files

0.6.7

12 release files

0.6.6

12 release files

0.6.3

12 release files

0.6.2

12 release files

0.6.1

12 release files

0.6.0

12 release files

0.4.5

12 release files

0.4.4

12 release files

0.4.3

12 release files

0.4.0

12 release files

0.3.32

8 release files

0.3.31

8 release files

0.3.30

8 release files

0.3.28

8 release files

0.3.27

8 release files

0.3.19

8 release files

0.3.18

8 release files

0.3.17

8 release files

0.3.13

8 release files

0.3.12

8 release files

0.3.11

8 release files

0.3.10

8 release files

0.3.9

8 release files

0.3.7

8 release files

0.3.6

8 release files

0.3.5

8 release files

0.3.4

4 release files

0.3.3

4 release files

0.3.2

4 release files

0.3.1

4 release files

0.3.0

3 release files

0.1.11

3 release files

0.1.10

3 release files

0.1.9

3 release files

0.1.8

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.2

2 release files

0.1.0

2 release 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