Skip to main content

Keras-style symbolic DAGs for LLM programs

Project description

onux

Keras-style symbolic DAGs for LLM programs.

onux is a Python library for semantic inputs, composable layers, and model graphs that look and feel like Keras, but target LLM workflows.

Install

uv add onux

For local development:

uv venv .venv
source .venv/bin/activate
uv sync

Quick example

from onux import Input, Model
from onux.layers import ChainOfThought, Generate

question = Input("question")
context = Input("context", type=list[str])

answer = ChainOfThought("answer")([question, context])
score = Generate(("score", float))([question, answer])

model = Model(
    inputs=[question, context],
    outputs=score,
    name="qa_pipeline",
)

model.compile(optimizer="auto_prompt", meta_lm="gpt-4o")
model.fit(
    [
        {
            "question": "What's the capital of France?",
            "context": ["Paris is the capital of France."],
            "score": 1.0,
        }
    ]
)

model.summary()

Current status

This package is intentionally minimal right now. It includes:

  • symbolic Input(...)
  • a base Layer
  • graph-closing Model(...)
  • placeholder built-in layers like Generate, ChainOfThought, ReAct, Retrieve, ExecuteSQL, and Map

License

MIT

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

onux-0.1.1.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

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

onux-0.1.1-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file onux-0.1.1.tar.gz.

File metadata

  • Download URL: onux-0.1.1.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for onux-0.1.1.tar.gz
Algorithm Hash digest
SHA256 f4de679336faa77fea5b243272d7526d31eb97208df4a84945201d70ef12b2c3
MD5 265443dcc65804ee2d565167b70ad066
BLAKE2b-256 f98df49d08c3a3d992a3daef554c81926c2affdaf220d66ffe564d818d74f889

See more details on using hashes here.

File details

Details for the file onux-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: onux-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for onux-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 86f0c58737e0d0d46f2523cca49a6f67d1fceb86fdb36f60e87d4e1f5ce9da91
MD5 04c9394f3767815bc5474177f7a5ad9e
BLAKE2b-256 113cde6b4f0a21eb84f08028a29a07622559972d8ace3c610793a79d34276425

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