> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fiddler.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Multimodal Support (Fiddler OTel SDK)

> Send images and documents alongside text prompts for multimodal evaluation

> [!NOTE]
>
> This capability is currently in [private preview](https://docs.fiddler.ai/reference/feature-maturity-definitions.md#private-preview) and is not yet available to all customers. Contact your Fiddler Customer Success Manager to request access.

Send images, PDFs, and other file content alongside text prompts in your traced LLM calls. Fiddler preserves multimodal content through the ingestion pipeline so vision-capable evaluators can inspect it downstream.

> [!NOTE]
>
> `normalize_multimodal=True` uploads media with a call that an **Entire Org** [service account](https://docs.fiddler.ai/reference/access-control/service-accounts.md) key can't make.
> With an Entire Org service account key, the upload is rejected with **403 Forbidden** and the SDK keeps the content inline.
> Use a personal API key, or a **Specific Projects** service account key with **Project Writer** or **Project Admin** in the application's project (that role is what lets it send the traces), when you turn this option on.

## What you'll need

* Fiddler account with multimodal enabled (private preview)
* Python 3.11, 3.12, 3.13, or 3.14
* `fiddler-otel >= 1.2.0`
* A vision-capable LLM (e.g. `gpt-4o`, `claude-3-sonnet`, `gemini-2.5-pro`)

## Quick start

### Step 1: Install

```bash theme={null}
pip install "fiddler-otel>=1.2.0"
```

### Step 2: Initialize with multimodal support

```python theme={null}
from fiddler_otel import FiddlerClient

client = FiddlerClient(
    application_id='your-app-id',
    api_key='your-api-key',
    url='https://your-instance.fiddler.ai',
    normalize_multimodal=True,  # Uploads large inline content to S3 automatically
)
```

### Step 3: Send multimodal content

Use `set_user_prompt()` with an OpenAI-format content array to include images alongside text:

```python theme={null}
import base64
from openai import OpenAI
from fiddler_otel import trace, get_current_span

openai_client = OpenAI()

@trace(as_type='generation', model='gpt-4o', system='openai')
def describe_image(image_path: str, question: str) -> str:
    # Read and encode the image
    with open(image_path, 'rb') as f:
        image_b64 = base64.b64encode(f.read()).decode()

    content = [
        {'type': 'text', 'text': question},
        {'type': 'image_url', 'image_url': {'url': f'data:image/png;base64,{image_b64}'}},
    ]

    # Record the multimodal prompt on the span
    span = get_current_span(as_type='generation')
    if span:
        span.set_user_prompt(content)

    # Call the LLM
    response = openai_client.chat.completions.create(
        model='gpt-4o',
        messages=[{'role': 'user', 'content': content}],
    )
    result = response.choices[0].message.content

    if span:
        span.set_completion(result)
        span.set_usage(
            input_tokens=response.usage.prompt_tokens,
            output_tokens=response.usage.completion_tokens,
        )
    return result

describe_image('receipt.png', 'Extract the total amount from this receipt.')
```

That's it — your multimodal traces are now flowing to Fiddler with image content preserved.

## Content format

Fiddler uses the [OpenAI multimodal content format](https://platform.openai.com/docs/guides/vision) as its canonical representation:

* **Text-only messages** — pass a plain string to `set_user_prompt()`. No changes needed; this is fully backward compatible.
* **Multimodal messages** — pass a list of content parts:

```python theme={null}
# Text part
{'type': 'text', 'text': 'Describe this image'}

# Image part (inline base64)
{'type': 'image_url', 'image_url': {'url': 'data:image/png;base64,iVBOR...'}}
```

When `normalize_multimodal=True`, the SDK automatically uploads large inline base64 content (over \~100 KB) to S3 and replaces it with lightweight `fiddler-file://` URIs before export. This keeps spans well under the 10 MB OTel span limit. If the upload fails, the SDK logs a warning and keeps the inline content — no data is lost.

## What's next?

* [**Multimodal Evaluators**](https://docs.fiddler.ai/evaluate-and-test/multimodal-evaluators.md) — Supported models, content limits, and evaluation use cases
* [**Fiddler OTel SDK**](https://docs.fiddler.ai/integrations/agentic-ai/fiddler-otel-sdk.md) — General SDK setup, instrumentation methods, and advanced usage
* [**FiddlerClient API Reference**](https://docs.fiddler.ai/sdk-api/otel/fiddler-client.md) — Full parameter reference including `normalize_multimodal`
