A library of ready-to-use LLM components
Project description
LLM Components
Overview
llm-components
is a Python library designed to feed large language models with data from different sources. The library formats content in a structured markdown format.
The first data source implemented is a code base (a folder containing a gitignore file).
Features
- Traverse a directory tree while respecting
.gitignore
rules. - Format the directory structure and file contents into a readable markdown format.
- Command-line interface for easy usage.
Installation
To install the llm-components
library, you can use pip:
pip install llm-components
Usage
Command-Line Interface
You can use the command-line interface to map a code base to markdown. The CLI takes the root directory of the code base as an argument.
format-codebase <root_dir>
Example
format-codebase /path/to/your/code/base
This will output the directory structure and file contents in a structured markdown format.
Programmatic Usage
You can also use the library programmatically by importing the necessary functions.
from pathlib import Path
from llm_components.loaders import map_codebase_to_text
root_dir = Path("/path/to/your/code/base")
result = map_codebase_to_text(root_dir)
print(result)
License
This project is licensed under the MIT License.
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
Hashes for llm_components-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d0972c2790047cac9e6e0baa14d183b532d1cf691c3330513615687d3c12202e |
|
MD5 | 977a6a74b1a672d2d523a6f93a8b6dd5 |
|
BLAKE2b-256 | 098aed9f50b88f2ea1511e246f7614fbe08ed4243cc7d701b50bfc80b3c3cd07 |