# srush/MiniChain

A tiny library for coding with large language models.

Repository: https://github.com/srush/MiniChain
Canonical: https://ross.abutalabs.com/products/minichain
Homepage: https://srush-minichain.hf.space/
Language: Python
License: MIT
License Family: permissive
Last push: 2024-07-10T14:59:50+00:00

## Health v2 (maintenance only)
Score: 21/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 0, release rhythm 8, longevity 92
- inputs: {"age_days": 1300, "days_push": 784, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1232, forks 74 (observed 2026-08-28T04:04:04.478794+00:00)

## What it is
MiniChain is a tiny Python library for building applications with large language models by annotating Python functions that call LLMs and chaining them together. It builds a graph of all LLM and tool calls (like PyTorch) for debugging, with support for OpenAI, Hugging Face, search, Python, and Bash backends.

## Use cases
- build retrieval-augmented QA pipelines
- chain LLM calls with a Python interpreter for math problems
- create chatbots with memory
- extract structured information from text with LLMs
- implement chain-of-thought or self-ask prompting patterns
- prototype LLM apps without heavyweight frameworks like LangChain

## When to choose
- you want a minimal, hackable alternative to LangChain
- you prefer prompts separated from code via Jinja templates
- you need a call graph for debugging chained LLM invocations
- you want to mix LLM calls with Python or Bash execution

## When to avoid
- you need production-grade features like streaming, agents, or extensive integrations
- you want a large ecosystem of loaders, vector stores, and memory modules
- you need actively developed features or long-term support

## Facets
- artifact type: library
- maturity: maintenance
- function: llm-inference, prompt-engineering, rag, agent-framework, chatbot
- domain: large-language-models, artificial-intelligence, developer-tools
- platform: python, cross-platform
- tags: prompt-chaining, llm-orchestration, jinja-templates, langchain-alternative, minimalist, natural-language-processing

## Member repositories
- srush/MiniChain (main) score 21

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:04.478794+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T08:22:23.213446+00:00, confidence not recorded.
  - readme: https://github.com/srush/MiniChain (fetched 2026-08-28T04:04:04.478794+00:00, sha 6d6508d0763b)
  - registry_pypi: https://pypi.org/pypi/minichain/json (fetched 2026-08-29T12:22:21.014913+00:00, sha 6b3c8dcc2ec2)
- Data as of 2026-08-30T08:39:29.467469+00:00.
