srush/MiniChain
A minimal Python library for composing LLM calls via decorated functions with graph-based debugging and prompt templating.

MiniChain lets developers annotate Python functions with a @prompt decorator to call LLMs, separating prompts from code using templates. It builds a computational graph of all LLM invocations (similar to PyTorch) for debugging and error handling, and allows chaining multiple LLM calls together to build complex workflows. The library supports various LLM backends like OpenAI and includes built-in examples like Retrieval-Augmented QA and math reasoning chains.
Frequently asked
- What is srush/MiniChain?
- A minimal Python library for composing LLM calls via decorated functions with graph-based debugging and prompt templating.
- Is MiniChain open source?
- Yes — srush/MiniChain is open source, released under the MIT license.
- What language is MiniChain written in?
- srush/MiniChain is primarily written in Python.
- How popular is MiniChain?
- srush/MiniChain has 1.2k stars on GitHub.
- Where can I find MiniChain?
- srush/MiniChain is on GitHub at https://github.com/srush/MiniChain.