Skip to content

future-agi/traceAI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

traceAI

traceAI is OSS package to enable standardized tracing of AI applications and frameworks

traceAI is a set of conventions and plugins that integrates seamlessly with OpenTelemetry to instrument and monitor code executions across models, frameworks, and vendors, mapping them to standardized trace attributes.

traceAI is natively supported by Future AGI, but can be used with any OpenTelemetry-compatible backend as well. traceAI provides a set of instrumentations for popular machine learning SDKs and frameworks in a variety of languages like Langchain, OpenAI, Anthropic, and more.

Table of Contents

Features

  • Standardized Tracing: Maps AI workflows to a consistent set of trace attributes and spans.
  • Framework Agnostic: Works with popular AI frameworks like OpenAI, LangChain, Anthropic, and more.
  • OpenTelemetry Integration: Seamlessly integrates with OpenTelemetry-compatible backends.
  • Extensible Plugins: Easily add custom instrumentation for unsupported frameworks.
  • Future AGI Native Support: Optimized for Future AGI's observability platform.

Supported Frameworks

Python

Package Description Version
traceAI-openai traceAI Instrumentation for OpenAI. PyPI
traceAI-anthropic traceAI Instrumentation for Anthropic. PyPI
traceAI-llamaindex traceAI Instrumentation for LlamaIndex. PyPI
traceAI-langchain traceAI Instrumentation for LangChain. PyPI
traceAI-mistralai traceAI Instrumentation for MistralAI. PyPI
traceAI-vertexai traceAI Instrumentation for VertexAI. PyPI
traceAI-crewai traceAI Instrumentation for CrewAI. PyPI
traceAI-haystack traceAI Instrumentation for Haystack. PyPI
traceAI-litellm traceAI Instrumentation for liteLLM. PyPI
traceAI-groq traceAI Instrumentation for Groq. PyPI
traceAI-autogen traceAI Instrumentation for Autogen. PyPI
traceAI-guardrails traceAI Instrumentation for Guardrails. PyPI
traceAI-openai-agents traceAI Instrumentation for OpenAI Agents. PyPI
traceAI-smolagents traceAI Instrumentation for SmolAgents. PyPI
traceAI-dspy traceAI Instrumentation for DSPy. PyPI
traceAI-bedrock traceAI Instrumentation for AWS Bedrock. PyPI
traceAI-instructor traceAI Instrumentation for Instructor. PyPI

Quickstart

Install traceAI OpenAI

pip install traceAI-openai

Set Environment Variables

Set up your environment variables to authenticate with FutureAGI

import os

os.environ["FI_API_KEY"] = FI_API_KEY
os.environ["FI_SECRET_KEY"] = FI_SECRET_KEY
os.environ["OPENAI_API_KEY"] = OPENAI_API_KEY

Register Tracer Provider

Set up the trace provider to establish the observability pipeline. The trace provider:

from fi_instrumentation import register
from fi_instrumentation.fi_types import ProjectType

trace_provider = register(
    project_type=ProjectType.OBSERVE,
    project_name="openai_app"
)

Configure OpenAI Instrumentation

Set up your OpenAI client with built-in observability. This includes support for text, image, and audio models.

from traceai_openai import OpenAIInstrumentor

OpenAIInstrumentor().instrument(tracer_provider=trace_provider)

Create OpenAI Components

Set up your OpenAI client with built-in observability.

import openai

openai.api_key = os.environ["OPENAI_API_KEY"]

response = openai.ChatCompletion.create(
    model="gpt-4o",
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "Can you tell me a joke?"}
    ]
)

print(response.choices[0].message['content'].strip())

Contributing

We welcome contributions from the community! To contribute:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature/your-feature-name).
  3. Commit your changes (git commit -m 'Add your feature').
  4. Push to the branch (git push origin feature/your-feature-name).
  5. Open a pull request.

Resources

Connect With Us

About

Open Source AI Tracing Framework built on Opentelemetry for AI Applications and Frameworks

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 7