Getting Claude 3.7 Sonnet's Reasoning traces
You can use Sonnet reasoning model in Curator to generate synthetic data. In this example, we will answer some questions with reasoning traces from claude sonnet 3.7, but the approach can be adapted for any data generation task.
Prerequisites
Python 3.10+
Curator: Install via
pip install bespokelabs-curator
Anthropic: Anthropic API key
Steps
1. Setup environment vars
2. Create a curator.LLM subclass
Create a class that inherits from curator.LLM
. Implement two key methods:
prompt()
: Generates the prompt for the LLM.parse()
: Processes the LLM's response into your desired format.
Here’s the implementation:
3. Configure the Anthropic model
4. Generate Data
Generate the structured data and output the results as a pandas DataFrame:
Example Output
Using the above example, the output might look like this:
How to solve for world peace?
This is a question about solving for world pea...
The Path to World Peace\n\nWorld peace is on...
What is the fifteenth prime number?
Let me list out the prime numbers in order to ...
The fifteenth prime number is 47.\n\nThe seque...
Api Reference
Check out complete configuration
Last updated