Skip to main content

Lightweight tool to manage contexts and update code with LLMs

Project description

PatchLLM Logo

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 search
  • include_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

patchllm-0.1.1.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

patchllm-0.1.1-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file patchllm-0.1.1.tar.gz.

File metadata

  • Download URL: patchllm-0.1.1.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.15

File hashes

Hashes for patchllm-0.1.1.tar.gz
Algorithm Hash digest
SHA256 943337a7eae555ad2ddd6852e10c1ff2f97d8902ed1cadcb8e2950c47ea69607
MD5 73de767d54a790b12f78e2eda935c9b0
BLAKE2b-256 5dfbf75e6f4df0c4629eca131521e2ddae0082bd2802857d63baf58a8ec4eb6d

See more details on using hashes here.

File details

Details for the file patchllm-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: patchllm-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 11.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.15

File hashes

Hashes for patchllm-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fdc03aa2fb16e03421f5ecea49ed9f15ae468b4cbd1528a41f8ebe37a7f29c8d
MD5 521fc336038f38aa0681f830125b2b5f
BLAKE2b-256 767f60349c54206568be9c1451e6ba2a6604c557305bda1a79a264620ce83a37

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page