Build synthetic datasets
like you build UIs

โœจDeclarative building blocks๐Ÿง AI-powered variationsโš™๏ธTypesafe pipelines

Like React, but for datasets โ€” declarative and typesafe DSL for composing conversations and generating thousands of AI-powered training examples.

dataset.ts
import {
  generateDataset,
  generatedUser,
  generatedAssistant,
  assistant,
  oneOf,
} from "@qforge/torque";
import { openai } from "@ai-sdk/openai";

await generateDataset(
  () => [
    generatedUser({ prompt: "Friendly greeting or introduction" }), // AI generated
    oneOf([
      // pick one randomly (weights are optional)
      { value: assistant({ content: "Hello!" }), weight: 0.3 }, // static
      generatedAssistant({ prompt: "Respond to greeting" }), // AI generated, gets remaining weight
    ]),
    ...times(between(1, 3), [
      generatedUser({
        prompt: "Chat about weather. Optionally mentioning previous message",
      }),
      generatedAssistant({ prompt: "Respond to user. Short and concise." }),
    ]),
  ],
  {
    count: 2, // number of examples
    model: openai("gpt-5-mini"), // any ai-sdk model
    seed: 42, // replayable RNG
    metadata: { example: "quick-start" }, // optional per-row metadata
  }
);
Production feature set

Everything you need to ship datasets continuously

Torque borrows from the best product-engineering playbooks: versioned blueprints, strict typing, reproducible runs, and streaming observability. No YAML, no bespoke tools โ€” just code.

๐ŸŽฏ

Declarative DSL

Compose conversation blueprints like React components, turning dataset design into a predictable, readable workflow.

๐Ÿ”’

Fully Typesafe

Harness Zod-powered typing with end-to-end inference so every AI training workflow stays safe, reliable, and maintainable.

๐Ÿ”Œ

Provider Agnostic

Generate with OpenAI, Anthropic, DeepSeek, vLLM, LLaMA.cpp, or any model supported by your composable data pipeline.

๐Ÿค–

AI-Powered Content

Blend handcrafted prompts with AI dataset generation to produce realistic multi-message conversations at scale.

๐Ÿ’ฐ

Cache Optimized

Reuse context across runs to minimize token spend while keeping dataset scaling fast, efficient, and reproducible.

โšก

Concurrent Execution

Stream progress in a beautiful CLI with concurrent workers, deterministic seeds, and instant feedback loops.

The challenge

Building synthetic datasets for LLMs is tedious

Every team building AI products hits the same roadblocks when trying to create high-quality training data at scale.

๐Ÿ“Š

Sometimes you don't have enough real data

โฑ๏ธ

Maintaining quality and consistency across thousands of examples is extremely time consuming

๐Ÿ”ง

Tool calling patterns require intricate message sequences and are errorโ€‘prone

๐Ÿ”€

Generating different conversation flows means rewriting everything or creating various hard to maintain scripts

๐ŸŽฒ

Designing generators that are random yet reproducible is surprisingly complex

๐Ÿงฉ

Getting AI to understand complex composition scenarios (nested variations, conditional flows) takes significant prompt engineering time

Torque solves this with a declarative approach

The React moment for dataset generation

โš›๏ธ

From imperative to declarative

Just like React transformed UI development from imperative DOM manipulation to composable components, Torque transforms dataset generation from manual JSON editing to declarative schemas.

๐Ÿ’Ž

Optimized for efficiency

Use smaller, cheaper models while benefiting from cache optimization for dramatically lower costs.

๐Ÿ’ก

Write your dataset logic once, generate thousands of variations automatically

The gaps in today's tooling

Dataset creation is still stuck in 2012-era workflows

Torque is built for product teams that expect the same polish from their AI training data as they do from their production apps. First, let's take a quick look at the pain that keeps teams from shipping.

๐Ÿงฑ
pain 01

Manual and time-consuming

Teams hack together prompts in spreadsheets and docs. Scaling to thousands of examples means hours of copy/paste, QA, and regressions.

๐Ÿšจ
pain 02

Impossible to validate

Without types or policy guards, the first time you catch a broken run is when your agent drifts in production โ€” an expensive way to discover bugs.

๐Ÿงญ
pain 03

Hard to iterate

Traditional tooling lacks version control, seeds, or caching. Every update turns into a new round of manual cleanup and token spend.

How Torque helps

From idea to production-ready datasets in three moves

Torque replaces sprawling prompts and brittle scripts with a composable TypeScript toolkit. Every phase is automated, typed, and observable.

โ€œTorque is the missing layer between your product engineers and the models they rely on.โ€
01Stage 1

Compose declarative blueprints

Describe each conversation as a reusable component. Torque keeps prompts, metadata, and policy checks together in strongly typed modules.

Ship new flows faster with versionable building blocks, not ad-hoc scripts.

02Stage 2

Scale with concurrency & caching

Spin up tens of workers, hydrate examples with AI, and cache deterministic seeds so teams get repeatable datasets without wasting tokens.

Every run logs audit trails, token spend, and policy results โ€” plug it straight into CI.

03Stage 3

Evaluate continuously

Replay production traffic through model providers, enforce quality gates, and ship regressions straight into Slack or GitHub checks.

Close the loop with built-in evaluations and targeted retries when policies fail.

Start Building Today

Join developers building the future of LLM training data

๐ŸงฎType-safe by default
๐Ÿš€Minutes to production
โœ…CI-ready datasets
Install with Bunbun add @qforge/torque
Copied!
Install with npmnpm install @qforge/torque
Copied!