{"data":{"slug":"stoyan-stoyanov-llmflows","name":"llmflows","tagline":"Simple, Explicit and Transparent LLM Applications","github_url":"https://github.com/stoyan-stoyanov/llmflows","owner":"stoyan-stoyanov","repo":"llmflows","owner_avatar_url":"https://avatars.githubusercontent.com/u/14061867?v=4","primary_language":"Python","stars":706,"forks":35,"topics":["ai","chatgpt","gpt-4","llm","llm-inference","llmops","llms","machine-learning","openai","prompt-engineering","python","question-answering","vector-database"],"archived":false,"github_pushed_at":"2025-02-20T16:53:45+00:00","url":"https://www.graphcanon.com/tools/stoyan-stoyanov-llmflows","markdown_url":"https://www.graphcanon.com/tools/stoyan-stoyanov-llmflows.md","api_url":"https://www.graphcanon.com/api/graphcanon/tools/stoyan-stoyanov-llmflows","graph_url":"https://www.graphcanon.com/api/graphcanon/graph?tool=stoyan-stoyanov-llmflows","description":"LLMFlows - Simple, Explicit and Transparent LLM Apps","homepage_url":"https://llmflows.readthedocs.io","license":"MIT","open_issues":19,"watchers":10,"ai_summary":"LLMFlows is a framework in Python aimed at facilitating the creation of explicit and transparent AI applications powered by Large Language Models (LLMs). It supports building chatbots, Q&A systems, and similar applications without hidden prompts or calls.","readme_excerpt":"<p align=\"center\">\n  <img src=\"https://github.com/stoyan-stoyanov/llmflows/blob/main/docs/logo_with_subheading.png\"/>\n</p>\n\n\n\n\n\n\n\n\n\nDocumentation: <a href=\"https://llmflows.readthedocs.io/\" target=\"_blank\">https://llmflows.readthedocs.io</a></br>\nPyPI: <a href=\"https://pypi.org/project/llmflows/\" target=\"_blank\">https://pypi.org/project/llmflows</a></br>\nTwitter: <a href=\"https://twitter.com/LLMFlows/\" target=\"_blank\">https://twitter.com/LLMFlows</a></br>\nSubstack: <a href=\"https://llmflows.substack.com/\" target=\"_blank\">https://llmflows.substack.com</a></br>\n\n## 🤖 About LLM Flows\nLLMFlows is a framework for building simple, explicit, and transparent LLM(Large Language Model) applications such as chatbots, question-answering systems, and agents.\n\nAt 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. \n\n\n## 📦 Installation\n```\npip install llmflows\n```\n\n## 🧭 Philosophy\n\n### **Simple**\nOur goal is to build a simple, well-documented framework with minimal abstractions that \nallow users to build flexible LLM-powered apps without compromising on capabilities.\n\n### **Explicit**\nWe want to create an explicit API enabling users to write clean and readable code while \neasily creating complex flows of LLMs interacting with each other. LLMFlows' classes \ngive users full control and do not have any hidden prompts or LLM calls. \n\n### **Transparent**\nWe aim to help users have full transparency on their LLM-powered apps by providing \ntraceable flows and complete information for each app component, making it easy to \nmonitor, maintain, and debug.\n\n## ▶️ Live Demo\nCheck out [LLM-99](https://llm-99.vercel.app/) - a demo app that uses LLMs to explain \nsuperconductors in simple terms. The app is built with LLMFlows, and FastAPI and uses \nPinecone to store document embeddings created from Wikipedia articles. You can find \nthe source code for this demo app and other examples in our \n[examples folder](https://github.com/stoyan-stoyanov/llmflows/tree/main/examples/llmflows_in_fastapi/superconductor).\n\n\n\n## 🧪 Getting Started\n### LLMs\nLLMs are one of the main abstractions in LLMFlows. LLM classes are wrappers around LLM \nAPIs such as OpenAI's APIs. They provide methods for configuring and calling these APIs, \nretrying failed calls, and formatting the responses.\n\n```python\nfrom llmflows.llms import OpenAI\n\nllm = OpenAI(api_key=\"<your-openai-api-key>\")\n\nresult, call_data, model_config = llm.generate(\n   prompt=\"Generate a cool title for an 80s rock song\"\n)\n```\n\n\n### PromptTemplates\nThe `PromptTemplate` class allows us to create strings with variables that we can fill \nin dynamically later on. Once a prompt template object is created an actual prompt can \nbe generated by providing the required variables.\n\n```python\nfrom llmflows.llms import OpenAI\nfrom llmflows.prompts import PromptTemplate\n\n\nprompt_template = PromptTemplate(\n    prompt=\"Generate a title for a 90s hip-hop song about {topic}.\"\n)\nllm_prompt = prompt_template.get_prompt(topic=\"friendship\")\n\nprint(llm_prompt)\n\nllm = OpenAI(api_key=\"<your-openai-api-key>\")\nsong_title = llm.generate(llm_prompt)\n\nprint(song_title)\n```\n\n### Chat LLMs\nUnlike regular LLMs that only require a prompt to generate text, chat LLMs require a \nconversation history. The conversation history is represented \nas a list of messages between a user and an assistant. This conversation history is \nsent to the model, and a new message is generated based on it.\n\nLLMFlows provides a `MessageHistory` class to manage the required conversation history \nfor chat LLMs.\n\nYou can build a simple chatbot by using the `OpenAIChat` and `MessageHistory` classes:\n\n```python\nfrom llmflows.llms import OpenAIChat, MessageHistory\n\nllm = OpenAIChat(api_key=\"<your-openai-api-key>\")\nmessage_hist","github_created_at":"2023-06-26T01:24:15+00:00","created_at":"2026-07-07T17:43:21.048018+00:00","updated_at":"2026-07-07T20:16:58.354767+00:00","categories":[{"slug":"inference-serving","name":"Inference & Serving","url":"https://www.graphcanon.com/categories/inference-serving","markdown_url":"https://www.graphcanon.com/categories/inference-serving.md","api_url":"https://www.graphcanon.com/api/graphcanon/categories/inference-serving"},{"slug":"developer-tools","name":"Developer Tools","url":"https://www.graphcanon.com/categories/developer-tools","markdown_url":"https://www.graphcanon.com/categories/developer-tools.md","api_url":"https://www.graphcanon.com/api/graphcanon/categories/developer-tools"}],"tags":[{"slug":"vector-database","name":"vector-database"},{"slug":"ai","name":"ai"},{"slug":"question-answering","name":"question-answering"},{"slug":"gpt-4","name":"gpt-4"},{"slug":"chatgpt","name":"chatgpt"},{"slug":"llm-inference","name":"llm-inference"},{"slug":"prompt-engineering","name":"prompt-engineering"}]}}