Skip to main content

Keras-style symbolic DAGs for LLM programs

Project description

onux

Keras-style symbolic DAGs for LLM programs.

onux is an early Python library prototype inspired by the ideas in keras-dspy.md: 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

The current release is mainly for package reservation and initial API scaffolding.

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.0.tar.gz (4.9 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.0-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: onux-0.1.0.tar.gz
  • Upload date:
  • Size: 4.9 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.0.tar.gz
Algorithm Hash digest
SHA256 c1675a88d98e23725389c370d2c8909740b87a9bcd3165b72822dd88bf5c2f9f
MD5 1368480779659978e50c4e0eb4f57c2f
BLAKE2b-256 7b882130c64c0406bcaec6c2e189c4fb9404d218eff83fb5adc6e61fc044e600

See more details on using hashes here.

File details

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

File metadata

  • Download URL: onux-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.9 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e87bf44201b1e5ad48dcfaa866f017334d833d43f90e59d8b94c8b209bbe422a
MD5 f227aa5ec34f7bba908076b6ff0cafbf
BLAKE2b-256 d03099c88a7d0ed78b6816e8c29251d53cc1b82c57dc3b5f8280a5c3aed03c77

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