MiniChain
FreeA tiny library for coding with large language models. 
About MiniChain
MiniChain is a lightweight Python library for building applications with large language models (LLMs) through prompt chaining. It uses a decorator-based approach (@prompt) to annotate functions that call LLMs, enabling developers to chain multiple prompts together in a lazy graph structure similar to PyTorch. The library separates prompt templates (Jinja) from code, supports multiple backends including OpenAI, Hugging Face, Google Search, Python interpreter, Bash, and Manifest-ML (AI21, Cohere, Together), and can implement popular techniques like Retrieval-Augmented QA, chat with memory, information extraction, interleaved code (PAL), search augmentation (Self-Ask), and chain-of-thought reasoning in just a few lines of code. MiniChain is designed as a minimal, digestible alternative to larger frameworks like LangChain, Promptify, and GPTIndex.
Key Features
Pros & Cons
- Extremely simple and lightweight (tiny codebase) compared to LangChain, Promptify, GPTIndex
- Intuitive decorator-based API for defining prompts and chains
- Supports multiple LLM backends and tools (including Python and Bash execution)
- Separation of prompt templates from logic improves maintainability
- Free and open source (MIT license inferred from GitHub repo)
- Limited to Python; no direct support for other languages
- Requires external API keys (OpenAI, etc.) for most backends
- Not as feature-rich as larger frameworks (e.g., no built-in vector stores, agents, or complex memory)
- Primarily a single-developer project (srush) with limited community support