Skip to main content
Python autoinstrumentation library for MistralAI’s Python SDK. The traces emitted by this instrumentation are fully OpenTelemetry compatible and can be sent to an OpenTelemetry collector for viewing, such as Arize Phoenix.

Installation

Quickstart

This example shows how to instrument a program that uses the MistralAI chat completions API and observe the traces via Arize Phoenix. Install packages:

Start Phoenix server

Start the phoenix server so that it is ready to collect traces. The Phoenix server runs entirely on your machine and does not send data over the internet.

Setup instrumentation

In a python file, setup the MistralAIInstrumentor and configure the tracer to send traces to Phoenix:

Set API key

Set the MISTRAL_API_KEY environment variable to authenticate with the MistralAI API:

Run your application

Visit the Phoenix app at http://localhost:6006 to see your traces.

More Info