Lightweight tool to manage contexts and update code with LLMs
Project description
About
PatchLLM lets you flexibly build LLM context from your codebase using search patterns, and automatically edit files from the LLM response in a couple lines of code.
Usage
Here's a basic example of how to use the Assistant class:
from main import Assistant
assistant = Assistant()
context = assistant.collect(config_name="default")
>> The following files were extracted:
>> my_project
>> ├── README.md
>> ├── configs.py
>> ├── context.py
>> ├── main.py
>> ├── parser.py
>> ├── requirements.txt
>> ├── systems.py
>> └── utils.py
assistant.update("Fix any bug in these files", context=context)
>> Wrote 5438 bytes to '/my_project/context.py'
>> Wrote 1999 bytes to '/my_project/utils.py'
>> Wrote 2345 bytes to '/my_project/main.py'
You can decide which files to include / exclude from the prompt by adding a config in configs.py, specifying:
path: The root path from which to perform the file searchinclude_patterns: A list of glob patterns for files to include. e.g[./**/*]exclude_patterns: A list of glob patterns for files to exlucde. e.g[./*.md]search_word: A list of keywords included in the target files. e.g["config"]exclude_extensions: A list of file extensions to exclude. e.g[.jpg]
Setup
PatchLLM uses LiteLLM under the hood. Please refer to their documentation for environment variable naming and available models.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file patchllm-0.1.0.tar.gz.
File metadata
- Download URL: patchllm-0.1.0.tar.gz
- Upload date:
- Size: 10.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
906b9478af76c85de3b83ae9ace84887d54d3d652ef24c0d576c0fdd370ac1bd
|
|
| MD5 |
f9a7b0f00df835d98315459c4a794e54
|
|
| BLAKE2b-256 |
60ba3d53e2e56f19630e36c3b8e342c8de4f339c1d000c3fa8f6d4810fad3b89
|
File details
Details for the file patchllm-0.1.0-py3-none-any.whl.
File metadata
- Download URL: patchllm-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
79f67e9e01a41e515c0de3e11738395615f76cb9198ca3fe3ac640f0058b46fe
|
|
| MD5 |
6af2681db53147ff74985b047158d8c9
|
|
| BLAKE2b-256 |
ab9cf1248444c79b282339bfb3eb0006ba537645149cd4a8850ba45d07cdf88c
|