Name | funminks JSON |
Version |
0.1.1
JSON |
| download |
home_page | None |
Summary | FunMinks — utilities around LLM endpoints and mink population tools. |
upload_time | 2025-09-17 23:20:22 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.10 |
license | LICENSE |
keywords |
llm
transformers
pytorch
nlp
pandas
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
<p align="center">
<img src="./icons/main_logo.png" alt="FunMinks Logo"/>
</p>
# FunMinks: Genetic Algorithm Utilities for LLMs
FunMinks is a Python package for symbolic regression and genetic algorithm experimentation using Large Language Models (LLMs). It provides tools to define, mutate, and evolve code-based individuals ("minks") and manage populations, leveraging LLMs for code generation and mutation.
## What is FunMinks?
FunMinks enables evolutionary computation on code snippets, using LLMs to mutate and optimize Python functions to fit target data. It is designed for symbolic regression, automated code improvement, and research in genetic programming with LLMs.
- **Mink**: An individual represented by a genome (Python code), evaluated for fitness against datapoints.
- **Population**: A collection of minks, managed for selection, mutation, and evolution.
- **LLM Endpoint**: Utilities to load and interact with local LLM models for code generation.
## Features
- Symbolic regression using genetic algorithms and LLMs
- Population management and selection
- Code mutation via LLM prompts
- Fitness evaluation against custom datapoints
- Extensible for custom genetic operations
## Installation
It is recommended to use a virtual environment for isolation:
```powershell
# Create and activate a virtual environment
python -m venv .venv
.venv\Scripts\Activate.ps1
# Install FunMinks and dependencies
pip install -e .
```
Or install from source:
```powershell
pip install git+https://github.com/UGarCil/GeneticAlgoLLM.git
```
### Requirements
- Python >= 3.10
- [transformers](https://pypi.org/project/transformers/)
- [pandas](https://pypi.org/project/pandas/)
- [huggingface_hub](https://pypi.org/project/huggingface-hub/)
- torch (optional, see below)
If you need GPU support, install the appropriate version of torch:
```powershell
pip install torch --extra-index-url https://download.pytorch.org/whl/cu118
```
## Usage
### 1. Prepare Data and Templates
- Place your datapoints in `templates/datapoints.csv` (two columns: x, y)
- Use or modify `templates/prompt_template.txt` for LLM mutation prompts
- Use `templates/seed_code_template.txt` as the initial genome
### 2. Load LLM Endpoint
```python
from FunMinks.llm_endpoint import load_llm
llm_params = load_llm('path/to/your/model')
```
### 3. Create a Population
```python
from FunMinks.population import Population
from FunMinks.mink_llm_based import Mink
# Load templates and datapoints
with open('templates/prompt_template.txt') as f:
prompt = f.read()
with open('templates/seed_code_template.txt') as f:
seed_code = f.read()
with open('templates/datapoints.csv') as f:
datapoints = f.read()
# Initialize population
pop = Population(
pop_size=20,
seed_code=seed_code,
datapoints=datapoints,
prompt=prompt,
llm_params=llm_params
)
```
### 4. Run Evolution
```python
for generation in range(10):
pop.run_episode()
print(f"Generation {generation}: Avg fitness = {pop.avg_fitness}")
```
## Project Structure
```
FunMinks/
mink_llm_based.py # Mink class (individual)
population.py # Population management
llm_endpoint.py # LLM loading utilities
icons/
main_logo.png # Project logo
templates/
datapoints.csv # Example data
prompt_template.txt # LLM prompt template
seed_code_template.txt # Initial code genome
```
## License
This project is licensed under the MIT License. See [LICENSE](./LICENSE) for details.
## Author
Uriel Garcilazo Cruz
## Links
- [Homepage](https://ugarcil.github.io/GeneticAlgoLLM/)
- [Repository](https://github.com/UGarCil/GeneticAlgoLLM)
- [Bug Tracker](https://github.com/UGarCil/GeneticAlgoLLM/issues)
Raw data
{
"_id": null,
"home_page": null,
"name": "funminks",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "llm, transformers, pytorch, nlp, pandas",
"author": null,
"author_email": "Your Name <garcilazo.uriel@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/31/ee/d0069b0395a45d173d97991d2ac56a0ec4d0f455ae905173956b1164e89c/funminks-0.1.1.tar.gz",
"platform": null,
"description": "<p align=\"center\">\r\n <img src=\"./icons/main_logo.png\" alt=\"FunMinks Logo\"/>\r\n</p>\r\n\r\n# FunMinks: Genetic Algorithm Utilities for LLMs\r\n\r\nFunMinks is a Python package for symbolic regression and genetic algorithm experimentation using Large Language Models (LLMs). It provides tools to define, mutate, and evolve code-based individuals (\"minks\") and manage populations, leveraging LLMs for code generation and mutation.\r\n\r\n## What is FunMinks?\r\n\r\nFunMinks enables evolutionary computation on code snippets, using LLMs to mutate and optimize Python functions to fit target data. It is designed for symbolic regression, automated code improvement, and research in genetic programming with LLMs.\r\n\r\n- **Mink**: An individual represented by a genome (Python code), evaluated for fitness against datapoints.\r\n- **Population**: A collection of minks, managed for selection, mutation, and evolution.\r\n- **LLM Endpoint**: Utilities to load and interact with local LLM models for code generation.\r\n\r\n## Features\r\n- Symbolic regression using genetic algorithms and LLMs\r\n- Population management and selection\r\n- Code mutation via LLM prompts\r\n- Fitness evaluation against custom datapoints\r\n- Extensible for custom genetic operations\r\n\r\n## Installation\r\n\r\nIt is recommended to use a virtual environment for isolation:\r\n\r\n```powershell\r\n# Create and activate a virtual environment\r\npython -m venv .venv\r\n.venv\\Scripts\\Activate.ps1\r\n\r\n# Install FunMinks and dependencies\r\npip install -e .\r\n```\r\n\r\nOr install from source:\r\n\r\n```powershell\r\npip install git+https://github.com/UGarCil/GeneticAlgoLLM.git\r\n```\r\n\r\n### Requirements\r\n- Python >= 3.10\r\n- [transformers](https://pypi.org/project/transformers/)\r\n- [pandas](https://pypi.org/project/pandas/)\r\n- [huggingface_hub](https://pypi.org/project/huggingface-hub/)\r\n- torch (optional, see below)\r\n\r\nIf you need GPU support, install the appropriate version of torch:\r\n```powershell\r\npip install torch --extra-index-url https://download.pytorch.org/whl/cu118\r\n```\r\n\r\n## Usage\r\n\r\n### 1. Prepare Data and Templates\r\n- Place your datapoints in `templates/datapoints.csv` (two columns: x, y)\r\n- Use or modify `templates/prompt_template.txt` for LLM mutation prompts\r\n- Use `templates/seed_code_template.txt` as the initial genome\r\n\r\n### 2. Load LLM Endpoint\r\n```python\r\nfrom FunMinks.llm_endpoint import load_llm\r\nllm_params = load_llm('path/to/your/model')\r\n```\r\n\r\n### 3. Create a Population\r\n```python\r\nfrom FunMinks.population import Population\r\nfrom FunMinks.mink_llm_based import Mink\r\n\r\n# Load templates and datapoints\r\nwith open('templates/prompt_template.txt') as f:\r\n prompt = f.read()\r\nwith open('templates/seed_code_template.txt') as f:\r\n seed_code = f.read()\r\nwith open('templates/datapoints.csv') as f:\r\n datapoints = f.read()\r\n\r\n# Initialize population\r\npop = Population(\r\n pop_size=20,\r\n seed_code=seed_code,\r\n datapoints=datapoints,\r\n prompt=prompt,\r\n llm_params=llm_params\r\n)\r\n```\r\n\r\n### 4. Run Evolution\r\n```python\r\nfor generation in range(10):\r\n pop.run_episode()\r\n print(f\"Generation {generation}: Avg fitness = {pop.avg_fitness}\")\r\n```\r\n\r\n## Project Structure\r\n```\r\nFunMinks/\r\n mink_llm_based.py # Mink class (individual)\r\n population.py # Population management\r\n llm_endpoint.py # LLM loading utilities\r\nicons/\r\n main_logo.png # Project logo\r\ntemplates/\r\n datapoints.csv # Example data\r\n prompt_template.txt # LLM prompt template\r\n seed_code_template.txt # Initial code genome\r\n```\r\n\r\n## License\r\n\r\nThis project is licensed under the MIT License. See [LICENSE](./LICENSE) for details.\r\n\r\n## Author\r\nUriel Garcilazo Cruz\r\n\r\n## Links\r\n- [Homepage](https://ugarcil.github.io/GeneticAlgoLLM/)\r\n- [Repository](https://github.com/UGarCil/GeneticAlgoLLM)\r\n- [Bug Tracker](https://github.com/UGarCil/GeneticAlgoLLM/issues)\r\n\r\n",
"bugtrack_url": null,
"license": "LICENSE",
"summary": "FunMinks \u2014 utilities around LLM endpoints and mink population tools.",
"version": "0.1.1",
"project_urls": {
"Bug Tracker": "https://github.com/UGarCil/GeneticAlgoLLM/issues",
"Homepage": "https://ugarcil.github.io/GeneticAlgoLLM/",
"Repository": "https://github.com/UGarCil/GeneticAlgoLLM"
},
"split_keywords": [
"llm",
" transformers",
" pytorch",
" nlp",
" pandas"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "55798ccd7a96d71d3b0892f78689f3716cc0673d0d23e3e068aa2573a5c14cbb",
"md5": "9f4ee87551e36e6ed9183fba806dc421",
"sha256": "435a508542fd1792bbfd03545ff61dc0f07c11c3d16d76424b1fe27f14cdde6e"
},
"downloads": -1,
"filename": "funminks-0.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "9f4ee87551e36e6ed9183fba806dc421",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 9059,
"upload_time": "2025-09-17T23:20:21",
"upload_time_iso_8601": "2025-09-17T23:20:21.122635Z",
"url": "https://files.pythonhosted.org/packages/55/79/8ccd7a96d71d3b0892f78689f3716cc0673d0d23e3e068aa2573a5c14cbb/funminks-0.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "31eed0069b0395a45d173d97991d2ac56a0ec4d0f455ae905173956b1164e89c",
"md5": "86c1796504eb366af71321e5060739df",
"sha256": "9e02a6da6533910965b9b29b822b6316e8984b6faa3368a413070ea9a8b3dca7"
},
"downloads": -1,
"filename": "funminks-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "86c1796504eb366af71321e5060739df",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 8733,
"upload_time": "2025-09-17T23:20:22",
"upload_time_iso_8601": "2025-09-17T23:20:22.245156Z",
"url": "https://files.pythonhosted.org/packages/31/ee/d0069b0395a45d173d97991d2ac56a0ec4d0f455ae905173956b1164e89c/funminks-0.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-09-17 23:20:22",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "UGarCil",
"github_project": "GeneticAlgoLLM",
"github_not_found": true,
"lcname": "funminks"
}