Skip to main content

moda-ai

Moda's Python SDK for LLM observability with automatic conversation threading. Built on OpenTelemetry.

Installation

pip install moda-ai

Quick Start

import moda
from openai import OpenAI

moda.init("YOUR_MODA_API_KEY")

# Set conversation ID for your session (recommended)
moda.conversation_id = "session_" + session_id

client = OpenAI()
response = client.chat.completions.create(
    model="gpt-4",
    messages=[{"role": "user", "content": "Hello!"}]
)

moda.flush()

Conversation Tracking

Setting Conversation ID (Recommended)

For production use, explicitly set a conversation ID to group related LLM calls:

# Property-style (recommended)
moda.conversation_id = "support_ticket_123"
client.chat.completions.create(...)
moda.conversation_id = None  # clear when done

# Or use the setter function
moda.set_conversation_id_value("support_ticket_123")
moda.set_conversation_id_value(None)  # clear

# Or use context manager (scoped)
with moda.set_conversation_id("support_ticket_123"):
    client.chat.completions.create(...)

Setting User ID

Associate LLM calls with specific users:

moda.user_id = "user_12345"
client.chat.completions.create(...)
moda.user_id = None  # clear

Automatic Fallback

If you don't set a conversation ID, the SDK automatically computes one from the first user message and system prompt. This works for simple use cases but explicit IDs are recommended for production.

Full Documentation

See the main repository README for complete documentation.

Metadata

Release files for moda-ai 0.1.4.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for moda-ai 0.1.4.2
File Size Uploaded
moda_ai-0.1.4.2.tar.gz 319.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for moda-ai 0.1.4.2
File Interpreter ABI Platform
moda_ai-0.1.4.2-py3-none-any.whl Python 3 none any Details

Total release size: 407.8 kB

Release files / moda_ai-0.1.4.2.tar.gz

Download URL moda_ai-0.1.4.2.tar.gz
Size 319.8 kB
Tags Source
SHA-256 checksum
How to use checksums
bd777c09d09b6c5f21bf61d5214d461568796250e81594cbcab6ef6e65790dd7
BLAKE2b-256 checksum
How to use checksums
bb9b265514b871836ff34dd34767e669fb1a92430edb69955013f46796c508cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 8, 2026.

Transparency log

Release files / moda_ai-0.1.4.2-py3-none-any.whl

Download URL moda_ai-0.1.4.2-py3-none-any.whl
Size 88.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8816cf1a5ca5b245349335a81c4ec02eb5aa3d682b63ff5cecd97225a0f1658c
BLAKE2b-256 checksum
How to use checksums
e0390b224eb8f77039b912e6623ce2ed6da76602ee240a2780c6f8afb665ab85
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 8, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.4.2 This release

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page