Generate synthetic data with Gemini Flash
synthetic_data · Built-in action recipeGenerate diverse synthetic examples from a plain-English task description using Google Gemini Flash, write them as a JSONL file and register the result as an Input asset on the cluster.
If you've connected Ellf to your coding assistant, it can set up the action for you: it knows the recipe's settings, can create the datasets and assets it needs and will ask you about anything it can't work out itself.
✳︎Claude Code: Setting up an action
› Set up an Ellf action using the Generate synthetic data with Gemini Flash recipe (synthetic_data) and help me choose the right settings for my data.- In the app, go to ActionsNew action.
- Select the Generate synthetic data with Gemini Flash recipe under Data.
- Fill in the form – you'll need to provide Task description, Gemini API key, Asset name and Asset path. Everything else has sensible defaults.
- Create the action. It starts on your cluster straight away.
API key needed
This recipe needs your Gemini API key. Add it as a secret on your cluster and select it in the form.
Create the action with ellf actions create and the recipe name. All settings from the form are available as arguments. To view all recipe arguments, run ellf actions create synthetic_data --help.
$ellfactionscreatesynthetic_data--name--task-description--gemini-api-key--output-name--output-path...| Argument | Type | Description | Default |
|---|---|---|---|
--name | str | Name of the action | None |
--task-description | str | Task description: Plain-English description of the data you want. e.g. 'customer support tickets about billing problems' or 'short social media posts expressing positive, negative or neutral sentiment about smartphones'. | |
--labels | List[str] | Labels: If provided, each example is assigned one of these labels and stored as a labeled text classification example. | None |
--seed-examples | List[str] | Seed examples: Real examples shown to the model as few-shot demonstrations. Improves quality and style consistency. | None |
--n-examples | int | Number of examples: Total number of synthetic examples to generate. | 100 |
--gemini-api-key | str | Gemini API key: Your Google AI API key, stored as an Ellf secret. | |
--model | str | Gemini model name: Gemini Flash variant, e.g. gemini-2.5-flash. | "gemini-2.5-flash" |
--output-name | str | Asset name: Name to register the new Input asset under. | |
--output-path | str | Asset path: Cluster path to write the synthetic JSONL to, e.g. local:///data/synthetic/tickets.jsonl or an s3:// / gs:// URL. | |
--output-version | str | Asset version: Semantic version for the new asset. | "0.0.1" |
--batch-size | int | Examples per request: Number of examples to ask for in each Gemini call. Larger batches are cheaper but may reduce diversity. | 20 |
--temperature | float | Sampling temperature: Higher values produce more varied output. | 1 |
--project-id | str | Project ID to add action to. Defaults to your saved project. | None |
--worker-class | str | Worker class to launch the action on, as configured on your cluster | None |