Top AI Repos โ open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Build robust LLM applications with true composability ๐
| Date | Stars |
|---|---|
| 2026-07-31 | 417 |
| 2026-08-04 | 417 |
| 2026-08-06 | 417 |
Today
โ stars today
This week
โ stars this week
This month
โ stars this month
Momentum
0.0
growth rate 0.00%/day
# ๐ชฝ๐ LangStream
> โ ๏ธ Heads up! LiteChain was renamed to LangStream, for more details, check out [issue #4](https://github.com/rogeriochaves/langstream/issues/4)
[](https://discord.gg/48ZM5KkKgw)
[](https://pypi.org/project/langstream/)
[](https://github.com/rogeriochaves/langstream/actions/workflows/run_tests.yml)
[](https://github.com/rogeriochaves/langstream/actions/workflows/publish_docs.yml)
[](https://github.com/rogeriochaves/langstream/blob/main/LICENSE)
LangStream is a lighter alternative to LangChain for building LLMs application, instead of having a massive amount of features and classes, LangStream focuses on having a single small core, that is easy to learn, easy to adapt, well documented, fully typed and truly composable, with Streams instead of chains as the building block.
[Documentation](https://rogeriochaves.github.io/langstream)
# Quick Install
```
pip install langstream openai
```
# ๐ The Stream building block
The Stream is the building block for LangStream, an LLM is a Stream, an output parser is a Stream, a group of streams can be composed as another Stream, it's [Streams all the way down](https://en.wikipedia.org/wiki/Turtles_all_the_way_down).
Take a look at [the documentation](https://rogeriochaves.github.io/langstream) for guides on building on streams and building LLM applications, or go straight to [the reference](https://rogeriochaves.github.io/langstream/reference/langstream/index.html#stream) for the core concept and modules available.
# Quick Example
Here is a ChatBot that answers anything you ask using only emojis:
```python
from langstream.contrib import OpenAIChatStream, OpenAIChatMessage, OpenAIChatDelta
from typing import Iterable
# Creating a GPT-4 EmojiStream
emoji_stream = OpenAIChatStream[str, OpenAIChatDelta](
"EmojiStream",
lambda user_message: [
OpenAIChatMessage(
role="user", content=f"{user_message}. Reply in emojis"
)
],
model="gpt-4",
temperature=0,
)
# Now interacting with it
async for output in emoji_stream("Hey there, how is it going?"):
print(output.data.content, end="")
#=> ๐๐๐๐ป๐
async for output in emoji_stream("What is answer to the ultimate question of life, the universe, and everything?"):
print(output.data.content, end="")
#=> 4๏ธโฃ2๏ธโฃ
```
In this simple example, we are creating a [GPT4 Stream](https://rogeriochaves.github.io/langstream/reference/langstream/contrib/index.html#langstream.contrib.OpenAIChatStream) that takes the user message and appends `". Reply in emojis"` to it for building the prompt, following the [OpenAI chat structure](https://rogeriochaves.github.io/langstream/reference/langstream/contrib/index.html#langstream.contrib.OpenAIChatMessage) and with [zero temperature](https://rogeriochaves.github.io/langstream/docs/llms/zero_temperature).
Then, as you can see, we have an async loop going over each token output from `emoji_stream`. In LangStream, everything is an async stream using Python's `AsyncGenerator` class, and the most powerful part of it, is that you can connect those streams by composing two Streams together:
```python
# Creating another Stream to translate back from emoji
translator_stream = OpenAIChatStream[Iterable[OpenAIChatDelta], OpenAIChatDelta](
"TranslatorStream",
lambda emoji_tokens: [
OpenAIChatMessage(
role="user", content=f"Translate this emoji message {[token.content for token in emoji_tokens]} to plain english"
)
],
model="gpt-4",
)
# Connecting the two Streams together
stream = emoji_stream.and_then(translatExcerpt of 10,328 characters
Read on GitHubWould you bet a product on this? Bounded 0โ100 and slow moving.
matched fp:abab000b8d0f85f9, llm:description: 'Build robust LLM applications with true composability' (repository description)
matched fp:abab000b8d0f85f9, llm:description: 'Build robust LLM applications with true composability' (repository description)
matched fp:abab000b8d0f85f9, llm:description: 'Build robust LLM applications with true composability' (repository description)