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:
- Create
.envfile from example:
curl -O https://raw.githubusercontent.com/<username>/<repo>/main/.env.example
mv .env.example .env
- Add your API keys to
.env:
OPENAI_API_KEY=sk-xxx # For OpenAI
ANTHROPIC_API_KEY=sk-xxx # For Claude
- 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
- Distillation Training:
export DATA_FILE=conversations.json
python distill.py
- QLoRA Training:
export MODEL_NAME=unsloth/Qwen2.5-Coder-1.5B-Instruct
python qlora.py
- 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
- Create distribution:
python -m build
- 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)
| File | Size | Uploaded | |
|---|---|---|---|
| mypromptgen-0.3.1.tar.gz | 26.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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
|