https://github.com/lmnr-ai/lmnr Skip to content Navigation Menu Toggle navigation Sign in * Product + Actions Automate any workflow + Packages Host and manage packages + Security Find and fix vulnerabilities + Codespaces Instant dev environments + GitHub Copilot Write better code with AI + Code review Manage code changes + Issues Plan and track work + Discussions Collaborate outside of code Explore + All features + Documentation + GitHub Skills + Blog * Solutions By size + Enterprise + Teams + Startups By industry + Healthcare + Financial services + Manufacturing By use case + CI/CD & Automation + DevOps + DevSecOps * Resources Topics + AI + DevOps + Security + Software Development + View all Explore + Learning Pathways + White papers, Ebooks, Webinars + Customer Stories + Partners * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles Repositories + Topics + Trending + Collections * Enterprise + Enterprise platform AI-powered developer platform Available add-ons + Advanced Security Enterprise-grade security features + GitHub Copilot Enterprise-grade AI features + Premium Support Enterprise-grade 24/7 support * Pricing Search or jump to... Search code, repositories, users, issues, pull requests... Search [ ] Clear Search syntax tips Provide feedback We read every piece of feedback, and take your input very seriously. [ ] [ ] Include my email address so I can be contacted Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly Name [ ] Query [ ] To see all available qualifiers, see our documentation. Cancel Create saved search Sign in Sign up Reseting focus You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert {{ message }} lmnr-ai / lmnr Public * Notifications You must be signed in to change notification settings * Fork 12 * Star 488 Laminar - Open-source DataDog + PostHog for AI agents / RAG apps. Fast, reliable and insightful. Written in Rust . YC S24. www.lmnr.ai License Apache-2.0 license 488 stars 12 forks Branches Tags Activity Star Notifications You must be signed in to change notification settings * Code * Issues 0 * Pull requests 1 * Actions * Projects 0 * Security * Insights Additional navigation options * Code * Issues * Pull requests * Actions * Projects * Security * Insights lmnr-ai/lmnr This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. main BranchesTags Go to file Code Folders and files Last commit Last Name Name message commit date Latest commit History 13 Commits app-server app-server clickhouse clickhouse frontend frontend postgres postgres semantic-search-service semantic-search-service .env .env .gitignore .gitignore LICENSE.md LICENSE.md README.md README.md docker-compose.yml docker-compose.yml View all files Repository files navigation * README * Apache-2.0 license Static Badge X (formerly Twitter) Follow Static Badge Laminar - Open-Source observability, analytics, evals and prompt chains for complex LLM apps. traces Think of it as DataDog + PostHog for LLM apps. * OpenTelemetry-based instrumentation: automatic for LLM / vector DB calls with just 2 lines of code + decorators to track functions (powered by an amazing OpenLLMetry open-source package by TraceLoop). * Semantic events-based analytics. Laminar hosts background job queues of LLM pipelines. Outputs of those pipelines are turned into metrics. For example, you can design a pipeline which extracts "my AI drive-through agent made an upsell" data, and track this metric in Laminar. * Built for scale with a modern stack: written in Rust, RabbitMQ for message queue, Postgres for data, Clickhouse for analytics * Insightful, fast dashboards for traces / spans / events Read the docs. This is a work in progress repo and it will be frequently updated. Getting started Laminar Cloud The easiest way to get started is with a generous free tier on our managed platform -> lmnr.ai Self-hosting with Docker compose Start local version with docker compose. git clone git@github.com:lmnr-ai/lmnr cd lmnr docker compose up This will spin up the following containers: * app-server - the core app logic, backend, and the LLM proxies * rabbitmq - message queue for sending the traces and observations reliably * qdrant - vector database * semantic-search-service - service for interacting with qdrant and embeddings * frontend - the visual front-end dashboard for interacting with traces * postgres - the database for all the application data * clickhouse - columnar OLAP database for more efficient event and trace analytics Instrumenting Python code First, create a project and generate a Project API Key. Then, pip install lmnr echo "LMNR_PROJECT_API_KEY=" >> .env To automatically instrument LLM calls of popular frameworks and LLM provider libraries just add from lmnr import Laminar as L L.initialize(project_api_key="") In addition to automatic instrumentation, we provide a simple @observe() decorator, if you want to trace inputs / outputs of functions Example import os from openai import OpenAI from lmnr import observe, Laminar as L L.initialize(project_api_key="") client = OpenAI(api_key=os.environ["OPENAI_API_KEY"]) @observe() # annotate all functions you want to trace def poem_writer(topic="turbulence"): prompt = f"write a poem about {topic}" response = client.chat.completions.create( model="gpt-4o", messages=[ {"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": prompt}, ], ) poem = response.choices[0].message.content return poem if __name__ == "__main__": print(poem_writer(topic="laminar flow")) Sending events You can send events in two ways: * .event(name, value) - instant event with a value. * .evaluate_event(name, evaluator, data) - event that is evaluated by evaluator pipeline based on the data. Note that to run an evaluate event, you need to crate an evaluator pipeline and create a target version for it. Laminar processes background job queues of pipeline processes and records outputs of pipelines as events. Read our docs to learn more about event types and how they are created and evaluated. from lmnr import Laminar as L # ... poem = response.choices[0].message.content # this will register True or False value with Laminar L.event("topic alignment", topic in poem) # this will run the pipeline `check_wordy` with `poem` set as the value # of `text_input` node, and write the result as an event with name # "excessive_wordiness" L.evaluate_event("excessive_wordiness", "check_wordy", {"text_input": poem}) Laminar pipelines as prompt chain managers You can create Laminar pipelines in the UI and manage chains of LLM calls there. After you are ready to use your pipeline in your code, deploy it in Laminar by selecting the target version for the pipeline. Once your pipeline target is set, you can call it from Python in just a few lines. from lmnr import Laminar as L L.initialize('') result = l.run( pipeline = 'my_pipeline_name', inputs = {'input_node_name': 'some_value'}, # all environment variables env = {'OPENAI_API_KEY': 'sk-some-key'}, ) Learn more To learn more about instrumenting your code, check out our client libraries: NPM Version PyPI - Version To get deeper understanding of the concepts, follow on to the docs and tutorials. About Laminar - Open-source DataDog + PostHog for AI agents / RAG apps. Fast, reliable and insightful. Written in Rust . YC S24. www.lmnr.ai Topics ai rust-lang developer-tools agents observability blazingly-fast aiops rag Resources Readme License Apache-2.0 license Activity Custom properties Stars 488 stars Watchers 3 watching Forks 12 forks Report repository Releases 2 tags Packages 0 No packages published Contributors 4 * @dinmukhamedm dinmukhamedm * @temirrr temirrr Temirlan Myrzakhmetov * @skull8888888 skull8888888 * @rockerBOO rockerBOO Dave Lage Languages * TypeScript 51.5% * Rust 43.8% * PLpgSQL 3.9% * Dockerfile 0.3% * CSS 0.2% * JavaScript 0.2% * Shell 0.1% Footer (c) 2024 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact * Manage cookies * Do not share my personal information You can't perform that action at this time.