Skip to main content

Prompt and Answer Generation Tool

This tool generates structured conversations (prompts and answers) based on specified topics using language models.

Quick Start

Installation

Install the package using pip:

pip install mypromptgen

Setup

Configure your environment:

  1. Create .env file from example:
curl -O https://raw.githubusercontent.com/<username>/<repo>/main/.env.example
mv .env.example .env
  1. Add your API keys to .env:
OPENAI_API_KEY=sk-xxx       # For OpenAI
ANTHROPIC_API_KEY=sk-xxx    # For Claude
  1. Configure models and topics in .env:
PROMPTGEN_MODEL=gpt-3.5-turbo
ANSWERGEN_MODEL=gpt-4
TOPICS=Python,JavaScript
AMOUNTS=10

Generate Conversations

Run the main tool:

mypromptgen

Extended Features

Advanced Usage

  1. Distillation Training:
export DATA_FILE=conversations.json
python distill.py
  1. QLoRA Training:
export MODEL_NAME=unsloth/Qwen2.5-Coder-1.5B-Instruct
python qlora.py
  1. Migration:
python migrate.py input.json

Environment Configuration

Key Description
PROMPTGEN_MODEL Model for prompt generation
ANSWERGEN_MODEL Comma-separated answer gen models
TOPICS Comma-separated topic list
AMOUNTS Number of prompts per topic
MODEL_SPLIT Percentage weights for answer models
LOGITS Capture log probabilities (y/n)

Full variable list and detailed documentation at GitHub Repo

PyPI Publishing

  1. Create distribution:
python -m build
  1. Upload to PyPI:
twine upload dist/*

Release files for mypromptgen 0.3.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 mypromptgen 0.3.1
File Size Uploaded
mypromptgen-0.3.1.tar.gz 26.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mypromptgen 0.3.1
File Interpreter ABI Platform
mypromptgen-0.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 54.0 kB

Release files / mypromptgen-0.3.1.tar.gz

Download URL mypromptgen-0.3.1.tar.gz
Size 26.6 kB
Tags Source
SHA-256 checksum
How to use checksums
c048e6195bb902507be4c097d77561f3d72c777696fd21a56717d12c28a23d73
BLAKE2b-256 checksum
How to use checksums
a0b7037f84854be23c8500ad9875a4e04ad123f0fc41683c0d6a0dbccc62331b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.2

Release files / mypromptgen-0.3.1-py3-none-any.whl

Download URL mypromptgen-0.3.1-py3-none-any.whl
Size 27.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
49f6948c5adfcedd5c4e5136b0e5f066a1ec941a52d6af571d6d7d1e172fb962
BLAKE2b-256 checksum
How to use checksums
f7bbdbdcc29e536004d42f3f227437f9d1ebf018e6835dcf22c31f5746ee609c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.2

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

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