Skip to content

Monocle is a framework for tracing GenAI app code. This repo contains implementation of Monocle for GenAI apps written in typescript

License

Notifications You must be signed in to change notification settings

monocle2ai/monocle-typescript

Monocle for tracing GenAI app code

Monocle helps developers and platform engineers building or managing GenAI apps monitor these in prod by making it easy to instrument their code to capture traces that are compliant with open-source cloud-native observability ecosystem.

Monocle is a community-driven OSS framework for tracing GenAI app code governed as a Linux Foundation AI & Data project.

Why Monocle

Monocle is built for:

  • app developers to trace their app code in any environment without lots of custom code decoration
  • platform engineers to instrument apps in prod through wrapping instead of asking app devs to recode
  • GenAI component providers to add observability features to their products
  • enterprises to consume traces from GenAI apps in their existing open-source observability stack

Benefits:

  • Monocle provides an implementation + package, not just a spec
    • No expertise in OpenTelemetry spec required
    • No bespoke implementation of that spec required
    • No last-mile GenAI domain specific code required to instrument your app
  • Monocle provides consistency
    • Connect traces across app code executions, model inference or data retrievals
    • No cleansing of telemetry data across GenAI component providers required
    • Works the same in personal lab dev or org cloud prod environments
    • Send traces to location that fits your scale, budget and observability stack
  • Monocle is fully open source and community driven
    • No vendor lock-in
    • Implementation is transparent
    • You can freely use or customize it to fit your needs

What Monocle provides

  • Easy to use code instrumentation
  • OpenTelemetry compatible format for spans.
  • Community-curated and extensible metamodel for consistent tracing of GenAI components.
  • Export to local and cloud storage

Use Monocle

  • Get the Monocle package
    npm install --save monacle2ai
  • Instrument your app code
    const { setupMonocle } = require("monacle2ai")
    setupMonocle("your-app-name")

Roadmap

Goal of Monocle is to support tracing for apps written in any language with any LLM orchestration or agentic framework and built using models, vectors, agents or other components served up by any cloud or model inference provider.

Current version supports:

  • Language: (🟢) Typescript
  • LLM-frameworks: (🟢) Langchain, (🟢) Llamaindex, (🟢) OpenAI,
  • Exporter: (🟢) stdout, (🟢) file, (🟢) Azure Blob Storage, (🟢) AWS S3

Get involved

Provide feedback

  • Submit issues and enhancements requests via Github issues

Contribute

  • Monocle is community based open source project. We welcome your contributions. Please refer to the CONTRIBUTING and CODE_OF_CONDUCT for guidelines. The contributor's guide provides technical details of the project.

About

Monocle is a framework for tracing GenAI app code. This repo contains implementation of Monocle for GenAI apps written in typescript

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •