Skip to main content

DAG-based LLM execution framework.

Project description

Trellis

Intro

Trellis is an open-source framework for programmatically orchestrating LLM workflows as Directed Acyclic Graphs (DAGs) in Python. We've intentionally designed it to give developers as much control as possible, and we've written documentation to make it incredibly easy to get started.

Structure

Trellis is composed of only three abstractions: Node, DAG, and LLM.

  • Node: the atomic unit of Trellis. Nodes are chained together to form a DAG.   Node is an abstract class with only one method required to implement.
  • DAG: a directed acyclic graph of Nodes. It is the primary abstraction for orchestrating LLM workflows. When you   add edges between Nodes, you can specify a transformation function to reuse Nodes and connect any two Nodes.   Trellis verifies the data flowing between Nodes in a DAG to ensure the flow of data is validated.
  • LLM: a wrapper around a large language model with simple catches for common OpenAI errors. Currently, the only provider   that Trellis supports is OpenAI.

Environment Variables

  • If you're going to use the LLM class, set:
    • OPENAI_API_KEY=YOUR_OPENAI_KEY
  • If you don't want us to send telemetry data (in the Node._init_(), LLM.execute() (including prompts and responses from OpenAI) and DAG.execute() methods, info about nodes you create or dags you run), to an external server (currently (PostHog)[https://posthog.com/]) for analysis, set:
    • TRELLIS_DISABLE_TELEMETRY=1
  • If you want to reduce the amount of information the logger returns, set:
    • [for everything] TRELLIS_LOG_LEVEL=DEBUG
    • [for status updates] TRELLIS_LOG_LEVEL=INFO
    • [for only warnings] TRELLIS_LOG_LEVEL=WARNING
    • [for errors which stop runtime] TRELLIS_LOG_LEVEL=ERROR
    • [for only critical errors] TRELLIS_LOG_LEVEL=CRITICAL

Install

You can install Trellis with any of the following methods:

Pip

pip install trellis-dag

Poetry

poetry add trellis-dag

Conda

conda install trellis-dag

Project details


Download files

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

Source Distribution

trellis_dag-0.1.2.tar.gz (15.5 kB view details)

Uploaded Source

Built Distribution

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

trellis_dag-0.1.2-py3-none-any.whl (18.0 kB view details)

Uploaded Python 3

File details

Details for the file trellis_dag-0.1.2.tar.gz.

File metadata

  • Download URL: trellis_dag-0.1.2.tar.gz
  • Upload date:
  • Size: 15.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.11.4 Darwin/22.5.0

File hashes

Hashes for trellis_dag-0.1.2.tar.gz
Algorithm Hash digest
SHA256 a21d81d8896c4777ce705ab8156bc5ef74a78927d3ab7c2a511872ed4341d33b
MD5 d7c01578859b9234b73d0ecbece7ea3e
BLAKE2b-256 f318fd6d6aee57be28efa1a54383c95a05e86c4cb29ee48ed889a02fd711747a

See more details on using hashes here.

File details

Details for the file trellis_dag-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: trellis_dag-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 18.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.11.4 Darwin/22.5.0

File hashes

Hashes for trellis_dag-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 90d1bddc65d5d8644d1553d66b59062ec766b2a8c55c7e29085eaf7071e096f5
MD5 1d31746d3217e6bc6981bad219584552
BLAKE2b-256 f5cdb9adc22ab6daa271147a9dd124ef675dc0007655090708ebc391fe68e3e3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page