PyMAX Terms of Use

This repository is publicly accessible, but you have to accept the conditions to access its files and content.

IMPORTANT: By requesting access to PyMAX, you confirm that you have read and agree to the following terms:

  1. Free Use: You may use this dataset for any purpose, including commercial, academic, or personal projects, free of charge. 2. Mandatory Attribution: If you use PyMAX in your research, to train a model, or in any publication, you MUST explicitly mention "PyMAX by Inserloft Research (Research.Inserloft.com)" in the System Card, Model Card, or documentation where you cite public datasets used.

Log in or Sign Up to review the conditions and access this dataset content.

PyMAX Banner

The largest synthetic Python dataset for training and fine-tuning LLMs.

Examples Format License Size Generator


πŸ“– Overview

PyMAX is a massive, high-quality synthetic dataset of 500 million Python code examples created by Inserloft Research. It is specifically designed to train and fine-tune Large Language Models (LLMs) specialized in programming, code generation, and software development tasks.

This dataset bridges the gap between general-purpose models and specialized coding models, providing an unprecedented volume of Python-specific training data in a clean, structured, and ready-to-use format. PyMAX is not just a collection of prompts and responses; it is a foundational-grade dataset enriched with technical metadata, syntactic validation, and conversational alignment for modern LLMs.


πŸ”₯ Key Features

Feature Description
Scale 500,000,000 examples (100 Parquet shards)
Languages English (50%) & Spanish (50%)
Format Parquet (Snappy compression), optimized for streaming
Size ~60 GB compressed
Generator Enhanced Python script leveraging multiprocessing and AST analysis
Topics Basic syntax, OOP, data structures, algorithms, web dev, snippets, etc.
Structure Prompt, Response, Code, Explanation, Metadata, Messages, Test Code, Safety Flags
Validation Automatic syntactic validation via ast.parse
Metadata Complexity scores, imports, docstring detection, algorithmic complexity, tags
Quality 100% synthetic generation with rigorous filtering and deduplication
Use Cases Code LLMs, fine-tuning, instruction tuning, RLHF, evaluation

🎯 Use Cases

  • Fine-tuning Code LLMs: Train models like CodeLlama, StarCoder, or custom architectures.
  • Instruction Tuning: Build models that understand natural language programming instructions.
  • Benchmarking: Evaluate coding capability of LLMs.
  • Education: Create AI tutors for Python learning.
  • Research: Study code generation, program synthesis, and software engineering.
  • Execution-Based Evaluation: Leverage included test cases for pass/fail scoring.
  • Safety-Aware Training: Filter examples using the built-in is_safe flag.

πŸ“Š Dataset Structure

Each example in PyMAX contains the following fields:

Field Type Description
prompt string A question or instruction about Python (English or Spanish)
response string Detailed explanation followed by code block
code string The raw source code
explanation string Textual explanation of the code
messages list Conversational format (ChatML): [{"role": "user", "content": prompt}, {"role": "assistant", "content": response}]
test_code string Validation code (assertions) for execution-based checking
metadata dict Contains: topic, subtopic, difficulty, language, python_version
syntax_valid bool Whether the code passes ast.parse (always True after filtering)
imports list List of all imported libraries extracted from the AST
has_docstring bool Whether the main module/function/class includes a docstring
complexity_score int Sum of lines of code + number of AST nodes
hash string SHA-256 hash of prompt + response for deduplication
time_complexity string Algorithmic time complexity (e.g., "O(N)")
space_complexity string Algorithmic space complexity (e.g., "O(1)")
code_length int Number of characters in the code field
tags list Array combining topic, subtopic, and difficulty (e.g., ["data_structures", "lists", "beginner"])
is_safe bool Whether the code avoids dangerous calls (eval, exec, os.system, subprocess)

πŸ—‚οΈ Topics Covered

  • Basic Syntax: Variables, operators, data types.
  • Control Structures: Conditionals, loops, comprehensions.
  • Functions: Definitions, decorators, generators, closures.
  • OOP: Classes, inheritance, polymorphism, magic methods.
  • Data Structures: Lists, dicts, sets, tuples, custom structures.
  • Algorithms: Sorting, searching, dynamic programming.
  • File I/O: Reading/writing files, serialization.
  • Web Development: Flask, Django, FastAPI basics.
  • Testing: Unit tests, mocking, pytest.
  • Concurrency: Threading, asyncio, multiprocessing.
  • Snippets: Short modular code blocks (utilities, math ops, list manipulations) for focused training.

