Skip to main content

Data Forge

Manage synthetic fine-tuning dataset generation.

Access it as client.data_forge on a Strongly client, or the same path on AsyncStrongly with await. All methods exist on both with identical signatures.

Methods​

All methods​

analytics​

analytics(project_id: str) -> DataForgeAnalytics

Get comprehensive analytics for a project.

Parameters

  • project_id (str): The project ID.

available_models​

available_models() -> list[dict[str, Any]]

List the teacher models: the chat models you may use that are serving.

bulk_action_pairs​

bulk_action_pairs(project_id: str, *, action: str, pair_ids: list[str] | None = None, filters: dict[str, Any] | None = None) -> dict[str, Any]

Perform a bulk action on pairs.

Parameters

  • project_id (str): The project ID.
  • action (str): Action to perform (accept, reject, delete, reset).
  • pair_ids (list[str] | None, optional): Specific pair IDs to act on.
  • filters (dict[str, Any] | None, optional): Filter criteria to select pairs (alternative to pair_ids).

cancel_generation​

cancel_generation(generation_id: str) -> DataForgeGeneration

Cancel a running generation job.

Parameters

  • generation_id (str): The generation ID.

create_project​

create_project(*, name: str, description: str | None = None, chunk_strategy: str | None = None, embedding_model_id: str | None = None) -> DataForgeProject

Create a new Data Forge project.

Parameters

  • name (str): Project name (required).
  • description (str | None, optional): Project description.
  • chunk_strategy (str | None, optional): How its documents are split into chunks: "semantic" (where the meaning shifts, by embedding_model_id), "heading" (one chunk per section), "paragraph" (the default) or "sliding_window" (fixed-size, overlapping windows).
  • embedding_model_id (str | None, optional): Required with "semantic": an embedding model you may use, from embedding_models.

delete_document​

delete_document(project_id: str, document_id: str) -> None

Delete a document and its parsed chunks.

Parameters

  • project_id (str): The project ID.
  • document_id (str): The document ID.

delete_project​

delete_project(project_id: str) -> None

Delete a Data Forge project and all its data.

embedding_models​

embedding_models() -> list[dict[str, Any]]

List the embedding models semantic chunking may use.

The embedding models you may use that are serving, the platform's among them.

export_dataset​

export_dataset(project_id: str, *, format: str = "chatml", include_system_prompt: bool = True, min_quality_score: float | None = None) -> DataForgeExport

Export accepted pairs as a training dataset.

Parameters

  • project_id (str): The project ID.
  • format (str, optional): Export format (chatml or alpaca).
  • include_system_prompt (bool, optional): Include system prompt in ChatML output.
  • min_quality_score (float | None, optional): Minimum quality score filter (0.0-1.0).

Returns

  • DataForgeExport: Export metadata with download URL and version number.

generation_logs​

generation_logs(generation_id: str, *, tail: int = 200) -> dict[str, Any]

Get logs for a generation run.

Parameters

  • generation_id (str): The generation ID.
  • tail (int, optional): Number of recent log entries to return.

list_chunks​

list_chunks(project_id: str, *, limit: int | None = None) -> SyncPaginator[DataForgeChunk]

List a project's chunks, a page at a time as you iterate.

list_documents​

list_documents(project_id: str) -> list[DataForgeDocument]

List all documents in a project.

Parameters

  • project_id (str): The project ID.

list_generations​

list_generations(project_id: str, *, limit: int | None = None) -> SyncPaginator[DataForgeGeneration]

List a project's generation runs, a page at a time as you iterate.

list_pairs​

list_pairs(project_id: str, *, status: str | None = None, quality_min: float | None = None, difficulty: str | None = None, document_id: str | None = None, search: str | None = None, limit: int | None = None) -> SyncPaginator[DataForgePair]

List a project's generated pairs, a page at a time as you iterate.

Parameters

  • status (str | None, optional): Review status: pending, accepted or rejected.
  • quality_min (float | None, optional): The lowest quality score.
  • difficulty (str | None, optional): easy, medium or hard.
  • document_id (str | None, optional): Pairs generated from one source document.
  • search (str | None, optional): Text to search for in the pairs.
  • limit (int | None, optional): The most pairs to yield.

list_projects​

list_projects(*, status: str | None = None, search: str | None = None, limit: int | None = None) -> SyncPaginator[DataForgeProject]

List Data Forge projects with pagination.

Parameters

  • status (str | None, optional): Filter by project status.
  • search (str | None, optional): Search by name or description.
  • limit (int | None, optional): Maximum number of items to return (default: all matching items).

