|
1 | | -# Welcome to ReadMeReady |
| 1 | +# ReadmeReady |
2 | 2 |
|
3 | | -## Commands |
| 3 | +Auto-generate code documentation in Markdown format in seconds. |
4 | 4 |
|
5 | | -* `readme_ready` - Start generating README documentation. |
| 5 | +## What is ReadmeReady? |
6 | 6 |
|
7 | | -## Project layout |
| 7 | +Automated documentation of programming source code is a challenging task with significant practical and scientific implications for the developer community. ReadmeReady is a large language model (LLM)-based application that developers can use as a support tool to generate basic documentation for any publicly available or custom repository. Over the last decade, several research have been done on generating documentation for source code using neural network architectures. With the recent advancements in LLM technology, some open-source applications have been developed to address this problem. However, these applications typically rely on the OpenAI APIs, which incur substantial financial costs, particularly for large repositories. Moreover, none of these open-source applications offer a fine-tuned model or features to enable users to fine-tune custom LLMs. Additionally, finding suitable data for fine-tuning is often challenging. Our application addresses these issues. |
8 | 8 |
|
9 | | - mkdocs.yml # The configuration file. |
10 | | - docs/ |
11 | | - index.md # The documentation homepage. |
| 9 | +## Installation |
| 10 | + |
| 11 | +ReadmeReady is available only on Linux/Windows. |
| 12 | + |
| 13 | +### Dependencies |
| 14 | + |
| 15 | +Please follow the installation guide [here](https://pypi.org/project/python-magic/) to install `python-magic`. |
| 16 | + |
| 17 | +### Install it from PyPI |
| 18 | + |
| 19 | +The simplest way to install ReadmeReady and its dependencies is from PyPI with pip, Python's preferred package installer. |
| 20 | + |
| 21 | +```bash |
| 22 | +pip install readme_ready |
| 23 | +``` |
| 24 | + |
| 25 | +In order to upgrade ReadmeReady to the latest version, use pip as follows. |
| 26 | + |
| 27 | +```bash |
| 28 | +$ pip install -U readme_ready |
| 29 | +``` |
| 30 | + |
| 31 | +### Install it from source |
| 32 | + |
| 33 | +You can also install ReadmeReady from source as follows. |
| 34 | + |
| 35 | +```bash |
| 36 | +$ git clone https://github.com/souradipp76/ReadMeReady.git |
| 37 | +$ cd ReadMeReady |
| 38 | +$ make install |
| 39 | +``` |
| 40 | + |
| 41 | +To create a virtual environment before installing ReadmeReady, you can use the command: |
| 42 | +```bash |
| 43 | +$ make virtualenv |
| 44 | +$ source .venv/bin/activate |
| 45 | +``` |
| 46 | + |
| 47 | +## Usage |
| 48 | + |
| 49 | +### Initialize |
| 50 | +```bash |
| 51 | +$ export OPENAI_API_KEY=<YOUR_OPENAI_API_KEY> |
| 52 | +$ export HF_TOKEN=<YOUR_HUGGINGFACE_TOKEN> |
| 53 | +``` |
| 54 | + |
| 55 | +Set `OPENAI_API_KEY=dummy` to use only open-source models. |
| 56 | + |
| 57 | +### Command-Line |
| 58 | + |
| 59 | +```bash |
| 60 | +$ python -m readme_ready |
| 61 | +#or |
| 62 | +$ readme_ready |
| 63 | +``` |
| 64 | + |
| 65 | +### In Code |
| 66 | + |
| 67 | +```py |
| 68 | +from readme_ready.query import query |
| 69 | +from readme_ready.index import index |
| 70 | +from readme_ready.types import ( |
| 71 | + AutodocReadmeConfig, |
| 72 | + AutodocRepoConfig, |
| 73 | + AutodocUserConfig, |
| 74 | + LLMModels, |
| 75 | +) |
| 76 | + |
| 77 | +model = LLMModels.LLAMA2_7B_CHAT_GPTQ # Choose model from supported models |
| 78 | + |
| 79 | +repo_config = AutodocRepoConfig ( |
| 80 | + name = "<NAME>", # Replace <NAME> |
| 81 | + root = "<PROJECT_ROOT>", # Replace <PROJECT_ROOT> |
| 82 | + repository_url = "<PROJECT_URL>", # Replace <PROJECT_URL> |
| 83 | + output = "<OUTPUT_DIR>", # Replace <OUTPUT_DIR> |
| 84 | + llms = [model], |
| 85 | + peft_model_path = "<PEFT_MODEL_NAME_OR_PATH>", # Replace <PEFT_MODEL_NAME_OR_PATH> |
| 86 | + ignore = [ |
| 87 | + ".*", |
| 88 | + "*package-lock.json", |
| 89 | + "*package.json", |
| 90 | + "node_modules", |
| 91 | + "*dist*", |
| 92 | + "*build*", |
| 93 | + "*test*", |
| 94 | + "*.svg", |
| 95 | + "*.md", |
| 96 | + "*.mdx", |
| 97 | + "*.toml" |
| 98 | + ], |
| 99 | + file_prompt = "", |
| 100 | + folder_prompt = "", |
| 101 | + chat_prompt = "", |
| 102 | + content_type = "docs", |
| 103 | + target_audience = "smart developer", |
| 104 | + link_hosted = True, |
| 105 | + priority = None, |
| 106 | + max_concurrent_calls = 50, |
| 107 | + add_questions = False, |
| 108 | + device = "auto", # Select device "cpu" or "auto" |
| 109 | +) |
| 110 | + |
| 111 | +user_config = AutodocUserConfig( |
| 112 | + llms = [model] |
| 113 | +) |
| 114 | + |
| 115 | +readme_config = AutodocReadmeConfig( |
| 116 | + headings = "Description,Requirements,Installation,Usage,Contributing,License" |
| 117 | +) |
| 118 | + |
| 119 | +index.index(repo_config) |
| 120 | +query.generate_readme(repo_config, user_config, readme_config) |
| 121 | +``` |
| 122 | + |
| 123 | +Run the sample script in the `examples/example.py` to see a typical code usage. |
0 commit comments