Mirascope Frog Logo
Mirascope
DocsBlogPricingCloud
⌘K
Type to search
⌘Kto search
Escto close
mirascope
v1.25.7
1.3k
Join our
WelcomeLearnGuidesAPI Referencev1 (Legacy)
LLMOps
OverviewConfigurationTracingSessionsSpansVersioningLLM InstrumentationContext Propagation
# Ops Module <div className="badge-container"> <a href="https://github.com/Mirascope/mirascope/actions/workflows/ci.yml" target="_blank"><img src="https://github.com/Mirascope/mirascope/actions/workflows/ci.yml/badge.svg?branch=main" alt="Tests"/></a> <a href="https://app.codecov.io/github/Mirascope/mirascope" target="_blank"><img src="https://codecov.io/github/Mirascope/mirascope/graph/badge.svg?token=HAEAWT3KC9" alt="Coverage"/></a> <a href="https://pypi.org/project/mirascope/" target="_blank"><img src="https://img.shields.io/pypi/v/mirascope.svg" alt="PyPI Version"/></a> <a href="https://pypi.org/project/mirascope/" target="_blank"><img src="https://img.shields.io/pypi/pyversions/mirascope.svg" alt="Python Versions"/></a> <a href="https://github.com/Mirascope/mirascope/blob/main/python/LICENSE" target="_blank"><img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="License"/></a> </div> The `mirascope.ops` module provides observability and management capabilities for LLM applications. It enables distributed tracing, function versioning, and session management with seamless integration into [Mirascope Cloud](https://mirascope.com). ## Core Concepts | Concept | Description | | --- | --- | | [Configuration](/docs/ops/configuration) | Connect to Mirascope Cloud or other backends | | [Tracing](/docs/ops/tracing) | Track function execution with `@ops.trace` | | [Sessions](/docs/ops/sessions) | Group related traces with `ops.session()` | | [Spans](/docs/ops/spans) | Create explicit spans with `ops.span()` | ## Advanced Topics | Topic | Description | | --- | --- | | [Versioning](/docs/ops/versioning) | Track function versions with `@ops.version` | | [LLM Instrumentation](/docs/ops/instrumentation) | Automatic tracing for LLM calls | | [Context Propagation](/docs/ops/context-propagation) | Distributed tracing across services | ## Quick Start 1. Install dependencies: ```bash pip install "mirascope[otel]" ``` 2. Set your Mirascope Cloud API key: ```bash export MIRASCOPE_API_KEY="your-api-key" ``` 3. Configure and trace your functions: ```python from mirascope import llm, ops # Configure Mirascope Cloud (uses MIRASCOPE_API_KEY env var) ops.configure() @ops.trace @llm.call("openai/gpt-4o-mini") def recommend_book(genre: str) -> str: return f"Recommend a {genre} book" # All calls are traced and sent to Mirascope Cloud response = recommend_book("fantasy") print(response.text()) ``` ## OpenTelemetry Compatible The ops module is built on [OpenTelemetry](https://opentelemetry.io/), so you can also export traces to any OTEL-compatible backend (Jaeger, Zipkin, Grafana, etc.). See [Configuration](/docs/ops/configuration) for details. ## Next Steps - [Configuration](/docs/ops/configuration) — Set up Mirascope Cloud or other backends - [Tracing](/docs/ops/tracing) — Learn about the `@ops.trace` decorator

On this page

On this page

© 2026 Mirascope. All rights reserved.

Mirascope® is a registered trademark of Mirascope, Inc. in the U.S.

Privacy PolicyTerms of Use