Skip to main content

1-8d2861cb

open-agentinstruct

An open-source recreation of the AgentInstruct agentic workflow.

open-agentinstruct is a project aimed at recreating the AgentInstruct agentic workflow. It supports any LiteLLM model to be used in the agentic synthetic data generation worflow. The AgentInstruct workflow involves three agentic step for synthetic data generation based on "seed" data:

  • Content Transformation: Transforms text content using various agent configurations.
  • Instruction Generation: Generates instructions based on transformed content.
  • Instruction Refinement: Refines generated instructions to enhance complexity and challenge.

Table of Contents

Supported tasks

The AgentInstruct paper implements the following tasks which are all implemented in open-agentinstruct:

  • Reading Comprehension
  • Open Domain Question Answering
  • Text Modification
  • Web Agent
  • Brain Teaser
  • Analytical Reasoning
  • Multiple Choice Questions
  • Data To Text
  • Fermi
  • Coding
  • Text Extraction
  • Text Classification
  • Retrieval Augmented Generation
  • Tool Use
  • Creative Content Generation
  • Few Shot Reasoning
  • Conversation

Supported seed datasets

Features

  • LiteLLM compatible LLMs

Security and supported Python versions

Use Python 3.11–3.14. Security hardening uses a reviewed LiteLLM backport and patched dependency minimums; reproducible development installs use uv sync --locked --all-extras --group dev. See SECURITY.md and the release/security guide. PyPI publishing requires verified trusted-publisher setup and is explicitly blocked until that setup is complete. The already-published 0.1.0 release does not receive source changes automatically.

Installation

Option 1: Install from PyPI (Recommended for users)

Once the package is published, you can install it directly using pip:

pip install open-agentinstruct

Option 2: Install from source (For developers)

  1. Clone the repository:

    git clone https://github.com/ThomasRochefortB/open-agentinstruct.git
    cd open-agentinstruct
    
  2. Create a virtual environment (recommended):

    python -m venv .venv
    source .venv/bin/activate # On Windows use `.venv\Scripts\activate`
    
  3. Install the package in editable mode along with development dependencies:

    pip install -e ".[dev]"
    
  4. Set up your API keys necessary to use the desired LiteLLM model(s):

    • Create a .env file in the root directory (or wherever you run the command).
    • Add your API key(s) to the .env file (the library uses python-dotenv to load them):
      # Example for OpenAI
      OPENAI_API_KEY=your_openai_api_key
      # Add other keys as needed (e.g., COHERE_API_KEY, ANTHROPIC_API_KEY)
      # ...
      

Usage

The primary way to use the data generation workflow is through the command-line interface:

# Basic usage with a Hugging Face dataset
open-agentinstruct-generate --dataset-names <hf/datasetname> --task-name <your_task_name>

# Example: Generate reading comprehension data from the first 100 chunks of openstax
open-agentinstruct-generate --dataset-names "crumb/openstax-text" --task-name reading_comprehension --max-chunks 100

# Generate data for all tasks from the specified dataset, processing max 100 chunks, skipping refinement, including content
open-agentinstruct-generate --dataset-names "crumb/openstax-text:text:train:20000" --model gemini/gemini-2.0-flash --max-chunks 100 --output-dir ./output

# Example: Generate data for all tasks from a PDF directory, including original content
open-agentinstruct-generate --pdf-dir path/to/your/pdfs --all-tasks --include-content

# See all available options
open-agentinstruct-generate --help

Generated data will be saved to ./data/generated_data/<task_name>.jsonl by default.

Metadata

Release files for open-agentinstruct 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for open-agentinstruct 0.1.1
File Size Uploaded Provenance Actions
open_agentinstruct-0.1.1.tar.gz 96.6 kB With provenance Details for open_agentinstruct-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for open-agentinstruct 0.1.1
File Interpreter ABI Platform Actions
open_agentinstruct-0.1.1-py3-none-any.whl Python 3 none any Details for open_agentinstruct-0.1.1-py3-none-any.whl

Total release size: 212.0 kB

Release files / open_agentinstruct-0.1.1.tar.gz

Download URL open_agentinstruct-0.1.1.tar.gz
Size 96.6 kB
Tags Source
SHA-256 checksum
How to use checksums
bd8cb2144341ef817905804c77c0b48aaee5ed9aa91f434da7a11b1176772ad8
BLAKE2b-256 checksum
How to use checksums
c70ebe47f7af76500b1b1d3e1a2fb3ed7729aa8d0ff5f30b698f0d4b9b36407e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.

Transparency log

Release files / open_agentinstruct-0.1.1-py3-none-any.whl

Download URL open_agentinstruct-0.1.1-py3-none-any.whl
Size 115.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cb703986c07680d5caf73afeaa26608fa66471d22df0deb0b09c2d44a0445529
BLAKE2b-256 checksum
How to use checksums
e23db42806d6c05f43ab1e559e56c6a87be9a65506e7c326b283bf820dcef3a1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.

Transparency log

Security for open-agentinstruct 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for open_agentinstruct-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page