πŸš€ How to Use

Installation

# Install datasets library
pip install datasets

# Load PyMAX (requires access approval)
from datasets import load_dataset

dataset = load_dataset("Inserloft/PyMAX", split="train")

Access a Single Example

example = dataset[0]
print(example["prompt"])
print(example["code"])
print(example["messages"])       # Conversational format
print(example["test_code"])      # Assertions for validation
print(example["time_complexity"])# "O(N)"

Stream Large Batches

from datasets import load_dataset

dataset = load_dataset("Inserloft/PyMAX", split="train", streaming=True)
for batch in dataset.iter(batch_size=1000):
    process(batch)

πŸ“‹ Technical Details

Metric Value
Total Examples 500,000,000
Languages English (50%), Spanish (50%)
Format Parquet (Snappy compression)
Compressed Size ~60 GB
Number of Shards 100 (each ~5 million examples)
Generation Time ~1.3 hours (4770 seconds) on 48-core infrastructure
Parallelism multiprocessing.Pool with 48 workers
Batch Size 5,000,000 rows per batch (avoids memory overflow)
Syntax Validation Automated via ast.parse
Deduplication SHA-256 hash of prompt+response
Safety Check Flags dangerous calls (eval, exec, os.system, subprocess)
Python Version Compatibility 3.10+

βš™οΈ Dataset Generation Pipeline

PyMAX was generated using an enhanced Python script by NaNo 3.4 (Inserloft's proprietary AI model). The pipeline includes:

  1. Extreme Parallel Processing: Utilizes multiprocessing.Pool with 48 workers, fully leveraging the available hardware.
  2. Strategic Batching: Data is generated and packaged in stable chunks of 5 million rows per batch, resulting in exactly 100 Parquet files. This prevents OOM errors and enables efficient streaming.
  3. AST Analysis: Each code snippet is parsed using Python's ast module to:
    • Validate syntax (syntax_valid).
    • Extract imports (imports).
    • Detect docstrings (has_docstring).
    • Compute complexity score (lines + AST nodes).
  4. Metadata Enrichment: Algorithmic complexity (time_complexity, space_complexity), code length, and unified tags are automatically calculated.
  5. Conversational Alignment: Each example is converted into a ChatML-compatible messages list, making the dataset instantly ready for instruction tuning.
  6. Test Case Injection: Each example includes a test_code snippet with assertions, enabling execution-based evaluation and potential RLHF workflows.
  7. Safety Filtering: A scanner flags examples containing eval, exec, os.system, or subprocess calls, marking them with is_safe=False for optional exclusion.

βš–οΈ License & Terms

This dataset is free to use for any purpose (commercial, academic, or personal) without requiring a paid license. The only condition is mandatory attribution:

"PyMAX by Inserloft Research (Research.Inserloft.com)"

You must include this citation in your System Card, Model Card, or documentation where you reference public datasets used.


πŸ›οΈ Citation

If you use PyMAX in your research or publications, please cite:

@misc{pymax2026,
  title={PyMAX: Ultra Dataset for Python Learning},
  author={Inserloft Research},
  year={2026},
  month={August},
  url={https://huggingface.co/datasets/Inserloft/PyMAX},
}

πŸ‘₯ About Inserloft Research

Inserloft Research is an AI research organization focused on creating high-quality datasets and models for programming and software development. We specialize in synthetic data generation, code intelligence, and LLM fine-tuning.

🌐 Website: Research.Inserloft.com

πŸ“§ Contact: Inserloft@gmail.com


πŸ“œ Changelog

  • 2026-08-24 (v1.0): Initial release (250M examples, 8GB).
  • 2026-08-24 (v2.0): Major upgrade: 500M examples, AST validation, enriched metadata, ChatML format, test cases, safety flags, and optimized generation pipeline.

Β© 2026 Inserloft Research. All rights reserved.

Downloads last month
193