---
title: "llmflows"
type: "tool"
slug: "stoyan-stoyanov-llmflows"
canonical_url: "https://www.graphcanon.com/tools/stoyan-stoyanov-llmflows"
github_url: "https://github.com/stoyan-stoyanov/llmflows"
homepage_url: "https://llmflows.readthedocs.io"
stars: 706
forks: 35
primary_language: "Python"
license: "MIT"
categories: ["inference-serving", "evaluation-observability"]
tags: ["llms", "llm", "ai", "machine-learning", "gpt-4", "chatgpt", "openai", "prompt-engineering"]
updated_at: "2026-07-07T18:49:29.012507+00:00"
---

# llmflows

> Simple, Explicit and Transparent LLM Apps

LLMFlows is a framework that allows the creation of clear, transparent applications using large language models (LLMs), offering minimalistic abstractions for monitoring, maintenance, and debugging.

## Facts

- Repository: https://github.com/stoyan-stoyanov/llmflows
- Homepage: https://llmflows.readthedocs.io
- Stars: 706 · Forks: 35 · Open issues: 19 · Watchers: 10
- Primary language: Python
- License: MIT
- Last pushed: 2025-02-20T16:53:45+00:00

## Categories

- [Inference & Serving](/categories/inference-serving.md)
- [Evaluation & Observability](/categories/evaluation-observability.md)

## Tags

llms, llm, ai, machine-learning, gpt-4, chatgpt, openai, prompt-engineering

## Related tools

- [langflow](/tools/langflow-ai-langflow.md) - Langflow is a powerful platform for building and deploying AI-powered agents and workflows. (★ 151,298)
- [open-webui](/tools/open-webui-open-webui.md) - User-friendly AI Interface (Supports Ollama, OpenAI API, ...) (★ 144,575)
- [vllm](/tools/vllm-project-vllm.md) - A high-throughput and memory-efficient inference and serving engine for LLMs (★ 85,612)
- [rtk](/tools/rtk-ai-rtk.md) - CLI proxy reducing LLM token consumption by 60-90% (★ 69,253)
- [unsloth](/tools/unslothai-unsloth.md) - Unsloth Studio is a web UI for training and running open models locally. (★ 67,883)
- [anything-llm](/tools/mintplex-labs-anything-llm.md) - Stop renting your intelligence. Own it with AnythingLLM. (★ 62,759)
- [mem0](/tools/mem0ai-mem0.md) - Universal memory layer for AI Agents (★ 60,317)
- [litellm](/tools/berriai-litellm.md) - Python SDK and Proxy Server for calling over 100 LLM APIs in OpenAI format (★ 52,877)

## README (excerpt)

```text
<p align="center">
  <img src="https://github.com/stoyan-stoyanov/llmflows/blob/main/docs/logo_with_subheading.png"/>
</p>









Documentation: <a href="https://llmflows.readthedocs.io/" target="_blank">https://llmflows.readthedocs.io</a></br>
PyPI: <a href="https://pypi.org/project/llmflows/" target="_blank">https://pypi.org/project/llmflows</a></br>
Twitter: <a href="https://twitter.com/LLMFlows/" target="_blank">https://twitter.com/LLMFlows</a></br>
Substack: <a href="https://llmflows.substack.com/" target="_blank">https://llmflows.substack.com</a></br>

## 🤖 About LLM Flows
LLMFlows is a framework for building simple, explicit, and transparent LLM(Large Language Model) applications such as chatbots, question-answering systems, and agents.

At its core, LLMFlows provides a minimalistic set of abstractions that allow you to utilize LLMs and vector stores and build well-structured and explicit apps that don't have hidden prompts or LLM calls. LLM Flows ensures complete transparency for each component, making monitoring, maintenance, and debugging easy. 


## 📦 Installation
```
pip install llmflows
```

## 🧭 Philosophy

### **Simple**
Our goal is to build a simple, well-documented framework with minimal abstractions that 
allow users to build flexible LLM-powered apps without compromising on capabilities.

### **Explicit**
We want to create an explicit API enabling users to write clean and readable code while 
easily creating complex flows of LLMs interacting with each other. LLMFlows' classes 
give users full control and do not have any hidden prompts or LLM calls. 

### **Transparent**
We aim to help users have full transparency on their LLM-powered apps by providing 
traceable flows and complete information for each app component, making it easy to 
monitor, maintain, and debug.

## ▶️ Live Demo
Check out [LLM-99](https://llm-99.vercel.app/) - a demo app that uses LLMs to explain 
superconductors in simple terms. The app is built with LLMFlows, and FastAPI and uses 
Pinecone to store document embeddings created from Wikipedia articles. You can find 
the source code for this demo app and other examples in our 
[examples folder](https://github.com/stoyan-stoyanov/llmflows/tree/main/examples/llmflows_in_fastapi/superconductor).



## 🧪 Getting Started
### LLMs
LLMs are one of the main abstractions in LLMFlows. LLM classes are wrappers around LLM 
APIs such as OpenAI's APIs. They provide methods for configuring and calling these APIs, 
retrying failed calls, and formatting the responses.

```python
from llmflows.llms import OpenAI

llm = OpenAI(api_key="<your-openai-api-key>")

result, call_data, model_config = llm.generate(
   prompt="Generate a cool title for an 80s rock song"
)
```


### PromptTemplates
The `PromptTemplate` class allows us to create strings with variables that we can fill 
in dynamically later on. Once a prompt template object is created an actual prompt can 
be generated by providing the required variables.

```python
from llmflows.llms import OpenAI
from llmflows.prompts import PromptTemplate


prompt_template = PromptTemplate(
    prompt="Generate a title for a 90s hip-hop song about {topic}."
)
llm_prompt = prompt_template.get_prompt(topic="friendship")

print(llm_prompt)

llm = OpenAI(api_key="<your-openai-api-key>")
song_title = llm.generate(llm_prompt)

print(song_title)
```

### Chat LLMs
Unlike regular LLMs that only require a prompt to generate text, chat LLMs require a 
conversation history. The conversation history is represented 
as a list of messages between a user and an assistant. This conversation history is 
sent to the model, and a new message is generated based on it.

LLMFlows provides a `MessageHistory` class to manage the required conversation history 
for chat LLMs.

You can build a simple chatbot by using the `OpenAIChat` and `MessageHistory` classes:

```python
from llmflows.llms import OpenAIChat, MessageHistory

llm = OpenAIChat(api_key="<your-openai-api-key>")
message_hist
```

---

**Machine-readable endpoints**

- JSON: [`/api/graphcanon/tools/stoyan-stoyanov-llmflows`](/api/graphcanon/tools/stoyan-stoyanov-llmflows)
- LLM index: [/llms.txt](/llms.txt)
- Full corpus: [/llms-full.txt](/llms-full.txt)

_GraphCanon - The knowledge graph for AI development. https://www.graphcanon.com/_
