Langstream
FreeBuild robust LLM applications with true composability 🔗 
About Langstream
LangStream is a lightweight, open-source Python library for building LLM applications, designed as a simpler alternative to LangChain. Instead of a massive feature set, it focuses on a single small core that is easy to learn, easy to adapt, well documented, fully typed, and truly composable. The fundamental building block is the 'Stream' — everything from an LLM to an output parser is a Stream, and streams can be composed together using functions like and_then, map, collect, join, and gather. LangStream leverages Python's AsyncGenerator for async streaming, enabling token-by-token output and seamless composition. Originally named LiteChain, it was renamed to LangStream. The library includes contrib modules for OpenAI (e.g., OpenAIChatStream) and is available via pip.
Key Features
Pros & Cons
- Lightweight and minimalistic design, reducing complexity
- True composability with Streams, making pipelines easy to build and reuse
- Async streaming enables efficient token-by-token processing
- Fully typed with good documentation, aiding developer experience
- Open-source and free to use
- Smaller community and fewer integrations compared to LangChain (417 stars on GitHub)
- Limited to Python and currently only includes OpenAI contrib (may need custom development for other providers)
- Relatively new project, so ecosystem and stability are evolving