langstream  by rogeriochaves

LLM app framework emphasizing composability via streams

created 2 years ago
419 stars

Top 71.1% on sourcepulse

GitHubView on GitHub
Project Summary

LangStream is a Python library designed for building robust LLM applications with a focus on composability and a minimal core. It offers a lighter alternative to frameworks like LangChain, enabling developers to create complex LLM workflows by composing simple, type-hinted "Streams."

How It Works

LangStream's core abstraction is the Stream, which represents a single operation, such as an LLM call, data parsing, or prompt formatting. These streams are built using Python's AsyncGenerator and can be composed sequentially using methods like and_then, map, collect, join, and gather. This functional programming approach, combined with strict type signatures for stream inputs and outputs, promotes code clarity, reduces bugs, and simplifies debugging by allowing access to intermediate results.

Quick Start & Requirements

Highlighted Details

  • True Composability: Small set of functional composition operators (and_then, map, collect, join, gather) for building complex pipelines.
  • Type Safety: Explicit input/output type signatures for streams prevent integration errors and enable editor-level validation.
  • External Prompts: Encourages keeping prompts outside of core logic for easier customization and LLM switching.
  • Bring Your Own Integration: Designed for easy addition of custom integrations with minimal abstraction layers.

Maintenance & Community

  • Active development, seeking contributions for integrations and documentation.
  • Discord community available for support and updates.
  • Roadmap includes memory mechanisms, RxPY integration, and LangChain compatibility.

Licensing & Compatibility

  • License: MIT.
  • Compatible with commercial and closed-source applications.

Limitations & Caveats

The project is relatively new, with ongoing efforts to expand integrations and documentation. Some planned features, like a default memory mechanism, are still under development.

Health Check
Last commit

1 year ago

Responsiveness

1 week

Pull Requests (30d)
0
Issues (30d)
0
Star History
2 stars in the last 90 days

Explore Similar Projects

Starred by Jeff Hammerbacher Jeff Hammerbacher(Cofounder of Cloudera) and Chip Huyen Chip Huyen(Author of AI Engineering, Designing Machine Learning Systems).

bytewax by bytewax

0.3%
2k
Python framework for stateful stream processing
created 3 years ago
updated 4 months ago
Starred by Peter Norvig Peter Norvig(Author of Artificial Intelligence: A Modern Approach; Research Director at Google), Michael Han Michael Han(Cofounder of Unsloth), and
15 more.

open-interpreter by openinterpreter

0.1%
60k
Natural language interface for computers
created 2 years ago
updated 4 days ago
Starred by Nat Friedman Nat Friedman(Former CEO of GitHub), Chip Huyen Chip Huyen(Author of AI Engineering, Designing Machine Learning Systems), and
7 more.

langflow by langflow-ai

2.9%
93k
Visual tool for AI agent and workflow creation/deployment
created 2 years ago
updated 1 day ago
Feedback? Help us improve.