> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://www.comet.com/docs/opik/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://www.comet.com/docs/opik/_mcp/server.

# Synthetic Data Optimizer Cookbook

> Learn how to generate synthetic Q&A data from Opik traces and optimize prompts using the MetaPromptOptimizer through an interactive notebook.

This page is a high-level entry point for the synthetic data workflow. Use the notebook or SDK script to run the full example end-to-end.

## Launch the example

The notebook is the fastest way to explore synthetic data optimization in your browser.

| Platform                     | Launch Link                                                                                                                                                                                                   |
| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Google Colab (Preferred)** | [![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/comet-ml/opik/blob/main/sdks/opik_optimizer/notebooks/OpikSyntheticDataOptimizer.ipynb) |
| **GitHub**                   | [View the notebook on GitHub](https://github.com/comet-ml/opik/blob/main/sdks/opik_optimizer/notebooks/OpikSyntheticDataOptimizer.ipynb)                                                                      |

## What this example covers

* Generating synthetic Q\&A datasets from Opik traces
* Using TinyQA (via [tinyqabenchmarkpp](https://pypi.org/project/tinyqabenchmarkpp/)) and variants like TinyQA++
* Optimizing prompts with MetaPrompt on synthetic data
* Reviewing results in the Opik UI

## Where the full implementation lives

Notebook: [`sdks/opik_optimizer/notebooks/OpikSyntheticDataOptimizer.ipynb`](https://github.com/comet-ml/opik/blob/main/sdks/opik_optimizer/notebooks/OpikSyntheticDataOptimizer.ipynb)

SDK codebase: browse `sdks/opik_optimizer/` for dataset utilities, metrics, and optimizer implementations.

## Next steps

* Run the notebook and swap in your own traces or datasets.
* Explore [Define datasets](/development/optimization-runs/optimization/define_datasets) and [Define metrics](/development/optimization-runs/optimization/define_metrics) for deeper control.