parse_documents​

parse_documents(project_id: str) -> dict[str, Any]

Start parsing/chunking all documents in a project.

Parameters

  • project_id (str): The project ID.

Returns

  • dict[str, Any]: Dict with generation_id and status.

register_document​

register_document(project_id: str, *, filename: str, content_type: str, file_size: int, s3_key: str) -> DataForgeDocument

Register a document after uploading to S3.

Parameters

  • project_id (str): The project ID.
  • filename (str): Document filename.
  • content_type (str): MIME type.
  • file_size (int): File size in bytes.
  • s3_key (str): The S3 key returned from get_upload_url.

retrieve_export​

retrieve_export(project_id: str, version: int) -> DataForgeExport

Get download URL for a specific export version.

Parameters

  • project_id (str): The project ID.
  • version (int): Export version number.

retrieve_generation​

retrieve_generation(generation_id: str) -> DataForgeGeneration

Get a single generation run by ID.

Parameters

  • generation_id (str): The generation ID.

retrieve_project​

retrieve_project(project_id: str) -> DataForgeProject

Get a single Data Forge project by ID.

start_generation​

start_generation(project_id: str, *, teacher_model_id: str, output_format: str, pairs_per_chunk: int | None = None, difficulty_distribution: Mapping[str, Any] | None = None, system_prompt: str | None = None, temperature: float | None = None, style_template: str | None = None, thresholds: Mapping[str, Any] | None = None) -> DataForgeGeneration

Start generating synthetic Q&A pairs from parsed chunks.

Parameters

  • project_id (str): The project ID.
  • teacher_model_id (str): The teacher: a model_id from available_models (a chat model you may use); any other model is refused.
  • output_format (str): The format the pairs are written in: chatml (a messages array) or alpaca (instruction/input/output).
  • pairs_per_chunk (int | None, optional): How many pairs to generate per chunk.
  • difficulty_distribution (Mapping[str, Any] | None, optional): Free-form difficulty mix as fractions, e.g. {"easy": 0.3, "medium": 0.5, "hard": 0.2}.
  • system_prompt (str | None, optional): Custom system prompt for the teacher LLM.
  • temperature (float | None, optional): Sampling temperature for the teacher model.
  • style_template (str | None, optional): Style template applied to generated pairs.
  • thresholds (Mapping[str, Any] | None, optional): Free-form auto-filter thresholds, e.g. {"min_quality_score": 0.7, "min_grounding_score": 0.7}.

update_chunk​

update_chunk(project_id: str, chunk_id: str, *, content: str | None = None, **kwargs) -> dict[str, Any]

Update a chunk's content.

Parameters

  • project_id (str): The project ID.
  • chunk_id (str): The chunk ID.
  • content (str | None, optional): Updated chunk text.

update_pair​

update_pair(pair_id: str, *, question: str | None = None, answer: str | None = None, system_prompt: str | None = None, status: str | None = None, reviewer_notes: str | None = None) -> DataForgePair

Edit a generated pair during review; only the fields given change.

The pair's chat-format messages are rewritten from its question, answer and system prompt, and the edit is recorded as the caller's.

Parameters

  • pair_id (str): The pair's id.
  • question (str | None, optional): The new question (the pair's input).
  • answer (str | None, optional): The new answer (the pair's output).
  • system_prompt (str | None, optional): The system prompt stored with the pair.
  • status (str | None, optional): The review status, such as accepted or rejected.
  • reviewer_notes (str | None, optional): Free-form reviewer notes.

Returns

  • DataForgePair: The pair as saved.

update_project​

update_project(project_id: str, *, name: str | None = None, description: str | None = None, config: Mapping[str, Any] | None = None) -> DataForgeProject

Update a Data Forge project.

Parameters

  • project_id (str): The project ID.
  • name (str | None, optional): New project name.
  • description (str | None, optional): New project description.
  • config (Mapping[str, Any] | None, optional): The project config fields to change (the others keep their values): its generation defaults (output_format, pairs_per_chunk, system_prompt, temperature, max_tokens) and its chunking (chunk_strategy, embedding_model_id, chunk_size, chunk_overlap). It was sent as default_config, which the API refuses.

upload_url​

upload_url(project_id: str, *, filename: str, content_type: str) -> dict[str, Any]

Get a presigned S3 URL for direct browser upload.

Parameters

  • project_id (str): The project ID.
  • filename (str): Name of the file being uploaded.
  • content_type (str): MIME type (e.g. application/pdf).

Returns

  • dict[str, Any]: Dict with upload_url and s3_key.