# **PromptFletcher**
**A Python library for auto-prompt engineering and optimization for LLMs.**
      
---
**PromptFletcher** is a **lightweight** and **fast** Python library designed for:
**Refining & optimizing prompts** using NLTK-based NLP techniques
**Context-aware prompt tuning** for better responses
**Heuristic-based evaluation** to rank prompts
**Fast execution without large transformer models**
---
## **Installation**
### **From PyPI**
```bash
pip install promptfletcher
```
### **From GitHub**
```bash
pip install git+https://github.com/Vikhram-S/PromptFletcher.git
```
---
## **Quick Start**
### **Import & Initialize**
```python
from promptfletcher import AutoPromptEngineer
engineer = AutoPromptEngineer()
```
### **Define Context & Prompt**
```python
context = "We are exploring ways to enhance prompt engineering for LLMs."
initial_prompt = "How can I improve my AI-generated responses?"
```
### **Optimize the Prompt**
```python
refined_prompt = engineer.refine_prompt(initial_prompt, context)
print("Refined Prompt:", refined_prompt)
```
---
## **Features**
**Automated Prompt Refinement** – Uses NLP techniques to improve prompt clarity.
**LLM Response Evaluation** – Integrates with open-source models like GPT-Neo & BLOOM.
**Contextual Understanding** – Ensures prompts align with relevant topics.
**Lightweight & Fast** – Minimal dependencies, designed for efficiency.
---
## **API Reference**
### **`AutoPromptEngineer` Class**
#### `refine_prompt(prompt: str, context: str, iterations: int = 3) -> str`
**Refines a given prompt based on context and heuristic scoring.**
```python
engineer.refine_prompt("How do I make my AI-generated text more accurate?", "LLM optimization")
```
#### `evaluate_prompt(prompt: str, context: str) -> float`
**Assigns a heuristic score to a prompt based on clarity and relevance.**
```python
score = engineer.evaluate_prompt("Tell me about AI safety?", "Machine Learning Ethics")
print("Prompt Score:", score)
```
---
## **Dependencies**
- `nltk>=3.6.0`
- `numpy>=1.21.0`
- `regex>=2023.3.23`
Install dependencies manually:
```bash
pip install -r requirements.txt
```
---
## **License**
**PromptFletcher** is licensed under the **MIT License** – free to use, modify, and distribute.
---
## **Contributing**
We welcome contributions!
1. Fork the repository
2. Create a feature branch (`git checkout -b feature-new`)
3. Commit changes & push (`git push origin feature-new`)
4. Open a **Pull Request**
---
## **Contact & Support**
- **GitHub Issues:** [Report Bugs](https://github.com/Vikhram-S/PromptFletcher/issues)
- **Email:** vikhrams@saveetha.ac.in
**If you find this useful, give us a star on GitHub!**
---
Raw data
{
"_id": null,
"home_page": "https://github.com/Vikhram-S/PromptFletcher",
"name": "promptfletcher",
"maintainer": null,
"docs_url": null,
"requires_python": "<3.14,>=3.7",
"maintainer_email": null,
"keywords": null,
"author": "Vikhram S",
"author_email": "vikhrams@saveetha.ac.in",
"download_url": "https://files.pythonhosted.org/packages/5f/82/467b55c3bc1002610e55a0c9f5aac29289652c1183d2444565d220e703c1/promptfletcher-0.1.2.tar.gz",
"platform": null,
"description": "# **PromptFletcher** \r\n**A Python library for auto-prompt engineering and optimization for LLMs.** \r\n\r\n       \r\n\r\n---\r\n\r\n**PromptFletcher** is a **lightweight** and **fast** Python library designed for: \r\n **Refining & optimizing prompts** using NLTK-based NLP techniques \r\n **Context-aware prompt tuning** for better responses \r\n **Heuristic-based evaluation** to rank prompts \r\n **Fast execution without large transformer models**\r\n\r\n---\r\n\r\n## **Installation** \r\n### **From PyPI**\r\n```bash\r\npip install promptfletcher\r\n```\r\n### **From GitHub**\r\n```bash\r\npip install git+https://github.com/Vikhram-S/PromptFletcher.git\r\n```\r\n\r\n---\r\n\r\n## **Quick Start** \r\n### **Import & Initialize** \r\n```python\r\nfrom promptfletcher import AutoPromptEngineer\r\n\r\nengineer = AutoPromptEngineer()\r\n```\r\n\r\n### **Define Context & Prompt** \r\n```python\r\ncontext = \"We are exploring ways to enhance prompt engineering for LLMs.\"\r\ninitial_prompt = \"How can I improve my AI-generated responses?\"\r\n```\r\n\r\n### **Optimize the Prompt** \r\n```python\r\nrefined_prompt = engineer.refine_prompt(initial_prompt, context)\r\nprint(\"Refined Prompt:\", refined_prompt)\r\n```\r\n\r\n---\r\n\r\n## **Features** \r\n**Automated Prompt Refinement** \u2013 Uses NLP techniques to improve prompt clarity. \r\n**LLM Response Evaluation** \u2013 Integrates with open-source models like GPT-Neo & BLOOM. \r\n**Contextual Understanding** \u2013 Ensures prompts align with relevant topics. \r\n**Lightweight & Fast** \u2013 Minimal dependencies, designed for efficiency. \r\n\r\n---\r\n\r\n## **API Reference** \r\n### **`AutoPromptEngineer` Class**\r\n#### `refine_prompt(prompt: str, context: str, iterations: int = 3) -> str` \r\n**Refines a given prompt based on context and heuristic scoring.** \r\n```python\r\nengineer.refine_prompt(\"How do I make my AI-generated text more accurate?\", \"LLM optimization\")\r\n```\r\n\r\n#### `evaluate_prompt(prompt: str, context: str) -> float` \r\n**Assigns a heuristic score to a prompt based on clarity and relevance.** \r\n```python\r\nscore = engineer.evaluate_prompt(\"Tell me about AI safety?\", \"Machine Learning Ethics\")\r\nprint(\"Prompt Score:\", score)\r\n```\r\n\r\n---\r\n\r\n## **Dependencies**\r\n- `nltk>=3.6.0`\r\n- `numpy>=1.21.0`\r\n- `regex>=2023.3.23`\r\n\r\nInstall dependencies manually:\r\n```bash\r\npip install -r requirements.txt\r\n```\r\n\r\n---\r\n\r\n## **License** \r\n**PromptFletcher** is licensed under the **MIT License** \u2013 free to use, modify, and distribute. \r\n\r\n---\r\n\r\n## **Contributing** \r\nWe welcome contributions! \r\n1. Fork the repository \r\n2. Create a feature branch (`git checkout -b feature-new`) \r\n3. Commit changes & push (`git push origin feature-new`) \r\n4. Open a **Pull Request** \r\n\r\n---\r\n\r\n## **Contact & Support** \r\n- **GitHub Issues:** [Report Bugs](https://github.com/Vikhram-S/PromptFletcher/issues) \r\n- **Email:** vikhrams@saveetha.ac.in \r\n\r\n**If you find this useful, give us a star on GitHub!** \r\n\r\n---\r\n",
"bugtrack_url": null,
"license": null,
"summary": "A Python library for auto-prompt engineering and optimization for LLMs.",
"version": "0.1.2",
"project_urls": {
"Bug Tracker": "https://github.com/Vikhram-S/PromptFletcher/issues",
"Documentation": "https://github.com/Vikhram-S/PromptFletcher#readme",
"Homepage": "https://github.com/Vikhram-S/PromptFletcher",
"Source Code": "https://github.com/Vikhram-S/PromptFletcher"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "63f2582f724fb3a05b31a981f64db89233147299bd39ac3d65b9590fc08a7cbf",
"md5": "10207544e36c0ddc33877b4cefd3ab46",
"sha256": "642617d5a8fc51459f719d3cbe1199abfe20f062ec10f7366224c65acb148f6e"
},
"downloads": -1,
"filename": "promptfletcher-0.1.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "10207544e36c0ddc33877b4cefd3ab46",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<3.14,>=3.7",
"size": 2829,
"upload_time": "2025-02-10T13:40:09",
"upload_time_iso_8601": "2025-02-10T13:40:09.597141Z",
"url": "https://files.pythonhosted.org/packages/63/f2/582f724fb3a05b31a981f64db89233147299bd39ac3d65b9590fc08a7cbf/promptfletcher-0.1.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "5f82467b55c3bc1002610e55a0c9f5aac29289652c1183d2444565d220e703c1",
"md5": "db08888901fc744147e732ce84db74c8",
"sha256": "af384df36565dc285b4caf489107c644be3084bdc70f3335efbaae0faa77475c"
},
"downloads": -1,
"filename": "promptfletcher-0.1.2.tar.gz",
"has_sig": false,
"md5_digest": "db08888901fc744147e732ce84db74c8",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<3.14,>=3.7",
"size": 3278,
"upload_time": "2025-02-10T13:40:12",
"upload_time_iso_8601": "2025-02-10T13:40:12.758625Z",
"url": "https://files.pythonhosted.org/packages/5f/82/467b55c3bc1002610e55a0c9f5aac29289652c1183d2444565d220e703c1/promptfletcher-0.1.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-02-10 13:40:12",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Vikhram-S",
"github_project": "PromptFletcher",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "promptfletcher"
}