Skip to main content
Slyme Logo

SLYME Lets You Mold Everything.

PyPI version Python version Documentation License

English | 简体中文

About Slyme

Slyme (pronounced /slaɪm/) is a highly composable functional execution framework. It enables developers to seamlessly build arbitrarily complex execution flows based on simple, reusable functions, without needing to master cumbersome APIs or syntax.

Whether you are building complex LLM pipelines, executing DAGs, or creating generic data-processing flows, Slyme provides a structural, functional, and deeply Pythonic foundation.

Installation

Slyme requires Python 3.9+. You can install it directly via pip:

pip install slyme

(Note: Slyme is extremely lightweight and its only main dependency is typing_extensions.)

Quick Start

Here is a quick example demonstrating how to build a simple execution pipeline using Slyme's core primitives (@node, @expression, @wrapper, and @builder):

from time import time
from collections.abc import Callable
from slyme.builder import builder
from slyme.context import ARG, Arg, Context, R, Ref
from slyme.node import node, expression, wrapper, Auto, Node


# 1. Define an execution node
@node
def llm_api(ctx: Context, /, *, prompts: Auto[list[str]], responses: Ref[list[str]]):
    responses_ = [f"Response to the prompt: {prompt}" for prompt in prompts]
    return ctx.set(responses, responses_)


# 2. Define an expression for data transformation
@expression
def format_prompts(ctx: Context, /, *, articles: Auto[list[dict]]) -> list[str]:
    return [
        f"Summarize: {article['title']}. Content: {article['content']}" 
        for article in articles
    ]


# 3. Define a wrapper for middleware (e.g., performance timing)
@wrapper
def timing(ctx: Context, wrapped: Node, call_next: Callable[[Context], Context], /, *, prefix: str) -> Context:
    start_time = time()
    ctx = call_next(ctx)
    end_time = time()
    print(f"[{prefix}] Finished successfully in {end_time - start_time:.4f} seconds.")
    return ctx


# 4. Assemble the pipeline at Build-Time
@builder
def build_pipeline():
    return llm_api(
        responses=R.output.responses,
        prompts=format_prompts(
            articles=R.input.articles(
                metadata={ARG: Arg(type=list[dict], required=True)}
            )
        ),
    ).add_wrappers(timing(prefix="LLM API Call"))


# 5. Execute at Run-Time
if __name__ == "__main__":
    responses = build_pipeline().run(
        inputs={R.input.articles: [
            {"title": "Article 1", "content": "Content 1"},
            {"title": "Article 2", "content": "Content 2"},
        ]},
        outputs=R.output.responses,
    )
    print(responses)

Core Advantages

Native Python Development Experience: Eliminates heavy object-oriented boilerplate code. You only need to master basic Python functions and native data structures (dictionaries, lists, tuples) to get started quickly.

Unlimited Composability: Build arbitrarily complex execution flows with complete decoupling. Thanks to PyTree augmentation, Node containment relationships can be represented directly through native Python structures.

Functional & Concurrency Safety: The state exchanged between execution units (Context) is structurally immutable, utilizing a Copy-On-Write mechanism to make state management under concurrent execution simple and safe.

Seamless Collaboration: Highly decoupled Nodes communicate exclusively through Context. This allows teams to independently develop features and write unit tests, reducing "glue code" and deep system coupling.

Documentation

To dive deeper into Slyme's architecture, including Context management, dependency injection, and the Node lifecycle, please refer to our official documentation site.

👉 Read the Official Slyme Documentation

License

This project is licensed under the Apache-2.0 License.

Metadata

Release files for slyme 0.1.1

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

Source distribution (sdist)

Source distribution for slyme 0.1.1
File Size Uploaded Provenance
slyme-0.1.1.tar.gz 184.8 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for slyme 0.1.1
File Interpreter ABI Platform
slyme-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 273.9 kB

Release files / slyme-0.1.1.tar.gz

Download URL slyme-0.1.1.tar.gz
Size 184.8 kB
Tags Source
SHA-256 checksum
How to use checksums
1b2ed66803850e6a5569246984e6ec17d65585b9eb65291963d17fbc478ed3a0
BLAKE2b-256 checksum
How to use checksums
7b8bf405db6cc3192d4d737b7af3ef0942c50f58a700e92fbc6e5f834554b060
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 26, 2026.

Transparency log

Release files / slyme-0.1.1-py3-none-any.whl

Download URL slyme-0.1.1-py3-none-any.whl
Size 89.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
94628cdeab659f62ccbe06b177383bf9bf78cd61e1ec3d60a6e791b6a3fbddab
BLAKE2b-256 checksum
How to use checksums
4a55d1a9e1b8355561de0b89d1c3518c5408d3ab1b1605df2e9da5104685f2dd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 26, 2026.

Transparency log

Security for slyme 0.1.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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for slyme-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 26, 2026.

Transparency log

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.

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