AI development/GitHub/Framework

GeneticPromptLab

by AmanPriyanshu·Last observed 2026-10-27
★ 36 stars⑂ 4 forks

GeneticPromptLab is a Python library for automated prompt engineering with large language models. It samples a diverse subset of training data using Sentence Transformers embeddings and k-means, then iterates through prompt fitness evaluation, selection, crossover, and mutation. It is configured for TREC and AG News classification experiments.

Useful for

  • Optimize prompts for an AG News classifier by providing training questions and labels to the optimizer and running its genetic algorithm.

Key features

  • Runs a genetic algorithm cycle that initializes prompts, evaluates fitness, selects prompts, then applies crossover and mutation.
  • Uses Sentence Transformers embeddings and k-means clustering to sample representative, diverse training data.
  • Supports preconfigured experiments on TREC and AG News text classification datasets.

Requirements & limitations

  • The documented setup installs the library with pip; the workflow initializes an OpenAI client, and the library uses Sentence Transformers for embeddings.

Project information

CategoryAI development
TypeFramework
Author / organizationAmanPriyanshu
LicenseMIT
Last observed2026-10-27

Discussion

No comments yet.

Sign in with Google to comment. Browsing is open to everyone.

Community vote